Merge pull request 'zzw-one' (#29) from zzw-one into master
Reviewed-on: #29
This commit is contained in:
commit
91efcd403a
@ -9,5 +9,8 @@ public interface ErrorCodeConstants {
|
||||
ErrorCode ASSET_NOT_EXISTS = new ErrorCode(1_005_001_000, "设备不存在");
|
||||
ErrorCode CHECK_TICKET_NOT_EXISTS = new ErrorCode(1_005_001_001, "检票不存在");
|
||||
ErrorCode SALE_DATA_NOT_EXISTS = new ErrorCode(1_005_001_002, "售票不存在");
|
||||
ErrorCode INFORMATION_NOT_EXISTS = new ErrorCode(1_005_002_001, "旅客信息不存在");
|
||||
ErrorCode ALL_NOT_EXISTS = new ErrorCode(1_005_003_001, "设备登录日志不存在");
|
||||
ErrorCode UM_NOT_EXISTS = new ErrorCode(1_005_004_001, "上行报文不存在");
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,97 @@
|
||||
package cn.iocoder.yudao.module.ticket.controller.admin.assetLoginLog;
|
||||
|
||||
import cn.iocoder.yudao.module.ticket.controller.admin.assetLoginLog.vo.AssetLoginLogPageReqVO;
|
||||
import cn.iocoder.yudao.module.ticket.controller.admin.assetLoginLog.vo.AssetLoginLogRespVO;
|
||||
import cn.iocoder.yudao.module.ticket.controller.admin.assetLoginLog.vo.AssetLoginLogSaveReqVO;
|
||||
import cn.iocoder.yudao.module.ticket.dal.dataobject.assetLoginLog.AssetLoginLogDO;
|
||||
import cn.iocoder.yudao.module.ticket.service.assetLoginLog.AssetLoginLogService;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.*;
|
||||
import javax.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
|
||||
@Tag(name = "管理后台 - 设备登录日志")
|
||||
@RestController
|
||||
@RequestMapping("/ticket/assetLoginLog")
|
||||
@Validated
|
||||
public class AssetLoginLogController {
|
||||
|
||||
@Resource
|
||||
private AssetLoginLogService Service;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建设备登录日志")
|
||||
@PreAuthorize("@ss.hasPermission('assetLoginLog::create')")
|
||||
public CommonResult<Long> create(@Valid @RequestBody AssetLoginLogSaveReqVO createReqVO) {
|
||||
return success(Service.create(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新设备登录日志")
|
||||
@PreAuthorize("@ss.hasPermission('assetLoginLog::update')")
|
||||
public CommonResult<Boolean> update(@Valid @RequestBody AssetLoginLogSaveReqVO updateReqVO) {
|
||||
Service.update(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除设备登录日志")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('assetLoginLog::delete')")
|
||||
public CommonResult<Boolean> delete(@RequestParam("id") Long id) {
|
||||
Service.delete(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得设备登录日志")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('assetLoginLog::query')")
|
||||
public CommonResult<AssetLoginLogRespVO> get(@RequestParam("id") Long id) {
|
||||
AssetLoginLogDO loginLogDO = Service.get(id);
|
||||
return success(BeanUtils.toBean(loginLogDO, AssetLoginLogRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得设备登录日志分页")
|
||||
@PreAuthorize("@ss.hasPermission('assetLoginLog::query')")
|
||||
public CommonResult<PageResult<AssetLoginLogRespVO>> getPage(@Valid AssetLoginLogPageReqVO pageReqVO) {
|
||||
PageResult<AssetLoginLogDO> pageResult = Service.getPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, AssetLoginLogRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出设备登录日志 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('assetLoginLog::export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportExcel(@Valid AssetLoginLogPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<AssetLoginLogDO> list = Service.getPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "设备登录日志.xls", "数据", AssetLoginLogRespVO.class,
|
||||
BeanUtils.toBean(list, AssetLoginLogRespVO.class));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,47 @@
|
||||
package cn.iocoder.yudao.module.ticket.controller.admin.assetLoginLog.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 设备登录日志分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class AssetLoginLogPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
@Schema(description = "登录时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] loginTime;
|
||||
|
||||
@Schema(description = "设备编号", example = "13173")
|
||||
private String deviceId;
|
||||
|
||||
@Schema(description = "设备类型", example = "1")
|
||||
private String assetType;
|
||||
|
||||
@Schema(description = "设备名称", example = "王五")
|
||||
private String assetName;
|
||||
|
||||
@Schema(description = "识别码")
|
||||
private String identificationCode;
|
||||
|
||||
@Schema(description = "登录结果", example = "1")
|
||||
private Boolean status;
|
||||
|
||||
@Schema(description = "登录备注", example = "你猜")
|
||||
private String loginRemark;
|
||||
|
||||
@Schema(description = "登录参数")
|
||||
private String loginParameter;
|
||||
|
||||
}
|
@ -0,0 +1,56 @@
|
||||
package cn.iocoder.yudao.module.ticket.controller.admin.assetLoginLog.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 设备登录日志 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class AssetLoginLogRespVO {
|
||||
|
||||
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "30783")
|
||||
@ExcelProperty("编号")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "登录时间")
|
||||
@ExcelProperty("登录时间")
|
||||
private LocalDateTime loginTime;
|
||||
|
||||
@Schema(description = "设备编号", example = "13173")
|
||||
@ExcelProperty("设备编号")
|
||||
private String deviceId;
|
||||
|
||||
@Schema(description = "设备类型", example = "1")
|
||||
@ExcelProperty("设备类型")
|
||||
private String assetType;
|
||||
|
||||
@Schema(description = "设备名称", example = "王五")
|
||||
@ExcelProperty("设备名称")
|
||||
private String assetName;
|
||||
|
||||
@Schema(description = "识别码")
|
||||
@ExcelProperty("识别码")
|
||||
private String identificationCode;
|
||||
|
||||
@Schema(description = "登录结果", example = "1")
|
||||
@ExcelProperty("登录结果")
|
||||
private Boolean status;
|
||||
|
||||
@Schema(description = "登录备注", example = "你猜")
|
||||
@ExcelProperty("登录备注")
|
||||
private String loginRemark;
|
||||
|
||||
@Schema(description = "登录参数")
|
||||
@ExcelProperty("登录参数")
|
||||
private String loginParameter;
|
||||
|
||||
}
|
@ -0,0 +1,41 @@
|
||||
package cn.iocoder.yudao.module.ticket.controller.admin.assetLoginLog.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import javax.validation.constraints.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 设备登录日志新增/修改 Request VO")
|
||||
@Data
|
||||
public class AssetLoginLogSaveReqVO {
|
||||
|
||||
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "30783")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "登录时间")
|
||||
private LocalDateTime loginTime;
|
||||
|
||||
@Schema(description = "设备编号", example = "13173")
|
||||
private String deviceId;
|
||||
|
||||
@Schema(description = "设备类型", example = "1")
|
||||
private String assetType;
|
||||
|
||||
@Schema(description = "设备名称", example = "王五")
|
||||
private String assetName;
|
||||
|
||||
@Schema(description = "识别码")
|
||||
private String identificationCode;
|
||||
|
||||
@Schema(description = "登录结果", example = "1")
|
||||
private Boolean status;
|
||||
|
||||
@Schema(description = "登录备注", example = "你猜")
|
||||
private String loginRemark;
|
||||
|
||||
@Schema(description = "登录参数")
|
||||
private String loginParameter;
|
||||
|
||||
}
|
@ -0,0 +1,97 @@
|
||||
package cn.iocoder.yudao.module.ticket.controller.admin.information;
|
||||
|
||||
import cn.iocoder.yudao.module.ticket.controller.admin.information.vo.InformationPageReqVO;
|
||||
import cn.iocoder.yudao.module.ticket.controller.admin.information.vo.InformationRespVO;
|
||||
import cn.iocoder.yudao.module.ticket.controller.admin.information.vo.InformationSaveReqVO;
|
||||
import cn.iocoder.yudao.module.ticket.dal.dataobject.information.InformationDO;
|
||||
import cn.iocoder.yudao.module.ticket.service.information.InformationService;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.*;
|
||||
import javax.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
|
||||
@Tag(name = "管理后台 - 旅客信息")
|
||||
@RestController
|
||||
@RequestMapping("/ticket/information")
|
||||
@Validated
|
||||
public class InformationController {
|
||||
|
||||
@Resource
|
||||
private InformationService informationService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建旅客信息")
|
||||
@PreAuthorize("@ss.hasPermission('passenger:information:create')")
|
||||
public CommonResult<Long> createInformation(@Valid @RequestBody InformationSaveReqVO createReqVO) {
|
||||
return success(informationService.createInformation(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新旅客信息")
|
||||
@PreAuthorize("@ss.hasPermission('passenger:information:update')")
|
||||
public CommonResult<Boolean> updateInformation(@Valid @RequestBody InformationSaveReqVO updateReqVO) {
|
||||
informationService.updateInformation(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除旅客信息")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('passenger:information:delete')")
|
||||
public CommonResult<Boolean> deleteInformation(@RequestParam("id") Long id) {
|
||||
informationService.deleteInformation(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得旅客信息")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('passenger:information:query')")
|
||||
public CommonResult<InformationRespVO> getInformation(@RequestParam("id") Long id) {
|
||||
InformationDO information = informationService.getInformation(id);
|
||||
return success(BeanUtils.toBean(information, InformationRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得旅客信息分页")
|
||||
@PreAuthorize("@ss.hasPermission('passenger:information:query')")
|
||||
public CommonResult<PageResult<InformationRespVO>> getInformationPage(@Valid InformationPageReqVO pageReqVO) {
|
||||
PageResult<InformationDO> pageResult = informationService.getInformationPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, InformationRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出旅客信息 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('passenger:information:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportInformationExcel(@Valid InformationPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<InformationDO> list = informationService.getInformationPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "旅客信息.xls", "数据", InformationRespVO.class,
|
||||
BeanUtils.toBean(list, InformationRespVO.class));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,35 @@
|
||||
package cn.iocoder.yudao.module.ticket.controller.admin.information.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 旅客信息分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class InformationPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
@Schema(description = "设备编号", example = "19443")
|
||||
private String deviceId;
|
||||
|
||||
@Schema(description = "姓名", example = "李四")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "身份证")
|
||||
private String idCard;
|
||||
|
||||
@Schema(description = "上传时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] commitTime;
|
||||
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
package cn.iocoder.yudao.module.ticket.controller.admin.information.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 旅客信息 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class InformationRespVO {
|
||||
|
||||
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "30182")
|
||||
@ExcelProperty("编号")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "设备编号", example = "19443")
|
||||
@ExcelProperty("设备编号")
|
||||
private String deviceId;
|
||||
|
||||
@Schema(description = "姓名", example = "李四")
|
||||
@ExcelProperty("姓名")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "身份证")
|
||||
@ExcelProperty("身份证")
|
||||
private String idCard;
|
||||
|
||||
@Schema(description = "上传时间")
|
||||
@ExcelProperty("上传时间")
|
||||
private LocalDateTime commitTime;
|
||||
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
package cn.iocoder.yudao.module.ticket.controller.admin.information.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import javax.validation.constraints.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 旅客信息新增/修改 Request VO")
|
||||
@Data
|
||||
public class InformationSaveReqVO {
|
||||
|
||||
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "30182")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "设备编号", example = "19443")
|
||||
private String deviceId;
|
||||
|
||||
@Schema(description = "姓名", example = "李四")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "身份证")
|
||||
private String idCard;
|
||||
|
||||
@Schema(description = "上传时间")
|
||||
private LocalDateTime commitTime;
|
||||
|
||||
}
|
@ -0,0 +1,97 @@
|
||||
package cn.iocoder.yudao.module.ticket.controller.admin.uplinkMessage;
|
||||
|
||||
import cn.iocoder.yudao.module.ticket.controller.admin.uplinkMessage.vo.UplinkMessagePageReqVO;
|
||||
import cn.iocoder.yudao.module.ticket.controller.admin.uplinkMessage.vo.UplinkMessageRespVO;
|
||||
import cn.iocoder.yudao.module.ticket.controller.admin.uplinkMessage.vo.UplinkMessageSaveReqVO;
|
||||
import cn.iocoder.yudao.module.ticket.dal.dataobject.uplinkMessage.UplinkMessageDO;
|
||||
import cn.iocoder.yudao.module.ticket.service.uplinkMessage.UplinkMessageService;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.*;
|
||||
import javax.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
|
||||
@Tag(name = "管理后台 - 上行报文")
|
||||
@RestController
|
||||
@RequestMapping("/ticket/uplinkMessage")
|
||||
@Validated
|
||||
public class UplinkMessageController {
|
||||
|
||||
@Resource
|
||||
private UplinkMessageService Service;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建上行报文")
|
||||
@PreAuthorize("@ss.hasPermission('uplinkMessage::create')")
|
||||
public CommonResult<Long> create(@Valid @RequestBody UplinkMessageSaveReqVO createReqVO) {
|
||||
return success(Service.create(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新上行报文")
|
||||
@PreAuthorize("@ss.hasPermission('uplinkMessage::update')")
|
||||
public CommonResult<Boolean> update(@Valid @RequestBody UplinkMessageSaveReqVO updateReqVO) {
|
||||
Service.update(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除上行报文")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('uplinkMessage::delete')")
|
||||
public CommonResult<Boolean> delete(@RequestParam("id") Long id) {
|
||||
Service.delete(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得上行报文")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('uplinkMessage::query')")
|
||||
public CommonResult<UplinkMessageRespVO> get(@RequestParam("id") Long id) {
|
||||
UplinkMessageDO uplinkMessageDO = Service.get(id);
|
||||
return success(BeanUtils.toBean(uplinkMessageDO, UplinkMessageRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得上行报文分页")
|
||||
@PreAuthorize("@ss.hasPermission('uplinkMessage::query')")
|
||||
public CommonResult<PageResult<UplinkMessageRespVO>> getPage(@Valid UplinkMessagePageReqVO pageReqVO) {
|
||||
PageResult<UplinkMessageDO> pageResult = Service.getPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, UplinkMessageRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出上行报文 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('uplinkMessage::export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportExcel(@Valid UplinkMessagePageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<UplinkMessageDO> list = Service.getPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "上行报文.xls", "数据", UplinkMessageRespVO.class,
|
||||
BeanUtils.toBean(list, UplinkMessageRespVO.class));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,41 @@
|
||||
package cn.iocoder.yudao.module.ticket.controller.admin.uplinkMessage.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 上行报文分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class UplinkMessagePageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
@Schema(description = "上报时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] commitTime;
|
||||
|
||||
@Schema(description = "设备编号", example = "650")
|
||||
private String deviceId;
|
||||
|
||||
@Schema(description = "设备名称", example = "芋艿")
|
||||
private String deviceName;
|
||||
|
||||
@Schema(description = "状态", example = "1")
|
||||
private Boolean status;
|
||||
|
||||
@Schema(description = "上行报文")
|
||||
private String resBody;
|
||||
|
||||
@Schema(description = "备注", example = "你说的对")
|
||||
private String remark;
|
||||
|
||||
}
|
@ -0,0 +1,51 @@
|
||||
package cn.iocoder.yudao.module.ticket.controller.admin.uplinkMessage.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat;
|
||||
import cn.iocoder.yudao.framework.excel.core.convert.DictConvert;
|
||||
|
||||
@Schema(description = "管理后台 - 上行报文 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class UplinkMessageRespVO {
|
||||
|
||||
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "4333")
|
||||
@ExcelProperty("编号")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "上报时间")
|
||||
@ExcelProperty("上报时间")
|
||||
private LocalDateTime commitTime;
|
||||
|
||||
@Schema(description = "设备编号", example = "650")
|
||||
@ExcelProperty("设备编号")
|
||||
private String deviceId;
|
||||
|
||||
@Schema(description = "设备名称", example = "芋艿")
|
||||
@ExcelProperty("设备名称")
|
||||
private String deviceName;
|
||||
|
||||
@Schema(description = "状态", example = "1")
|
||||
@ExcelProperty(value = "状态", converter = DictConvert.class)
|
||||
@DictFormat("uplink_message_status") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中
|
||||
private Boolean status;
|
||||
|
||||
@Schema(description = "上行报文", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("上行报文")
|
||||
private String resBody;
|
||||
|
||||
@Schema(description = "备注", example = "你说的对")
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
package cn.iocoder.yudao.module.ticket.controller.admin.uplinkMessage.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import javax.validation.constraints.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 上行报文新增/修改 Request VO")
|
||||
@Data
|
||||
public class UplinkMessageSaveReqVO {
|
||||
|
||||
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "4333")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "上报时间")
|
||||
private LocalDateTime commitTime;
|
||||
|
||||
@Schema(description = "设备编号", example = "650")
|
||||
private String deviceId;
|
||||
|
||||
@Schema(description = "设备名称", example = "芋艿")
|
||||
private String deviceName;
|
||||
|
||||
@Schema(description = "状态", example = "1")
|
||||
private Boolean status;
|
||||
|
||||
@Schema(description = "上行报文", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "上行报文不能为空")
|
||||
private String resBody;
|
||||
|
||||
@Schema(description = "备注", example = "你说的对")
|
||||
private String remark;
|
||||
|
||||
}
|
@ -0,0 +1,64 @@
|
||||
package cn.iocoder.yudao.module.ticket.dal.dataobject.assetLoginLog;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 设备登录日志 DO
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
@TableName("login_log")
|
||||
@KeySequence("login_log_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class AssetLoginLogDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 登录时间
|
||||
*/
|
||||
private LocalDateTime loginTime;
|
||||
/**
|
||||
* 设备编号
|
||||
*/
|
||||
private String deviceId;
|
||||
/**
|
||||
* 设备类型
|
||||
*/
|
||||
private String assetType;
|
||||
/**
|
||||
* 设备名称
|
||||
*/
|
||||
private String assetName;
|
||||
/**
|
||||
* 识别码
|
||||
*/
|
||||
private String identificationCode;
|
||||
/**
|
||||
* 登录结果
|
||||
*/
|
||||
private Boolean status;
|
||||
/**
|
||||
* 登录备注
|
||||
*/
|
||||
private String loginRemark;
|
||||
/**
|
||||
* 登录参数
|
||||
*/
|
||||
private String loginParameter;
|
||||
|
||||
}
|
@ -0,0 +1,48 @@
|
||||
package cn.iocoder.yudao.module.ticket.dal.dataobject.information;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 旅客信息 DO
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
@TableName("passenger_information")
|
||||
@KeySequence("passenger_information_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class InformationDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 设备编号
|
||||
*/
|
||||
private String deviceId;
|
||||
/**
|
||||
* 姓名
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 身份证
|
||||
*/
|
||||
private String idCard;
|
||||
/**
|
||||
* 上传时间
|
||||
*/
|
||||
private LocalDateTime commitTime;
|
||||
|
||||
}
|
@ -0,0 +1,58 @@
|
||||
package cn.iocoder.yudao.module.ticket.dal.dataobject.uplinkMessage;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 上行报文 DO
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
@TableName("uplink_message")
|
||||
@KeySequence("uplink_message_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class UplinkMessageDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 上报时间
|
||||
*/
|
||||
private LocalDateTime commitTime;
|
||||
/**
|
||||
* 设备编号
|
||||
*/
|
||||
private String deviceId;
|
||||
/**
|
||||
* 设备名称
|
||||
*/
|
||||
private String deviceName;
|
||||
/**
|
||||
* 状态
|
||||
*
|
||||
* 枚举 {@link TODO uplink_message_status 对应的类}
|
||||
*/
|
||||
private Boolean status;
|
||||
/**
|
||||
* 上行报文
|
||||
*/
|
||||
private String resBody;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
package cn.iocoder.yudao.module.ticket.dal.mysql.assetLoginLog;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.module.ticket.controller.admin.assetLoginLog.vo.AssetLoginLogPageReqVO;
|
||||
import cn.iocoder.yudao.module.ticket.dal.dataobject.assetLoginLog.AssetLoginLogDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 设备登录日志 Mapper
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
@Mapper
|
||||
public interface AssetLoginLogMapper extends BaseMapperX<AssetLoginLogDO> {
|
||||
|
||||
default PageResult<AssetLoginLogDO> selectPage(AssetLoginLogPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<AssetLoginLogDO>()
|
||||
.betweenIfPresent(AssetLoginLogDO::getCreateTime, reqVO.getCreateTime())
|
||||
.betweenIfPresent(AssetLoginLogDO::getLoginTime, reqVO.getLoginTime())
|
||||
.likeIfPresent(AssetLoginLogDO::getDeviceId, reqVO.getDeviceId())
|
||||
.eqIfPresent(AssetLoginLogDO::getAssetType, reqVO.getAssetType())
|
||||
.likeIfPresent(AssetLoginLogDO::getAssetName, reqVO.getAssetName())
|
||||
.eqIfPresent(AssetLoginLogDO::getIdentificationCode, reqVO.getIdentificationCode())
|
||||
.eqIfPresent(AssetLoginLogDO::getStatus, reqVO.getStatus())
|
||||
.eqIfPresent(AssetLoginLogDO::getLoginRemark, reqVO.getLoginRemark())
|
||||
.eqIfPresent(AssetLoginLogDO::getLoginParameter, reqVO.getLoginParameter())
|
||||
.orderByDesc(AssetLoginLogDO::getId));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
package cn.iocoder.yudao.module.ticket.dal.mysql.information;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.module.ticket.controller.admin.information.vo.InformationPageReqVO;
|
||||
import cn.iocoder.yudao.module.ticket.dal.dataobject.information.InformationDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 旅客信息 Mapper
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
@Mapper
|
||||
public interface InformationMapper extends BaseMapperX<InformationDO> {
|
||||
|
||||
default PageResult<InformationDO> selectPage(InformationPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<InformationDO>()
|
||||
.betweenIfPresent(InformationDO::getCreateTime, reqVO.getCreateTime())
|
||||
.likeIfPresent(InformationDO::getDeviceId, reqVO.getDeviceId())
|
||||
.likeIfPresent(InformationDO::getName, reqVO.getName())
|
||||
.likeIfPresent(InformationDO::getIdCard, reqVO.getIdCard())
|
||||
.betweenIfPresent(InformationDO::getCommitTime, reqVO.getCommitTime())
|
||||
.orderByDesc(InformationDO::getId));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,32 @@
|
||||
package cn.iocoder.yudao.module.ticket.dal.mysql.uplinkMessage;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.module.ticket.controller.admin.uplinkMessage.vo.UplinkMessagePageReqVO;
|
||||
import cn.iocoder.yudao.module.ticket.dal.dataobject.uplinkMessage.UplinkMessageDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 上行报文 Mapper
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
@Mapper
|
||||
public interface UplinkMessageMapper extends BaseMapperX<UplinkMessageDO> {
|
||||
|
||||
default PageResult<UplinkMessageDO> selectPage(UplinkMessagePageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<UplinkMessageDO>()
|
||||
.betweenIfPresent(UplinkMessageDO::getCreateTime, reqVO.getCreateTime())
|
||||
.betweenIfPresent(UplinkMessageDO::getCommitTime, reqVO.getCommitTime())
|
||||
.likeIfPresent(UplinkMessageDO::getDeviceId, reqVO.getDeviceId())
|
||||
.likeIfPresent(UplinkMessageDO::getDeviceName, reqVO.getDeviceName())
|
||||
.eqIfPresent(UplinkMessageDO::getStatus, reqVO.getStatus())
|
||||
.likeIfPresent(UplinkMessageDO::getResBody, reqVO.getResBody())
|
||||
.likeIfPresent(UplinkMessageDO::getRemark, reqVO.getRemark())
|
||||
.orderByDesc(UplinkMessageDO::getId));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,56 @@
|
||||
package cn.iocoder.yudao.module.ticket.service.assetLoginLog;
|
||||
|
||||
import java.util.*;
|
||||
import javax.validation.*;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.module.ticket.controller.admin.assetLoginLog.vo.AssetLoginLogPageReqVO;
|
||||
import cn.iocoder.yudao.module.ticket.controller.admin.assetLoginLog.vo.AssetLoginLogSaveReqVO;
|
||||
import cn.iocoder.yudao.module.ticket.dal.dataobject.assetLoginLog.AssetLoginLogDO;
|
||||
|
||||
/**
|
||||
* 设备登录日志 Service 接口
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
public interface AssetLoginLogService {
|
||||
|
||||
/**
|
||||
* 创建设备登录日志
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long create(@Valid AssetLoginLogSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新设备登录日志
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void update(@Valid AssetLoginLogSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除设备登录日志
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void delete(Long id);
|
||||
|
||||
/**
|
||||
* 获得设备登录日志
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 设备登录日志
|
||||
*/
|
||||
AssetLoginLogDO get(Long id);
|
||||
|
||||
/**
|
||||
* 获得设备登录日志分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 设备登录日志分页
|
||||
*/
|
||||
PageResult<AssetLoginLogDO> getPage(AssetLoginLogPageReqVO pageReqVO);
|
||||
|
||||
}
|
@ -0,0 +1,75 @@
|
||||
package cn.iocoder.yudao.module.ticket.service.assetLoginLog;
|
||||
|
||||
import cn.iocoder.yudao.module.ticket.controller.admin.assetLoginLog.vo.AssetLoginLogPageReqVO;
|
||||
import cn.iocoder.yudao.module.ticket.controller.admin.assetLoginLog.vo.AssetLoginLogSaveReqVO;
|
||||
import cn.iocoder.yudao.module.ticket.dal.dataobject.assetLoginLog.AssetLoginLogDO;
|
||||
import cn.iocoder.yudao.module.ticket.dal.mysql.assetLoginLog.AssetLoginLogMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.ticket.enums.ErrorCodeConstants.ALL_NOT_EXISTS;
|
||||
|
||||
/**
|
||||
* 设备登录日志 Service 实现类
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class AssetLoginLogServiceImpl implements AssetLoginLogService {
|
||||
|
||||
@Resource
|
||||
private AssetLoginLogMapper Mapper;
|
||||
|
||||
@Override
|
||||
public Long create(AssetLoginLogSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
AssetLoginLogDO assetLoginLogDO = BeanUtils.toBean(createReqVO, AssetLoginLogDO.class);
|
||||
Mapper.insert(assetLoginLogDO);
|
||||
// 返回
|
||||
return assetLoginLogDO.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(AssetLoginLogSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateExists(updateReqVO.getId());
|
||||
// 更新
|
||||
AssetLoginLogDO updateObj = BeanUtils.toBean(updateReqVO, AssetLoginLogDO.class);
|
||||
Mapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void delete(Long id) {
|
||||
// 校验存在
|
||||
validateExists(id);
|
||||
// 删除
|
||||
Mapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validateExists(Long id) {
|
||||
if (Mapper.selectById(id) == null) {
|
||||
throw exception(ALL_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public AssetLoginLogDO get(Long id) {
|
||||
return Mapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<AssetLoginLogDO> getPage(AssetLoginLogPageReqVO pageReqVO) {
|
||||
return Mapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,56 @@
|
||||
package cn.iocoder.yudao.module.ticket.service.information;
|
||||
|
||||
import java.util.*;
|
||||
import javax.validation.*;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.module.ticket.controller.admin.information.vo.InformationPageReqVO;
|
||||
import cn.iocoder.yudao.module.ticket.controller.admin.information.vo.InformationSaveReqVO;
|
||||
import cn.iocoder.yudao.module.ticket.dal.dataobject.information.InformationDO;
|
||||
|
||||
/**
|
||||
* 旅客信息 Service 接口
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
public interface InformationService {
|
||||
|
||||
/**
|
||||
* 创建旅客信息
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createInformation(@Valid InformationSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新旅客信息
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateInformation(@Valid InformationSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除旅客信息
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteInformation(Long id);
|
||||
|
||||
/**
|
||||
* 获得旅客信息
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 旅客信息
|
||||
*/
|
||||
InformationDO getInformation(Long id);
|
||||
|
||||
/**
|
||||
* 获得旅客信息分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 旅客信息分页
|
||||
*/
|
||||
PageResult<InformationDO> getInformationPage(InformationPageReqVO pageReqVO);
|
||||
|
||||
}
|
@ -0,0 +1,75 @@
|
||||
package cn.iocoder.yudao.module.ticket.service.information;
|
||||
|
||||
import cn.iocoder.yudao.module.ticket.controller.admin.information.vo.InformationPageReqVO;
|
||||
import cn.iocoder.yudao.module.ticket.controller.admin.information.vo.InformationSaveReqVO;
|
||||
import cn.iocoder.yudao.module.ticket.dal.dataobject.information.InformationDO;
|
||||
import cn.iocoder.yudao.module.ticket.dal.mysql.information.InformationMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.ticket.enums.ErrorCodeConstants.INFORMATION_NOT_EXISTS;
|
||||
|
||||
/**
|
||||
* 旅客信息 Service 实现类
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class InformationServiceImpl implements InformationService {
|
||||
|
||||
@Resource
|
||||
private InformationMapper informationMapper;
|
||||
|
||||
@Override
|
||||
public Long createInformation(InformationSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
InformationDO information = BeanUtils.toBean(createReqVO, InformationDO.class);
|
||||
informationMapper.insert(information);
|
||||
// 返回
|
||||
return information.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateInformation(InformationSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateInformationExists(updateReqVO.getId());
|
||||
// 更新
|
||||
InformationDO updateObj = BeanUtils.toBean(updateReqVO, InformationDO.class);
|
||||
informationMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteInformation(Long id) {
|
||||
// 校验存在
|
||||
validateInformationExists(id);
|
||||
// 删除
|
||||
informationMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validateInformationExists(Long id) {
|
||||
if (informationMapper.selectById(id) == null) {
|
||||
throw exception(INFORMATION_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public InformationDO getInformation(Long id) {
|
||||
return informationMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<InformationDO> getInformationPage(InformationPageReqVO pageReqVO) {
|
||||
return informationMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,56 @@
|
||||
package cn.iocoder.yudao.module.ticket.service.uplinkMessage;
|
||||
|
||||
import java.util.*;
|
||||
import javax.validation.*;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.module.ticket.controller.admin.uplinkMessage.vo.UplinkMessagePageReqVO;
|
||||
import cn.iocoder.yudao.module.ticket.controller.admin.uplinkMessage.vo.UplinkMessageSaveReqVO;
|
||||
import cn.iocoder.yudao.module.ticket.dal.dataobject.uplinkMessage.UplinkMessageDO;
|
||||
|
||||
/**
|
||||
* 上行报文 Service 接口
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
public interface UplinkMessageService {
|
||||
|
||||
/**
|
||||
* 创建上行报文
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long create(@Valid UplinkMessageSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新上行报文
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void update(@Valid UplinkMessageSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除上行报文
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void delete(Long id);
|
||||
|
||||
/**
|
||||
* 获得上行报文
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 上行报文
|
||||
*/
|
||||
UplinkMessageDO get(Long id);
|
||||
|
||||
/**
|
||||
* 获得上行报文分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 上行报文分页
|
||||
*/
|
||||
PageResult<UplinkMessageDO> getPage(UplinkMessagePageReqVO pageReqVO);
|
||||
|
||||
}
|
@ -0,0 +1,75 @@
|
||||
package cn.iocoder.yudao.module.ticket.service.uplinkMessage;
|
||||
|
||||
import cn.iocoder.yudao.module.ticket.controller.admin.uplinkMessage.vo.UplinkMessagePageReqVO;
|
||||
import cn.iocoder.yudao.module.ticket.controller.admin.uplinkMessage.vo.UplinkMessageSaveReqVO;
|
||||
import cn.iocoder.yudao.module.ticket.dal.dataobject.uplinkMessage.UplinkMessageDO;
|
||||
import cn.iocoder.yudao.module.ticket.dal.mysql.uplinkMessage.UplinkMessageMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.ticket.enums.ErrorCodeConstants.UM_NOT_EXISTS;
|
||||
|
||||
/**
|
||||
* 上行报文 Service 实现类
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class UplinkMessageServiceImpl implements UplinkMessageService {
|
||||
|
||||
@Resource
|
||||
private UplinkMessageMapper Mapper;
|
||||
|
||||
@Override
|
||||
public Long create(UplinkMessageSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
UplinkMessageDO uplinkMessageDO = BeanUtils.toBean(createReqVO, UplinkMessageDO.class);
|
||||
Mapper.insert(uplinkMessageDO);
|
||||
// 返回
|
||||
return uplinkMessageDO.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(UplinkMessageSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateExists(updateReqVO.getId());
|
||||
// 更新
|
||||
UplinkMessageDO updateObj = BeanUtils.toBean(updateReqVO, UplinkMessageDO.class);
|
||||
Mapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void delete(Long id) {
|
||||
// 校验存在
|
||||
validateExists(id);
|
||||
// 删除
|
||||
Mapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validateExists(Long id) {
|
||||
if (Mapper.selectById(id) == null) {
|
||||
throw exception(UM_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public UplinkMessageDO get(Long id) {
|
||||
return Mapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<UplinkMessageDO> getPage(UplinkMessagePageReqVO pageReqVO) {
|
||||
return Mapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user