diff --git a/.drone.yml b/.drone.yml index 413e423f7..14604f28e 100644 --- a/.drone.yml +++ b/.drone.yml @@ -119,8 +119,8 @@ steps: # 定义流水线执行步骤,这些步骤将顺序执行 # - echo "ticket done" # - scp -r /ludu/maven/build/ludu-module-parking root@120.46.37.243:/ludu/maven/build # - echo "park done" -# - scp -r /ludu/maven/build/ludu-module-datacenter root@120.46.37.243:/ludu/maven/build -# - echo "datecenter done" + - scp -r /ludu/maven/build/ludu-module-datacenter root@120.46.37.243:/ludu/maven/build + - echo "datecenter done" - name: build-other-service @@ -153,9 +153,9 @@ steps: # 定义流水线执行步骤,这些步骤将顺序执行 # - chmod +x ./run.sh # 更改为可执行脚本 # - ./run.sh || echo "ludu-module-parking build failed" # 运行脚本打包应用镜像并运行 -# - cd /ludu/maven/build/ludu-module-datacenter/ -# - chmod +x ./run.sh # 更改为可执行脚本 -# - ./run.sh || echo "ludu-module-datacenter build failed" # 运行脚本打包应用镜像并运行 + - cd /ludu/maven/build/ludu-module-datacenter/ + - chmod +x ./run.sh # 更改为可执行脚本 + - ./run.sh || echo "ludu-module-datacenter build failed" # 运行脚本打包应用镜像并运行 volumes: # 定义流水线挂载目录,用于共享数据 diff --git a/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/chargeinfo/ChargeInfoController.java b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/chargeinfo/ChargeInfoController.java new file mode 100644 index 000000000..8f3d3486c --- /dev/null +++ b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/chargeinfo/ChargeInfoController.java @@ -0,0 +1,100 @@ +package cn.iocoder.yudao.module.parking.controller.admin.chargeinfo; + +import cn.iocoder.yudao.module.parking.util.BlueCardResult; +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.*; +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.*; + +import cn.iocoder.yudao.module.parking.controller.admin.chargeinfo.vo.*; +import cn.iocoder.yudao.module.parking.dal.dataobject.chargeinfo.ChargeInfoDO; +import cn.iocoder.yudao.module.parking.service.chargeinfo.ChargeInfoService; + +@Tag(name = "管理后台 - 收费信息") +@RestController +@RequestMapping("/parking/charge-info") +@Validated +public class ChargeInfoController { + + @Resource + private ChargeInfoService chargeInfoService; + + @PostMapping("/insertChargeInformation") + public BlueCardResult insertChargeInformation(@RequestBody ChargeInfoReqDataVO chargeInformation){ + return chargeInfoService.uploadChargeInformation(chargeInformation); + } + + @PostMapping("/create") + @Operation(summary = "创建收费信息") + @PreAuthorize("@ss.hasPermission('parking:charge-info:create')") + public CommonResult createchargeInfo(@Valid @RequestBody ChargeInfoSaveReqVO createReqVO) { + return success(chargeInfoService.createchargeInfo(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新收费信息") + @PreAuthorize("@ss.hasPermission('parking:charge-info:update')") + public CommonResult updatechargeInfo(@Valid @RequestBody ChargeInfoSaveReqVO updateReqVO) { + chargeInfoService.updatechargeInfo(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除收费信息") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('parking:charge-info:delete')") + public CommonResult deletechargeInfo(@RequestParam("id") Long id) { + chargeInfoService.deletechargeInfo(id); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得收费信息") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('parking:charge-info:query')") + public CommonResult getchargeInfo(@RequestParam("id") Long id) { + ChargeInfoDO chargeInfo = chargeInfoService.getchargeInfo(id); + return success(BeanUtils.toBean(chargeInfo, ChargeInfoRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得收费信息分页") + @PreAuthorize("@ss.hasPermission('parking:charge-info:query')") + public CommonResult> getchargeInfoPage(@Valid ChargeInfoPageReqVO pageReqVO) { + PageResult pageResult = chargeInfoService.getchargeInfoPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, ChargeInfoRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出收费信息 Excel") + @PreAuthorize("@ss.hasPermission('parking:charge-info:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportchargeInfoExcel(@Valid ChargeInfoPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = chargeInfoService.getchargeInfoPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "收费信息.xls", "数据", ChargeInfoRespVO.class, + BeanUtils.toBean(list, ChargeInfoRespVO.class)); + } + +} \ No newline at end of file diff --git a/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/chargeinfo/vo/ChargeInfoPageReqVO.java b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/chargeinfo/vo/ChargeInfoPageReqVO.java new file mode 100644 index 000000000..fb632e617 --- /dev/null +++ b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/chargeinfo/vo/ChargeInfoPageReqVO.java @@ -0,0 +1,83 @@ +package cn.iocoder.yudao.module.parking.controller.admin.chargeinfo.vo; + +import lombok.*; +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 ChargeInfoPageReqVO extends PageParam { + + @Schema(description = "场库编号") + private String parkNumber; + + @Schema(description = "车牌号") + private String plate; + + @Schema(description = "入场时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private String[] inTime; + + @Schema(description = "结算时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private String[] outTime; + + @Schema(description = "入场通道") + private String inChannel; + + @Schema(description = "出场通道") + private String outChannel; + + @Schema(description = "支付类型") + private String payKind; + + @Schema(description = "支付渠道") + private String payChannel; + + @Schema(description = "入场订单号", example = "16414") + private String orderId; + + @Schema(description = "车辆类型", example = "1") + private String carType; + + @Schema(description = "支付订单号") + private String payNo; + + @Schema(description = "备注", example = "随便") + private String memo; + + @Schema(description = "应缴金额") + private String charge; + + @Schema(description = "实收金额") + private String realCharge; + + @Schema(description = "优惠金额") + private String couponCharge; + + @Schema(description = "区域 ID", example = "19866") + private String areaId; + + @Schema(description = "操作员名称", example = "王五") + private String operatorName; + + @Schema(description = "操作员联系电话") + private String operatorTelphone; + + @Schema(description = "支付订单号") + private String outTradeNo; + + @Schema(description = "车牌颜色") + private String plateColor; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + +} \ No newline at end of file diff --git a/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/chargeinfo/vo/ChargeInfoReqDataVO.java b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/chargeinfo/vo/ChargeInfoReqDataVO.java new file mode 100644 index 000000000..8ca77751e --- /dev/null +++ b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/chargeinfo/vo/ChargeInfoReqDataVO.java @@ -0,0 +1,17 @@ +package cn.iocoder.yudao.module.parking.controller.admin.chargeinfo.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + +@Schema(description = "管理后台 - 收费信息接口请求参数") +@Data +public class ChargeInfoReqDataVO { + @Schema(description = "场库编号") + private String parkNumber; + @Schema(description = "收费信息数量") + private String size; + @Schema(description = "收费信息列表") + private List datas; +} diff --git a/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/chargeinfo/vo/ChargeInfoRespVO.java b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/chargeinfo/vo/ChargeInfoRespVO.java new file mode 100644 index 000000000..093d52fd1 --- /dev/null +++ b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/chargeinfo/vo/ChargeInfoRespVO.java @@ -0,0 +1,102 @@ +package cn.iocoder.yudao.module.parking.controller.admin.chargeinfo.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; + +import java.time.LocalDateTime; +import com.alibaba.excel.annotation.*; + +@Schema(description = "管理后台 - 收费信息 Response VO") +@Data +@ExcelIgnoreUnannotated +public class ChargeInfoRespVO { + + @Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "28728") + @ExcelProperty("id") + private Long id; + + @Schema(description = "场库编号") + @ExcelProperty("场库编号") + private String parkNumber; + + @Schema(description = "车牌号", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("车牌号") + private String plate; + + @Schema(description = "入场时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("入场时间") + private String inTime; + + @Schema(description = "结算时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("结算时间") + private String outTime; + + @Schema(description = "入场通道") + @ExcelProperty("入场通道") + private String inChannel; + + @Schema(description = "出场通道") + @ExcelProperty("出场通道") + private String outChannel; + + @Schema(description = "支付类型", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("支付类型") + private String payKind; + + @Schema(description = "支付渠道", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("支付渠道") + private String payChannel; + + @Schema(description = "入场订单号", example = "16414") + @ExcelProperty("入场订单号") + private String orderId; + + @Schema(description = "车辆类型", example = "1") + @ExcelProperty("车辆类型") + private String carType; + + @Schema(description = "支付订单号") + @ExcelProperty("支付订单号") + private String payNo; + + @Schema(description = "备注", requiredMode = Schema.RequiredMode.REQUIRED, example = "随便") + @ExcelProperty("备注") + private String memo; + + @Schema(description = "应缴金额", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("应缴金额") + private String charge; + + @Schema(description = "实收金额", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("实收金额") + private String realCharge; + + @Schema(description = "优惠金额", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("优惠金额") + private String couponCharge; + + @Schema(description = "区域 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "19866") + @ExcelProperty("区域 ID") + private String areaId; + + @Schema(description = "操作员名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五") + @ExcelProperty("操作员名称") + private String operatorName; + + @Schema(description = "操作员联系电话", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("操作员联系电话") + private String operatorTelphone; + + @Schema(description = "支付订单号", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("支付订单号") + private String outTradeNo; + + @Schema(description = "车牌颜色", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("车牌颜色") + private String plateColor; + + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("创建时间") + private LocalDateTime createTime; + +} \ No newline at end of file diff --git a/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/chargeinfo/vo/ChargeInfoSaveReqVO.java b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/chargeinfo/vo/ChargeInfoSaveReqVO.java new file mode 100644 index 000000000..72490582b --- /dev/null +++ b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/controller/admin/chargeinfo/vo/ChargeInfoSaveReqVO.java @@ -0,0 +1,89 @@ +package cn.iocoder.yudao.module.parking.controller.admin.chargeinfo.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; + +import javax.validation.constraints.*; + +@Schema(description = "管理后台 - 收费信息新增/修改 Request VO") +@Data +public class ChargeInfoSaveReqVO { + + @Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "28728") + private Long id; + + @Schema(description = "场库编号") + private String parkNumber; + + @Schema(description = "车牌号", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "车牌号不能为空") + private String plate; + + @Schema(description = "入场时间", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "入场时间不能为空") + private String inTime; + + @Schema(description = "结算时间", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "结算时间不能为空") + private String outTime; + + @Schema(description = "入场通道") + private String inChannel; + + @Schema(description = "出场通道") + private String outChannel; + + @Schema(description = "支付类型", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "支付类型不能为空") + private String payKind; + + @Schema(description = "支付渠道", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "支付渠道不能为空") + private String payChannel; + + @Schema(description = "入场订单号", example = "16414") + private String orderId; + + @Schema(description = "车辆类型", example = "1") + private String carType; + + @Schema(description = "支付订单号") + private String payNo; + + @Schema(description = "备注", requiredMode = Schema.RequiredMode.REQUIRED, example = "随便") + @NotEmpty(message = "备注不能为空") + private String memo; + + @Schema(description = "应缴金额", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "应缴金额不能为空") + private String charge; + + @Schema(description = "实收金额", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "实收金额不能为空") + private String realCharge; + + @Schema(description = "优惠金额", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "优惠金额不能为空") + private String couponCharge; + + @Schema(description = "区域 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "19866") + @NotEmpty(message = "区域 ID不能为空") + private String areaId; + + @Schema(description = "操作员名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五") + @NotEmpty(message = "操作员名称不能为空") + private String operatorName; + + @Schema(description = "操作员联系电话", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "操作员联系电话不能为空") + private String operatorTelphone; + + @Schema(description = "支付订单号", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "支付订单号不能为空") + private String outTradeNo; + + @Schema(description = "车牌颜色", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "车牌颜色不能为空") + private String plateColor; + +} \ No newline at end of file diff --git a/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/dataobject/carinfo/CarInfoDO.java b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/dataobject/carinfo/CarInfoDO.java index 79e1c2fee..5c771dad7 100644 --- a/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/dataobject/carinfo/CarInfoDO.java +++ b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/dataobject/carinfo/CarInfoDO.java @@ -48,4 +48,9 @@ public class CarInfoDO extends BaseDO { */ private Integer confidence; + public CarInfoDO(String plate, String plateColor, String carType) { + this.plate = plate; + this.plateColor = plateColor; + this.carType = carType; + } } \ No newline at end of file diff --git a/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/dataobject/chargeinfo/ChargeInfoDO.java b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/dataobject/chargeinfo/ChargeInfoDO.java new file mode 100644 index 000000000..4fd114bc2 --- /dev/null +++ b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/dataobject/chargeinfo/ChargeInfoDO.java @@ -0,0 +1,108 @@ +package cn.iocoder.yudao.module.parking.dal.dataobject.chargeinfo; + +import lombok.*; +import com.baomidou.mybatisplus.annotation.*; +import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; + +/** + * 收费信息 DO + * + * @author 芋道源码 + */ +@TableName("charge_info") +@KeySequence("charge_info_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class ChargeInfoDO extends BaseDO { + + /** + * id + */ + @TableId + private Long id; + /** + * 场库编号 + */ + private String parkNumber; + /** + * 车牌号 + */ + private String plate; + /** + * 入场时间 + */ + private String inTime; + /** + * 结算时间 + */ + private String outTime; + /** + * 入场通道 + */ + private String inChannel; + /** + * 出场通道 + */ + private String outChannel; + /** + * 支付类型 + */ + private String payKind; + /** + * 支付渠道 + */ + private String payChannel; + /** + * 入场订单号 + */ + private String orderId; + /** + * 车辆类型 + */ + private String carType; + /** + * 支付订单号 + */ + private String payNo; + /** + * 备注 + */ + private String memo; + /** + * 应缴金额 + */ + private String charge; + /** + * 实收金额 + */ + private String realCharge; + /** + * 优惠金额 + */ + private String couponCharge; + /** + * 区域 ID + */ + private String areaId; + /** + * 操作员名称 + */ + private String operatorName; + /** + * 操作员联系电话 + */ + private String operatorTelphone; + /** + * 支付订单号 + */ + private String outTradeNo; + /** + * 车牌颜色 + */ + private String plateColor; + +} \ No newline at end of file diff --git a/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/mysql/chargeinfo/ChargeInfoMapper.java b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/mysql/chargeinfo/ChargeInfoMapper.java new file mode 100644 index 000000000..b6c74faa8 --- /dev/null +++ b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/dal/mysql/chargeinfo/ChargeInfoMapper.java @@ -0,0 +1,44 @@ +package cn.iocoder.yudao.module.parking.dal.mysql.chargeinfo; + +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.parking.dal.dataobject.chargeinfo.ChargeInfoDO; +import org.apache.ibatis.annotations.Mapper; +import cn.iocoder.yudao.module.parking.controller.admin.chargeinfo.vo.*; + +/** + * 收费信息 Mapper + * + * @author 芋道源码 + */ +@Mapper +public interface ChargeInfoMapper extends BaseMapperX { + + default PageResult selectPage(ChargeInfoPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(ChargeInfoDO::getParkNumber, reqVO.getParkNumber()) + .eqIfPresent(ChargeInfoDO::getPlate, reqVO.getPlate()) + .betweenIfPresent(ChargeInfoDO::getInTime, reqVO.getInTime()) + .betweenIfPresent(ChargeInfoDO::getOutTime, reqVO.getOutTime()) + .eqIfPresent(ChargeInfoDO::getInChannel, reqVO.getInChannel()) + .eqIfPresent(ChargeInfoDO::getOutChannel, reqVO.getOutChannel()) + .eqIfPresent(ChargeInfoDO::getPayKind, reqVO.getPayKind()) + .eqIfPresent(ChargeInfoDO::getPayChannel, reqVO.getPayChannel()) + .eqIfPresent(ChargeInfoDO::getOrderId, reqVO.getOrderId()) + .eqIfPresent(ChargeInfoDO::getCarType, reqVO.getCarType()) + .eqIfPresent(ChargeInfoDO::getPayNo, reqVO.getPayNo()) + .eqIfPresent(ChargeInfoDO::getMemo, reqVO.getMemo()) + .eqIfPresent(ChargeInfoDO::getCharge, reqVO.getCharge()) + .eqIfPresent(ChargeInfoDO::getRealCharge, reqVO.getRealCharge()) + .eqIfPresent(ChargeInfoDO::getCouponCharge, reqVO.getCouponCharge()) + .eqIfPresent(ChargeInfoDO::getAreaId, reqVO.getAreaId()) + .likeIfPresent(ChargeInfoDO::getOperatorName, reqVO.getOperatorName()) + .eqIfPresent(ChargeInfoDO::getOperatorTelphone, reqVO.getOperatorTelphone()) + .eqIfPresent(ChargeInfoDO::getOutTradeNo, reqVO.getOutTradeNo()) + .eqIfPresent(ChargeInfoDO::getPlateColor, reqVO.getPlateColor()) + .betweenIfPresent(ChargeInfoDO::getCreateTime, reqVO.getCreateTime()) + .orderByDesc(ChargeInfoDO::getId)); + } + +} \ No newline at end of file diff --git a/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/service/carinfo/CarInfoService.java b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/service/carinfo/CarInfoService.java index afea7cc3d..f0eed97b8 100644 --- a/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/service/carinfo/CarInfoService.java +++ b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/service/carinfo/CarInfoService.java @@ -1,6 +1,10 @@ package cn.iocoder.yudao.module.parking.service.carinfo; +import cn.iocoder.yudao.module.parking.dal.dataobject.carinfo.CarInfoDO; + +import java.util.List; + /** * 车辆信息 Service 接口 * @@ -8,5 +12,10 @@ package cn.iocoder.yudao.module.parking.service.carinfo; */ public interface CarInfoService { - + /** + * 批量插入或更新车牌信息 + * @param carInfoDOList + * @return java.lang.Boolean + */ + Boolean insertOrUpdateBatch(List carInfoDOList); } \ No newline at end of file diff --git a/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/service/carinfo/CarInfoServiceImpl.java b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/service/carinfo/CarInfoServiceImpl.java index 002586ab2..fefb64858 100644 --- a/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/service/carinfo/CarInfoServiceImpl.java +++ b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/service/carinfo/CarInfoServiceImpl.java @@ -1,10 +1,15 @@ package cn.iocoder.yudao.module.parking.service.carinfo; +import cn.iocoder.yudao.module.parking.dal.dataobject.carinfo.CarInfoDO; import org.springframework.stereotype.Service; + import javax.annotation.Resource; + import org.springframework.validation.annotation.Validated; import cn.iocoder.yudao.module.parking.dal.mysql.carinfo.CarInfoMapper; +import java.util.List; + /** * 车辆信息 Service 实现类 @@ -19,4 +24,8 @@ public class CarInfoServiceImpl implements CarInfoService { private CarInfoMapper carInfoMapper; + @Override + public Boolean insertOrUpdateBatch(List carInfoDOList) { + return carInfoMapper.insertOrUpdateBatch(carInfoDOList); + } } \ No newline at end of file diff --git a/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/service/chargeinfo/ChargeInfoService.java b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/service/chargeinfo/ChargeInfoService.java new file mode 100644 index 000000000..84dfd6ba9 --- /dev/null +++ b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/service/chargeinfo/ChargeInfoService.java @@ -0,0 +1,60 @@ +package cn.iocoder.yudao.module.parking.service.chargeinfo; + +import javax.validation.*; +import cn.iocoder.yudao.module.parking.controller.admin.chargeinfo.vo.*; +import cn.iocoder.yudao.module.parking.dal.dataobject.chargeinfo.ChargeInfoDO; +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.module.parking.util.BlueCardResult; + +/** + * 收费信息 Service 接口 + * + * @author 芋道源码 + */ +public interface ChargeInfoService { + + /** + * 创建收费信息 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + Long createchargeInfo(@Valid ChargeInfoSaveReqVO createReqVO); + + /** + * 更新收费信息 + * + * @param updateReqVO 更新信息 + */ + void updatechargeInfo(@Valid ChargeInfoSaveReqVO updateReqVO); + + /** + * 删除收费信息 + * + * @param id 编号 + */ + void deletechargeInfo(Long id); + + /** + * 获得收费信息 + * + * @param id 编号 + * @return 收费信息 + */ + ChargeInfoDO getchargeInfo(Long id); + + /** + * 获得收费信息分页 + * + * @param pageReqVO 分页查询 + * @return 收费信息分页 + */ + PageResult getchargeInfoPage(ChargeInfoPageReqVO pageReqVO); + + /** + * 收费信息上传 + * @param chargeInformation + * @return cn.iocoder.yudao.module.parking.util.BlueCardResult + */ + BlueCardResult uploadChargeInformation(ChargeInfoReqDataVO chargeInformation); +} \ No newline at end of file diff --git a/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/service/chargeinfo/ChargeInfoServiceImpl.java b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/service/chargeinfo/ChargeInfoServiceImpl.java new file mode 100644 index 000000000..01e1ad25c --- /dev/null +++ b/ludu-module-parking/ludu-module-parking-biz/src/main/java/cn/iocoder/yudao/module/parking/service/chargeinfo/ChargeInfoServiceImpl.java @@ -0,0 +1,102 @@ +package cn.iocoder.yudao.module.parking.service.chargeinfo; + +import cn.iocoder.yudao.module.parking.dal.dataobject.carinfo.CarInfoDO; +import cn.iocoder.yudao.module.parking.service.carinfo.CarInfoService; +import cn.iocoder.yudao.module.parking.util.BlueCardResult; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; + +import org.springframework.transaction.annotation.Transactional; +import org.springframework.validation.annotation.Validated; + +import cn.iocoder.yudao.module.parking.controller.admin.chargeinfo.vo.*; +import cn.iocoder.yudao.module.parking.dal.dataobject.chargeinfo.ChargeInfoDO; +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.framework.common.util.object.BeanUtils; + +import cn.iocoder.yudao.module.parking.dal.mysql.chargeinfo.ChargeInfoMapper; + +import java.beans.Beans; +import java.util.ArrayList; +import java.util.List; + +import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; +import static cn.iocoder.yudao.module.parking.enums.ErrorCodeConstants.*; + +/** + * 收费信息 Service 实现类 + * + * @author 芋道源码 + */ +@Service +@Validated +public class ChargeInfoServiceImpl implements ChargeInfoService { + + @Resource + private ChargeInfoMapper chargeInfoMapper; + + @Resource + private CarInfoService carInfoService; + + @Override + public Long createchargeInfo(ChargeInfoSaveReqVO createReqVO) { + // 插入 + ChargeInfoDO chargeInfo = BeanUtils.toBean(createReqVO, ChargeInfoDO.class); + chargeInfoMapper.insert(chargeInfo); + // 返回 + return chargeInfo.getId(); + } + + @Override + public void updatechargeInfo(ChargeInfoSaveReqVO updateReqVO) { + // 校验存在 + validatechargeInfoExists(updateReqVO.getId()); + // 更新 + ChargeInfoDO updateObj = BeanUtils.toBean(updateReqVO, ChargeInfoDO.class); + chargeInfoMapper.updateById(updateObj); + } + + @Override + public void deletechargeInfo(Long id) { + // 校验存在 + validatechargeInfoExists(id); + // 删除 + chargeInfoMapper.deleteById(id); + } + + private void validatechargeInfoExists(Long id) { + if (chargeInfoMapper.selectById(id) == null) { + throw exception(CHARGE_INFO_NOT_EXISTS); + } + } + + @Override + public ChargeInfoDO getchargeInfo(Long id) { + return chargeInfoMapper.selectById(id); + } + + @Override + public PageResult getchargeInfoPage(ChargeInfoPageReqVO pageReqVO) { + return chargeInfoMapper.selectPage(pageReqVO); + } + + @Override + @Transactional + public BlueCardResult uploadChargeInformation(ChargeInfoReqDataVO chargeInformation) { + List chargeInfoSaveReqVOList = chargeInformation.getDatas(); + List carInfoDOList = new ArrayList<>(); + for (ChargeInfoSaveReqVO chargeInfoSaveReqVO : chargeInfoSaveReqVOList) { + chargeInfoSaveReqVO.setParkNumber(chargeInformation.getParkNumber()); + // 存入车信息数组 + carInfoDOList.add(new CarInfoDO(chargeInfoSaveReqVO.getPlate(), chargeInfoSaveReqVO.getPlateColor(), chargeInfoSaveReqVO.getCarType())); + } + List chargeInfoDOList = BeanUtils.toBean(chargeInfoSaveReqVOList, ChargeInfoDO.class); + // 插入收费信息 + chargeInfoMapper.insertBatch(chargeInfoDOList); + // 插入对应车牌信息 + carInfoService.insertOrUpdateBatch(carInfoDOList); + return BlueCardResult.success(); + } + +} \ No newline at end of file diff --git a/ludu-module-parking/ludu-module-parking-biz/src/main/resources/mapper/chargeinfo/ChargeInfoMapper.xml b/ludu-module-parking/ludu-module-parking-biz/src/main/resources/mapper/chargeinfo/ChargeInfoMapper.xml new file mode 100644 index 000000000..0abe39dbd --- /dev/null +++ b/ludu-module-parking/ludu-module-parking-biz/src/main/resources/mapper/chargeinfo/ChargeInfoMapper.xml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file