diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/project/controller/admin/RepairOrderInfoController.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/project/controller/admin/RepairOrderInfoController.java new file mode 100644 index 00000000..ef7ea916 --- /dev/null +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/project/controller/admin/RepairOrderInfoController.java @@ -0,0 +1,74 @@ +package cn.iocoder.yudao.module.project.controller.admin; + +import cn.iocoder.yudao.framework.common.pojo.CommonResult; +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.framework.common.util.object.BeanUtils; +import cn.iocoder.yudao.module.project.entity.RepairOrderInfo; +import cn.iocoder.yudao.module.project.service.RepairOrderInfoService; +import cn.iocoder.yudao.module.project.vo.RepairOrderInfoPageReqVO; +import cn.iocoder.yudao.module.project.vo.RepairOrderInfoRespVO; +import cn.iocoder.yudao.module.project.vo.RepairOrderInfoSaveReqVO; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.validation.Valid; + +import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; + +@Tag(name = "管理后台 - 维修模块 订单") +@RestController +@RequestMapping("/repair/order-info") +@Validated +public class RepairOrderInfoController { + + @Resource + private RepairOrderInfoService orderInfoService; + + @PostMapping("/create") + @Operation(summary = "创建维修模块 订单") + @PreAuthorize("@ss.hasPermission('repair:order-info:create')") + public CommonResult createOrderInfo(@Valid @RequestBody RepairOrderInfoSaveReqVO createReqVO) { + return success(orderInfoService.createOrderInfo(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新维修模块 订单") + @PreAuthorize("@ss.hasPermission('repair:order-info:update')") + public CommonResult updateOrderInfo(@Valid @RequestBody RepairOrderInfoSaveReqVO updateReqVO) { + orderInfoService.updateOrderInfo(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除维修模块 订单") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('repair:order-info:delete')") + public CommonResult deleteOrderInfo(@RequestParam("id") String id) { + orderInfoService.deleteOrderInfo(id); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得维修模块 订单") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('repair:order-info:query')") + public CommonResult getOrderInfo(@RequestParam("id") String id) { + RepairOrderInfo orderInfo = orderInfoService.getOrderInfo(id); + return success(BeanUtils.toBean(orderInfo, RepairOrderInfoRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得维修模块 订单分页") + @PreAuthorize("@ss.hasPermission('repair:order-info:query')") + public CommonResult> getOrderInfoPage(@Valid RepairOrderInfoPageReqVO pageReqVO) { + PageResult pageResult = orderInfoService.getOrderInfoPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, RepairOrderInfoRespVO.class)); + } + + +} \ No newline at end of file diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/project/entity/RepairOrderInfo.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/project/entity/RepairOrderInfo.java new file mode 100644 index 00000000..923fb48b --- /dev/null +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/project/entity/RepairOrderInfo.java @@ -0,0 +1,162 @@ +package cn.iocoder.yudao.module.project.entity; + +import cn.iocoder.yudao.framework.tenant.core.db.TenantBaseDO; +import lombok.*; +import java.util.*; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.time.LocalDateTime; +import java.time.LocalDateTime; +import java.time.LocalDateTime; +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 pqz + */ +@TableName("repair_order_info") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class RepairOrderInfo extends TenantBaseDO { + + /** + * 订单id + */ + @TableId(type = IdType.ASSIGN_UUID) + private String id; + /** + * 服务id或工单id + */ + private String goodsId; + /** + * 订单号 + */ + private String orderNo; + /** + * 服务名称 + */ + private String goodsTitle; + /** + * 消费类型1会员充值2维修服务 + */ + private String goodsType; + /** + * 用户id + */ + private Integer userId; + /** + * 客户id + */ + private String cusId; + /** + * 客户姓名 + */ + private String cusName; + /** + * 客户手机号 + */ + private String cusPhone; + /** + * 商品原价 元 + */ + private BigDecimal goodsPrice; + /** + * 实付金额 元 + */ + private BigDecimal payMoney; + /** + * 下单时间 + */ + private LocalDateTime orderTime; + /** + * 会员优惠金额 + */ + private Long reduceMoney; + /** + * 使用会员储值卡的金额 + */ + private Long balance; + /** + * 支付时间 + */ + private LocalDateTime payTime; + /** + * 支付方式 + */ + private String payType; + /** + * 支付信息备注 + */ + private String payRemark; + /** + * 线上或者线下 1线上 0线下 + */ + private String isOnline; + /** + * 收款账号 + */ + private String receivablesAccount; + /** + * 订单状态0待支付1已支付 + */ + private String orderStatus; + /** + * 评价详情 + */ + private String commentDesc; + /** + * 星级 + */ + private Integer commentStar; + /** + * 评论时间 + */ + private LocalDateTime commentTime; + /** + * 核销码 + */ + private String accessCode; + /** + * 核销时间 + */ + private LocalDateTime validationTime; + /** + * 核销人 + */ + private String validationRealName; + /** + * 核销人id + */ + private Integer validationUserId; + /** + * 是否使用优惠券 0 未使用 1使用 + */ + private String isCoupon; + /** + * 优惠券id + */ + private Long couponId; + /** + * 优惠券代码 + */ + private String couponCode; + /** + * 优惠金额 + */ + private Integer couponDiscount; + /** + * 创建人所在部门 + */ + private Integer deptId; + + +} \ No newline at end of file diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/project/mapper/RepairOrderInfoMapper.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/project/mapper/RepairOrderInfoMapper.java new file mode 100644 index 00000000..2a26aa3a --- /dev/null +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/project/mapper/RepairOrderInfoMapper.java @@ -0,0 +1,15 @@ +package cn.iocoder.yudao.module.project.mapper; + +import cn.iocoder.yudao.module.project.entity.RepairOrderInfo; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +/** + * 维修模块 订单 Mapper + * + * @author pqz + */ +@Mapper +public interface RepairOrderInfoMapper extends BaseMapper { + +} \ No newline at end of file diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/project/service/RepairOrderInfoService.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/project/service/RepairOrderInfoService.java new file mode 100644 index 00000000..d1f72f8a --- /dev/null +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/project/service/RepairOrderInfoService.java @@ -0,0 +1,55 @@ +package cn.iocoder.yudao.module.project.service; + +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.module.project.entity.RepairOrderInfo; +import cn.iocoder.yudao.module.project.vo.RepairOrderInfoPageReqVO; +import cn.iocoder.yudao.module.project.vo.RepairOrderInfoSaveReqVO; + +import javax.validation.Valid; + +/** + * 维修模块 订单 Service 接口 + * + * @author pqz + */ +public interface RepairOrderInfoService { + + /** + * 创建维修模块 订单 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + String createOrderInfo(@Valid RepairOrderInfoSaveReqVO createReqVO); + + /** + * 更新维修模块 订单 + * + * @param updateReqVO 更新信息 + */ + void updateOrderInfo(@Valid RepairOrderInfoSaveReqVO updateReqVO); + + /** + * 删除维修模块 订单 + * + * @param id 编号 + */ + void deleteOrderInfo(String id); + + /** + * 获得维修模块 订单 + * + * @param id 编号 + * @return 维修模块 订单 + */ + RepairOrderInfo getOrderInfo(String id); + + /** + * 获得维修模块 订单分页 + * + * @param pageReqVO 分页查询 + * @return 维修模块 订单分页 + */ + PageResult getOrderInfoPage(RepairOrderInfoPageReqVO pageReqVO); + +} \ No newline at end of file diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/project/service/impl/RepairOrderInfoServiceImpl.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/project/service/impl/RepairOrderInfoServiceImpl.java new file mode 100644 index 00000000..6f0862dd --- /dev/null +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/project/service/impl/RepairOrderInfoServiceImpl.java @@ -0,0 +1,61 @@ +package cn.iocoder.yudao.module.project.service.impl; + +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.framework.common.util.object.BeanUtils; +import cn.iocoder.yudao.module.project.entity.RepairOrderInfo; +import cn.iocoder.yudao.module.project.mapper.RepairOrderInfoMapper; +import cn.iocoder.yudao.module.project.service.RepairOrderInfoService; +import cn.iocoder.yudao.module.project.vo.RepairOrderInfoPageReqVO; +import cn.iocoder.yudao.module.project.vo.RepairOrderInfoSaveReqVO; +import org.springframework.stereotype.Service; +import org.springframework.validation.annotation.Validated; + +import javax.annotation.Resource; + +/** + * 维修模块 订单 Service 实现类 + * + * @author pqz + */ +@Service +@Validated +public class RepairOrderInfoServiceImpl implements RepairOrderInfoService { + + @Resource + private RepairOrderInfoMapper orderInfoMapper; + + @Override + public String createOrderInfo(RepairOrderInfoSaveReqVO createReqVO) { + // 插入 + RepairOrderInfo orderInfo = BeanUtils.toBean(createReqVO, RepairOrderInfo.class); + orderInfoMapper.insert(orderInfo); + // 返回 + return orderInfo.getId(); + } + + @Override + public void updateOrderInfo(RepairOrderInfoSaveReqVO updateReqVO) { + // 更新 + RepairOrderInfo updateObj = BeanUtils.toBean(updateReqVO, RepairOrderInfo.class); + orderInfoMapper.updateById(updateObj); + } + + @Override + public void deleteOrderInfo(String id) { + // 删除 + orderInfoMapper.deleteById(id); + } + + + + @Override + public RepairOrderInfo getOrderInfo(String id) { + return orderInfoMapper.selectById(id); + } + + @Override + public PageResult getOrderInfoPage(RepairOrderInfoPageReqVO pageReqVO) { + return null; + } + +} \ No newline at end of file diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/project/vo/RepairOrderInfoPageReqVO.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/project/vo/RepairOrderInfoPageReqVO.java new file mode 100644 index 00000000..812f4c49 --- /dev/null +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/project/vo/RepairOrderInfoPageReqVO.java @@ -0,0 +1,16 @@ +package cn.iocoder.yudao.module.project.vo; + +import cn.iocoder.yudao.module.project.entity.RepairOrderInfo; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.ToString; + +@Schema(description = "管理后台 - 维修模块 订单分页 Request VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class RepairOrderInfoPageReqVO extends RepairOrderInfo { + + +} \ No newline at end of file diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/project/vo/RepairOrderInfoRespVO.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/project/vo/RepairOrderInfoRespVO.java new file mode 100644 index 00000000..ec109163 --- /dev/null +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/project/vo/RepairOrderInfoRespVO.java @@ -0,0 +1,18 @@ +package cn.iocoder.yudao.module.project.vo; + +import cn.iocoder.yudao.module.project.entity.RepairOrderInfo; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import java.math.BigDecimal; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; +import com.alibaba.excel.annotation.*; + +@Schema(description = "管理后台 - 维修模块 订单 Response VO") +@Data +@ExcelIgnoreUnannotated +public class RepairOrderInfoRespVO extends RepairOrderInfo { + + +} \ No newline at end of file diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/project/vo/RepairOrderInfoSaveReqVO.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/project/vo/RepairOrderInfoSaveReqVO.java new file mode 100644 index 00000000..fda65708 --- /dev/null +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/project/vo/RepairOrderInfoSaveReqVO.java @@ -0,0 +1,17 @@ +package cn.iocoder.yudao.module.project.vo; + +import cn.iocoder.yudao.module.project.entity.RepairOrderInfo; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import javax.validation.constraints.*; +import java.math.BigDecimal; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +@Schema(description = "管理后台 - 维修模块 订单新增/修改 Request VO") +@Data +public class RepairOrderInfoSaveReqVO extends RepairOrderInfo { + + +} \ No newline at end of file