Merge branch 'xizang-changyun' of https://gitee.com/xiaochen991015/xizang into xizang-changyun
# Conflicts:
# generator/src/test/java/com/xizang/CodeGeneratorTests.java
New file |
| | |
| | | package com.ruoyi.system.controller; |
| | | |
| | | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * <p> |
| | | * 订单表与账单的关联表 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2025-02-07 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/t-order-bill") |
| | | public class TOrderBillController { |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.ruoyi.system.controller; |
| | | |
| | | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * <p> |
| | | * 支付订单表 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2025-02-07 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/t-pay-order") |
| | | public class TPayOrderController { |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.ruoyi.system.mapper; |
| | | |
| | | import com.ruoyi.system.model.TOrderBill; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | |
| | | /** |
| | | * <p> |
| | | * 订单表与账单的关联表 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2025-02-07 |
| | | */ |
| | | public interface TOrderBillMapper extends BaseMapper<TOrderBill> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.mapper; |
| | | |
| | | import com.ruoyi.system.model.TPayOrder; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | |
| | | /** |
| | | * <p> |
| | | * 支付订单表 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2025-02-07 |
| | | */ |
| | | public interface TPayOrderMapper extends BaseMapper<TPayOrder> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import java.time.LocalDateTime; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import java.io.Serializable; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | /** |
| | | * <p> |
| | | * 订单表与账单的关联表 |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2025-02-07 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("t_order_bill") |
| | | @ApiModel(value="TOrderBill对象", description="订单表与账单的关联表") |
| | | public class TOrderBill implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableId("id") |
| | | private String id; |
| | | |
| | | @ApiModelProperty(value = "订单号") |
| | | @TableField("order_no") |
| | | private String orderNo; |
| | | |
| | | @ApiModelProperty(value = "账单编号") |
| | | @TableField("bill_id") |
| | | private String billId; |
| | | |
| | | @TableField("create_time") |
| | | private LocalDateTime createTime; |
| | | |
| | | @TableField("update_time") |
| | | private LocalDateTime updateTime; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import java.time.LocalDateTime; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import java.io.Serializable; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | /** |
| | | * <p> |
| | | * 支付订单表 |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2025-02-07 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("t_pay_order") |
| | | @ApiModel(value="TPayOrder对象", description="支付订单表") |
| | | public class TPayOrder implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "订单号") |
| | | @TableId("id") |
| | | private String id; |
| | | |
| | | @ApiModelProperty(value = "发起支付的用户ID") |
| | | @TableField("user_id") |
| | | private String userId; |
| | | |
| | | @ApiModelProperty(value = "用户名称") |
| | | @TableField("user_name") |
| | | private String userName; |
| | | |
| | | @ApiModelProperty(value = "用户微信openid或支付宝userid") |
| | | @TableField("open_id") |
| | | private String openId; |
| | | |
| | | @ApiModelProperty(value = "用户手机号码") |
| | | @TableField("phone") |
| | | private String phone; |
| | | |
| | | @ApiModelProperty(value = "订单金额") |
| | | @TableField("amount") |
| | | private Long amount; |
| | | |
| | | @ApiModelProperty(value = "实付金额") |
| | | @TableField("act_pay_amount") |
| | | private Long actPayAmount; |
| | | |
| | | @ApiModelProperty(value = "支付时间") |
| | | @TableField("pay_time") |
| | | private LocalDateTime payTime; |
| | | |
| | | @ApiModelProperty(value = "支付方式") |
| | | @TableField("pay_type") |
| | | private String payType; |
| | | |
| | | @ApiModelProperty(value = "支付的回调信息") |
| | | @TableField("pay_info") |
| | | private String payInfo; |
| | | |
| | | @ApiModelProperty(value = "银行的支付流水编号") |
| | | @TableField("pay_no") |
| | | private String payNo; |
| | | |
| | | @ApiModelProperty(value = "支付的回调时间") |
| | | @TableField("callback_time") |
| | | private LocalDateTime callbackTime; |
| | | |
| | | @ApiModelProperty(value = "订单创建时间") |
| | | @TableField("create_time") |
| | | private LocalDateTime createTime; |
| | | |
| | | @ApiModelProperty(value = "订单更新时间") |
| | | @TableField("update_time") |
| | | private LocalDateTime updateTime; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.service; |
| | | |
| | | import com.ruoyi.system.model.TOrderBill; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | /** |
| | | * <p> |
| | | * 订单表与账单的关联表 服务类 |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2025-02-07 |
| | | */ |
| | | public interface TOrderBillService extends IService<TOrderBill> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.service; |
| | | |
| | | import com.ruoyi.system.model.TPayOrder; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | /** |
| | | * <p> |
| | | * 支付订单表 服务类 |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2025-02-07 |
| | | */ |
| | | public interface TPayOrderService extends IService<TPayOrder> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.service.impl; |
| | | |
| | | import com.ruoyi.system.model.TOrderBill; |
| | | import com.ruoyi.system.mapper.TOrderBillMapper; |
| | | import com.ruoyi.system.service.TOrderBillService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 订单表与账单的关联表 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2025-02-07 |
| | | */ |
| | | @Service |
| | | public class TOrderBillServiceImpl extends ServiceImpl<TOrderBillMapper, TOrderBill> implements TOrderBillService { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.service.impl; |
| | | |
| | | import com.ruoyi.system.model.TPayOrder; |
| | | import com.ruoyi.system.mapper.TPayOrderMapper; |
| | | import com.ruoyi.system.service.TPayOrderService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 支付订单表 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2025-02-07 |
| | | */ |
| | | @Service |
| | | public class TPayOrderServiceImpl extends ServiceImpl<TPayOrderMapper, TPayOrder> implements TPayOrderService { |
| | | |
| | | } |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.ruoyi.system.mapper.TOrderBillMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.system.model.TOrderBill"> |
| | | <id column="id" property="id" /> |
| | | <result column="order_no" property="orderNo" /> |
| | | <result column="bill_id" property="billId" /> |
| | | <result column="create_time" property="createTime" /> |
| | | <result column="update_time" property="updateTime" /> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, order_no, bill_id, create_time, update_time |
| | | </sql> |
| | | |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.ruoyi.system.mapper.TPayOrderMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.system.model.TPayOrder"> |
| | | <id column="id" property="id" /> |
| | | <result column="user_id" property="userId" /> |
| | | <result column="user_name" property="userName" /> |
| | | <result column="open_id" property="openId" /> |
| | | <result column="phone" property="phone" /> |
| | | <result column="amount" property="amount" /> |
| | | <result column="act_pay_amount" property="actPayAmount" /> |
| | | <result column="pay_time" property="payTime" /> |
| | | <result column="pay_type" property="payType" /> |
| | | <result column="pay_info" property="payInfo" /> |
| | | <result column="pay_no" property="payNo" /> |
| | | <result column="callback_time" property="callbackTime" /> |
| | | <result column="create_time" property="createTime" /> |
| | | <result column="update_time" property="updateTime" /> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, user_id, user_name, open_id, phone, amount, act_pay_amount, pay_time, pay_type, pay_info, pay_no, callback_time, create_time, update_time |
| | | </sql> |
| | | |
| | | </mapper> |
New file |
| | |
| | | package com.ruoyi.web.controller.api; |
| | | |
| | | |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.system.model.TBanner; |
| | | import com.ruoyi.system.query.TBannerQuery; |
| | | import com.ruoyi.system.service.TBannerService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 轮播图管理 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2025-02-07 |
| | | */ |
| | | @Api(tags = "轮播图管理") |
| | | @RestController |
| | | @RequestMapping("/t-banner") |
| | | public class TBannerController { |
| | | |
| | | private final TBannerService bannerService; |
| | | @Autowired |
| | | public TBannerController(TBannerService bannerService) { |
| | | this.bannerService = bannerService; |
| | | } |
| | | |
| | | /** |
| | | * 获取轮播图管理列表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:banner:list')") |
| | | @ApiOperation(value = "获取轮播图分页列表") |
| | | @PostMapping(value = "/pageList") |
| | | public R<PageInfo<TBanner>> pageList(@RequestBody TBannerQuery query) { |
| | | return R.ok(bannerService.pageList(query)); |
| | | } |
| | | |
| | | /** |
| | | * 添加轮播图管理 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:banner:add')") |
| | | @Log(title = "轮播图信息-新增轮播图", businessType = BusinessType.INSERT) |
| | | @ApiOperation(value = "添加轮播图") |
| | | @PostMapping(value = "/add") |
| | | public R<Boolean> add(@Validated @RequestBody TBanner dto) { |
| | | return R.ok(bannerService.save(dto)); |
| | | } |
| | | |
| | | /** |
| | | * 修改轮播图 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:banner:update')") |
| | | @Log(title = "轮播图信息-修改轮播图", businessType = BusinessType.UPDATE) |
| | | @ApiOperation(value = "修改轮播图") |
| | | @PostMapping(value = "/update") |
| | | public R<Boolean> update(@Validated @RequestBody TBanner dto) { |
| | | return R.ok(bannerService.updateById(dto)); |
| | | } |
| | | |
| | | /** |
| | | * 查看轮播图详情 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:banner:detail')") |
| | | @ApiOperation(value = "查看轮播图详情") |
| | | @GetMapping(value = "/getDetailById") |
| | | public R<TBanner> getDetailById(@RequestParam String id) { |
| | | return R.ok(bannerService.getById(id)); |
| | | } |
| | | |
| | | /** |
| | | * 删除轮播图 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:banner:delete')") |
| | | @Log(title = "轮播图信息-删除轮播图", businessType = BusinessType.DELETE) |
| | | @ApiOperation(value = "删除轮播图") |
| | | @DeleteMapping(value = "/deleteById") |
| | | public R<Boolean> deleteById(@RequestParam String id) { |
| | | return R.ok(bannerService.removeById(id)); |
| | | } |
| | | |
| | | /** |
| | | * 批量删除轮播图 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:banner:delete')") |
| | | @Log(title = "轮播图信息-删除轮播图", businessType = BusinessType.DELETE) |
| | | @ApiOperation(value = "批量删除轮播图") |
| | | @DeleteMapping(value = "/deleteByIds") |
| | | public R<Boolean> deleteByIds(@RequestBody List<String> ids) { |
| | | return R.ok(bannerService.removeByIds(ids)); |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.system.dto.TBillDto; |
| | | import com.ruoyi.system.model.TBill; |
| | | import com.ruoyi.system.query.TBillQuery; |
| | | import com.ruoyi.system.service.TBillService; |
| | |
| | | TBillService tBillService; |
| | | |
| | | @PostMapping("list") |
| | | public R<PageInfo<TBill>> list(@RequestBody TBillQuery query){ |
| | | PageInfo<TBill> pageInfo = tBillService.queryPage(query); |
| | | public R<PageInfo<TBillDto>> list(@RequestBody TBillQuery query){ |
| | | PageInfo<TBillDto> pageInfo = tBillService.queryPage(query); |
| | | return R.ok(pageInfo); |
| | | } |
| | | |
| | |
| | | package com.ruoyi.web.controller.api; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.system.model.TFaultAreaDic; |
| | | import com.ruoyi.system.model.TFaultDescribeDic; |
| | | import com.ruoyi.system.model.TItem; |
| | | import com.ruoyi.system.model.TItemType; |
| | | import com.ruoyi.system.query.TFaultAreaDicQuery; |
| | | import com.ruoyi.system.service.TFaultAreaDicService; |
| | | import com.ruoyi.system.service.TFaultDescribeDicService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | public class TFaultAreaDicController { |
| | | |
| | | private final TFaultAreaDicService faultAreaDicService; |
| | | private final TFaultDescribeDicService faultDescribeDicService; |
| | | @Autowired |
| | | public TFaultAreaDicController(TFaultAreaDicService faultAreaDicService) { |
| | | public TFaultAreaDicController(TFaultAreaDicService faultAreaDicService, TFaultDescribeDicService faultDescribeDicService) { |
| | | this.faultAreaDicService = faultAreaDicService; |
| | | this.faultDescribeDicService = faultDescribeDicService; |
| | | } |
| | | |
| | | /** |
| | |
| | | @ApiOperation(value = "获取故障区域列表") |
| | | @PostMapping(value = "/list") |
| | | public R<List<TFaultAreaDic>> list() { |
| | | return R.ok(faultAreaDicService.list()); |
| | | return R.ok(faultAreaDicService.list(Wrappers.lambdaQuery(TFaultAreaDic.class).orderByDesc(TFaultAreaDic::getSortBy).orderByDesc(TFaultAreaDic::getCreateTime))); |
| | | } |
| | | |
| | | /** |
| | |
| | | @ApiOperation(value = "添加故障区域") |
| | | @PostMapping(value = "/add") |
| | | public R<Boolean> add(@Validated @RequestBody TFaultAreaDic dto) { |
| | | if (faultAreaDicService.isExit(dto)) { |
| | | return R.fail("故障区域名称已存在"); |
| | | } |
| | | return R.ok(faultAreaDicService.save(dto)); |
| | | } |
| | | |
| | |
| | | @ApiOperation(value = "修改故障区域") |
| | | @PostMapping(value = "/update") |
| | | public R<Boolean> update(@Validated @RequestBody TFaultAreaDic dto) { |
| | | if (faultAreaDicService.isExit(dto)) { |
| | | return R.fail("故障区域名称已存在"); |
| | | } |
| | | return R.ok(faultAreaDicService.updateById(dto)); |
| | | } |
| | | |
| | |
| | | @ApiOperation(value = "删除故障区域") |
| | | @DeleteMapping(value = "/deleteById") |
| | | public R<Boolean> deleteById(@RequestParam String id) { |
| | | long count = faultDescribeDicService.count(Wrappers.lambdaQuery(TFaultDescribeDic.class).eq(TFaultDescribeDic::getFaultId, id)); |
| | | if (count>0) { |
| | | return R.fail("该区域下有故障描述,无法删除"); |
| | | } |
| | | return R.ok(faultAreaDicService.removeById(id)); |
| | | } |
| | | |
| | |
| | | @ApiOperation(value = "批量删除故障区域") |
| | | @DeleteMapping(value = "/deleteByIds") |
| | | public R<Boolean> deleteByIds(@RequestBody List<String> ids) { |
| | | List<TFaultDescribeDic> items = faultDescribeDicService.list(Wrappers.lambdaQuery(TFaultDescribeDic.class).in(TFaultDescribeDic::getFaultId, ids)); |
| | | for (String id : ids) { |
| | | if (items.stream().anyMatch(t -> t.getFaultId().equals(id))) { |
| | | TFaultAreaDic faultAreaDic = faultAreaDicService.getById(id); |
| | | return R.fail("该区域["+faultAreaDic.getFaultAreaName()+"]下有故障描述,无法删除"); |
| | | } |
| | | } |
| | | return R.ok(faultAreaDicService.removeByIds(ids)); |
| | | } |
| | | |
| | |
| | | package com.ruoyi.web.controller.api; |
| | | |
| | | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.system.model.TInformation; |
| | | import com.ruoyi.system.query.TInformationQuery; |
| | | import com.ruoyi.system.service.TInformationService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @author xiaochen |
| | | * @since 2025-01-17 |
| | | */ |
| | | @Api(tags = "资讯管理") |
| | | @RestController |
| | | @RequestMapping("/t-information") |
| | | public class TInformationController { |
| | | |
| | | private final TInformationService informationService; |
| | | @Autowired |
| | | public TInformationController(TInformationService informationService) { |
| | | this.informationService = informationService; |
| | | } |
| | | |
| | | /** |
| | | * 获取资讯管理管理列表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:information:list')") |
| | | @ApiOperation(value = "获取资讯管理分页列表") |
| | | @PostMapping(value = "/pageList") |
| | | public R<PageInfo<TInformation>> pageList(@RequestBody TInformationQuery query) { |
| | | return R.ok(informationService.pageList(query)); |
| | | } |
| | | |
| | | /** |
| | | * 添加资讯管理管理 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:information:add')") |
| | | @Log(title = "资讯管理信息-新增资讯管理", businessType = BusinessType.INSERT) |
| | | @ApiOperation(value = "添加资讯管理") |
| | | @PostMapping(value = "/add") |
| | | public R<Boolean> add(@Validated @RequestBody TInformation dto) { |
| | | return R.ok(informationService.save(dto)); |
| | | } |
| | | |
| | | /** |
| | | * 修改资讯管理 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:information:update')") |
| | | @Log(title = "资讯管理信息-修改资讯管理", businessType = BusinessType.UPDATE) |
| | | @ApiOperation(value = "修改资讯管理") |
| | | @PostMapping(value = "/update") |
| | | public R<Boolean> update(@Validated @RequestBody TInformation dto) { |
| | | return R.ok(informationService.updateById(dto)); |
| | | } |
| | | |
| | | /** |
| | | * 查看资讯管理详情 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:information:detail')") |
| | | @ApiOperation(value = "查看资讯管理详情") |
| | | @GetMapping(value = "/getDetailById") |
| | | public R<TInformation> getDetailById(@RequestParam String id) { |
| | | return R.ok(informationService.getById(id)); |
| | | } |
| | | |
| | | /** |
| | | * 删除资讯管理 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:information:delete')") |
| | | @Log(title = "资讯管理信息-删除资讯管理", businessType = BusinessType.DELETE) |
| | | @ApiOperation(value = "删除资讯管理") |
| | | @DeleteMapping(value = "/deleteById") |
| | | public R<Boolean> deleteById(@RequestParam String id) { |
| | | return R.ok(informationService.removeById(id)); |
| | | } |
| | | |
| | | /** |
| | | * 批量删除资讯管理 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:information:delete')") |
| | | @Log(title = "资讯管理信息-删除资讯管理", businessType = BusinessType.DELETE) |
| | | @ApiOperation(value = "批量删除资讯管理") |
| | | @DeleteMapping(value = "/deleteByIds") |
| | | public R<Boolean> deleteByIds(@RequestBody List<String> ids) { |
| | | return R.ok(informationService.removeByIds(ids)); |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | package com.ruoyi.web.controller.api; |
| | | |
| | | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.system.model.TItem; |
| | | import com.ruoyi.system.query.TItemQuery; |
| | | import com.ruoyi.system.service.TItemService; |
| | | import com.ruoyi.system.vo.TItemVO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @author xiaochen |
| | | * @since 2025-01-17 |
| | | */ |
| | | @Api(tags = "维修物品管理") |
| | | @RestController |
| | | @RequestMapping("/t-item") |
| | | public class TItemController { |
| | | |
| | | private final TItemService itemService; |
| | | @Autowired |
| | | public TItemController(TItemService itemService) { |
| | | this.itemService = itemService; |
| | | } |
| | | |
| | | /** |
| | | * 获取维修物品管理列表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:item:list')") |
| | | @ApiOperation(value = "获取维修物品分页列表") |
| | | @PostMapping(value = "/pageList") |
| | | public R<PageInfo<TItemVO>> pageList(@RequestBody TItemQuery query) { |
| | | return R.ok(itemService.pageList(query)); |
| | | } |
| | | |
| | | /** |
| | | * 添加维修物品管理 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:item:add')") |
| | | @Log(title = "维修物品信息-新增维修物品", businessType = BusinessType.INSERT) |
| | | @ApiOperation(value = "添加维修物品") |
| | | @PostMapping(value = "/add") |
| | | public R<Boolean> add(@Validated @RequestBody TItem dto) { |
| | | return R.ok(itemService.save(dto)); |
| | | } |
| | | |
| | | /** |
| | | * 修改维修物品 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:item:update')") |
| | | @Log(title = "维修物品信息-修改维修物品", businessType = BusinessType.UPDATE) |
| | | @ApiOperation(value = "修改维修物品") |
| | | @PostMapping(value = "/update") |
| | | public R<Boolean> update(@Validated @RequestBody TItem dto) { |
| | | return R.ok(itemService.updateById(dto)); |
| | | } |
| | | |
| | | /** |
| | | * 查看维修物品详情 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:item:detail')") |
| | | @ApiOperation(value = "查看维修物品详情") |
| | | @GetMapping(value = "/getDetailById") |
| | | public R<TItem> getDetailById(@RequestParam String id) { |
| | | return R.ok(itemService.getById(id)); |
| | | } |
| | | |
| | | /** |
| | | * 删除维修物品 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:item:delete')") |
| | | @Log(title = "维修物品信息-删除维修物品", businessType = BusinessType.DELETE) |
| | | @ApiOperation(value = "删除维修物品") |
| | | @DeleteMapping(value = "/deleteById") |
| | | public R<Boolean> deleteById(@RequestParam String id) { |
| | | return R.ok(itemService.removeById(id)); |
| | | } |
| | | |
| | | /** |
| | | * 批量删除维修物品 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:item:delete')") |
| | | @Log(title = "维修物品信息-删除维修物品", businessType = BusinessType.DELETE) |
| | | @ApiOperation(value = "批量删除维修物品") |
| | | @DeleteMapping(value = "/deleteByIds") |
| | | public R<Boolean> deleteByIds(@RequestBody List<String> ids) { |
| | | return R.ok(itemService.removeByIds(ids)); |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | package com.ruoyi.web.controller.api; |
| | | |
| | | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.system.model.TItem; |
| | | import com.ruoyi.system.model.TItemType; |
| | | import com.ruoyi.system.query.TItemTypeQuery; |
| | | import com.ruoyi.system.service.TItemService; |
| | | import com.ruoyi.system.service.TItemTypeService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @author xiaochen |
| | | * @since 2025-01-17 |
| | | */ |
| | | @Api(tags = "维修物品分类管理") |
| | | @RestController |
| | | @RequestMapping("/t-item-type") |
| | | public class TItemTypeController { |
| | | |
| | | private final TItemTypeService itemTypeService; |
| | | private final TItemService itemService; |
| | | @Autowired |
| | | public TItemTypeController(TItemTypeService itemTypeService, TItemService itemService) { |
| | | this.itemTypeService = itemTypeService; |
| | | this.itemService = itemService; |
| | | } |
| | | |
| | | /** |
| | | * 获取维修物品分类管理列表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:itemType:list')") |
| | | @ApiOperation(value = "获取维修物品分类分页列表") |
| | | @PostMapping(value = "/pageList") |
| | | public R<PageInfo<TItemType>> pageList(@RequestBody TItemTypeQuery query) { |
| | | return R.ok(itemTypeService.pageList(query)); |
| | | } |
| | | |
| | | /** |
| | | * 获取维修物品分类管理列表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:itemType:list')") |
| | | @ApiOperation(value = "获取维修物品分类列表") |
| | | @PostMapping(value = "/list") |
| | | public R<List<TItemType>> list() { |
| | | return R.ok(itemTypeService.list(Wrappers.lambdaQuery(TItemType.class).orderByDesc(TItemType::getSortBy).orderByDesc(TItemType::getCreateTime))); |
| | | } |
| | | |
| | | /** |
| | | * 添加维修物品分类管理 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:itemType:add')") |
| | | @Log(title = "维修物品分类信息-新增维修物品分类", businessType = BusinessType.INSERT) |
| | | @ApiOperation(value = "添加维修物品分类") |
| | | @PostMapping(value = "/add") |
| | | public R<Boolean> add(@Validated @RequestBody TItemType dto) { |
| | | if (itemTypeService.isExit(dto)) { |
| | | return R.fail("维修物品分类名称已存在"); |
| | | } |
| | | return R.ok(itemTypeService.save(dto)); |
| | | } |
| | | |
| | | /** |
| | | * 修改维修物品分类 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:itemType:update')") |
| | | @Log(title = "维修物品分类信息-修改维修物品分类", businessType = BusinessType.UPDATE) |
| | | @ApiOperation(value = "修改维修物品分类") |
| | | @PostMapping(value = "/update") |
| | | public R<Boolean> update(@Validated @RequestBody TItemType dto) { |
| | | if (itemTypeService.isExit(dto)) { |
| | | return R.fail("维修物品分类名称已存在"); |
| | | } |
| | | return R.ok(itemTypeService.updateById(dto)); |
| | | } |
| | | |
| | | /** |
| | | * 查看维修物品分类详情 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:itemType:detail')") |
| | | @ApiOperation(value = "查看维修物品分类详情") |
| | | @GetMapping(value = "/getDetailById") |
| | | public R<TItemType> getDetailById(@RequestParam String id) { |
| | | return R.ok(itemTypeService.getById(id)); |
| | | } |
| | | |
| | | /** |
| | | * 删除维修物品分类 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:itemType:delete')") |
| | | @Log(title = "维修物品分类信息-删除维修物品分类", businessType = BusinessType.DELETE) |
| | | @ApiOperation(value = "删除维修物品分类") |
| | | @DeleteMapping(value = "/deleteById") |
| | | public R<Boolean> deleteById(@RequestParam String id) { |
| | | long count = itemService.count(Wrappers.lambdaQuery(TItem.class).eq(TItem::getTypeId, id)); |
| | | if (count>0) { |
| | | return R.fail("该分类下有维修物品,无法删除"); |
| | | } |
| | | return R.ok(itemTypeService.removeById(id)); |
| | | } |
| | | |
| | | /** |
| | | * 批量删除维修物品分类 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:itemType:delete')") |
| | | @Log(title = "维修物品分类信息-删除维修物品分类", businessType = BusinessType.DELETE) |
| | | @ApiOperation(value = "批量删除维修物品分类") |
| | | @DeleteMapping(value = "/deleteByIds") |
| | | public R<Boolean> deleteByIds(@RequestBody List<String> ids) { |
| | | List<TItem> items = itemService.list(Wrappers.lambdaQuery(TItem.class).in(TItem::getTypeId, ids)); |
| | | for (String id : ids) { |
| | | if (items.stream().anyMatch(t -> t.getTypeId().equals(id))) { |
| | | TItemType itemType = itemTypeService.getById(id); |
| | | return R.fail("该分类["+itemType.getTypeName()+"]下有维修物品,无法删除"); |
| | | } |
| | | } |
| | | return R.ok(itemTypeService.removeByIds(ids)); |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | package com.ruoyi.web.controller.api; |
| | | |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.system.dto.MakeOrderDto; |
| | | import com.ruoyi.system.dto.MakeOrderResp; |
| | | import com.ruoyi.system.service.TPayOrderService; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | |
| | | |
| | | |
| | | |
| | | @Autowired |
| | | TPayOrderService tPayOrderService; |
| | | |
| | | |
| | | @ApiOperation(value = "创建支付订单") |
| | | @PostMapping("makeOrder") |
| | | public AjaxResult makeOrder(){ |
| | | |
| | | return null; |
| | | public R<MakeOrderResp> makeOrder(@Validated @RequestBody MakeOrderDto dto){ |
| | | MakeOrderResp resp = tPayOrderService.makeOrder(dto); |
| | | return R.ok(resp); |
| | | } |
| | | |
| | | |
New file |
| | |
| | | package com.ruoyi.common.constant; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | public class AmountConstant { |
| | | |
| | | public static final BigDecimal b100 = new BigDecimal("100"); |
| | | |
| | | public static final BigDecimal b1000 = new BigDecimal("1000"); |
| | | |
| | | public static final BigDecimal b001 = new BigDecimal("0.01"); |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | * 高德地图坐标转换 |
| | | */ |
| | | public static final String ADDRESS_CONVERT_TO_COORDINATE = "https://restapi.amap.com/v3/geocode/geo?key=KEY&address=ADDRESS"; |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.common.utils; |
| | | |
| | | import com.ruoyi.common.utils.ip.IpUtils; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | |
| | | import java.util.concurrent.atomic.AtomicLong; |
| | | |
| | | public class OrderNos { |
| | | |
| | | public static final char PADCHAR = '0'; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 长度24位全球唯一标识 |
| | | */ |
| | | |
| | | /** |
| | | * 统一不重复内部订单号 |
| | | * |
| | | * @param systemCode |
| | | * 4字节系统编码 |
| | | * @return 24字节不重复编码 |
| | | */ |
| | | public static String oid(String systemCode) { |
| | | StringBuilder sb = new StringBuilder(); |
| | | sb.append(padding(systemCode, 4)); |
| | | sb.append(Did.getInstance().getId(20)); |
| | | return sb.toString(); |
| | | } |
| | | |
| | | public static String oid() { |
| | | return oid("O001"); |
| | | } |
| | | |
| | | /** |
| | | * 获取分布式Id |
| | | * |
| | | * @return 默认20字符长度的数字不重复编码 |
| | | */ |
| | | public static String getDid() { |
| | | return Did.getInstance().getId(); |
| | | } |
| | | |
| | | public static String getDid(int size) { |
| | | return Did.getInstance().getId(size); |
| | | } |
| | | |
| | | public static String getDid(String prefix) { |
| | | return prefix + Did.getInstance().getId(); |
| | | } |
| | | |
| | | private static String padding(String text, int size) { |
| | | String txt = StringUtils.trimToEmpty(text); |
| | | if (StringUtils.length(txt) > size) { |
| | | txt = StringUtils.substring(txt, StringUtils.length(txt) - size); |
| | | } |
| | | return StringUtils.leftPad(txt, size, PADCHAR); |
| | | } |
| | | |
| | | /** |
| | | * ID生成器 |
| | | * |
| | | * 20字符长度 yyMMddHHmmss+3位本机IP末三位+5位随机数字 |
| | | * |
| | | * @author zhangpu |
| | | * |
| | | */ |
| | | public static class Did { |
| | | private static final Logger logger = LoggerFactory.getLogger(OrderNos.class); |
| | | private static final int MIN_LENGTH = 19; |
| | | private static final int SEQU_MAX = 99999; |
| | | private static final int SEQU_19_MAX = 9999; |
| | | private volatile static long BASE = 0; |
| | | private AtomicLong sequence = new AtomicLong(0); |
| | | private String nodeFlag; |
| | | private Object nodeFlagLock = new Object(); |
| | | private static Did did = new Did(); |
| | | |
| | | |
| | | public static Did getInstance() { |
| | | return did; |
| | | } |
| | | |
| | | /** |
| | | * 生产新Id |
| | | * |
| | | * @return |
| | | */ |
| | | public String getId() { |
| | | return getId(20); |
| | | } |
| | | |
| | | public String getId(int size) { |
| | | if (size < MIN_LENGTH) { |
| | | throw new RuntimeException("did最小长度为" + MIN_LENGTH); |
| | | } |
| | | StringBuilder sb = new StringBuilder(); |
| | | sb.append(DateUtils.dateTimeNow("yyMMddHHmmss")); |
| | | sb.append(getNodeFlag()); |
| | | sb.append(getSequ(size-15)); |
| | | return sb.toString(); |
| | | } |
| | | |
| | | public synchronized String getSequ(int size) { |
| | | long timeCount = System.currentTimeMillis() / 1000; |
| | | |
| | | while (true) { |
| | | long now = sequence.get(); |
| | | if (timeCount > now) { |
| | | // 已经过了本秒,则设置新的值 |
| | | if (sequence.compareAndSet(now, timeCount)) { |
| | | break; |
| | | } |
| | | } else { |
| | | if (sequence.compareAndSet(now, now + 1)) { |
| | | timeCount = now + 1; |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | int sn = (int) (timeCount % (size>=5?SEQU_MAX:SEQU_19_MAX)); |
| | | return StringUtils.leftPad(String.valueOf(sn), size, '0'); |
| | | } |
| | | |
| | | private String getNodeFlag(){ |
| | | if (this.nodeFlag == null) { |
| | | synchronized (Did.class){ |
| | | if (this.nodeFlag==null){ |
| | | this.nodeFlag = generateNodeFlag(); |
| | | } |
| | | } |
| | | } |
| | | return this.nodeFlag; |
| | | } |
| | | |
| | | /** |
| | | * 简单节点编码 |
| | | * |
| | | * 逻辑:Ip地址后三位,便于快速知道是哪个节点 |
| | | * |
| | | * @return |
| | | */ |
| | | private String generateNodeFlag() { |
| | | String ipPostfix = null; |
| | | try { |
| | | String ip = IpUtils.getFirstNoLoopbackIPV4Address(); |
| | | ipPostfix = StringUtils.substringAfterLast(ip, "."); |
| | | } catch (Exception e) { |
| | | logger.warn("生产DID要素本机IP获取失败:" + e.getMessage()); |
| | | } |
| | | return StringUtils.leftPad(ipPostfix, 3, "0"); |
| | | } |
| | | |
| | | private Did() { |
| | | super(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | package com.ruoyi.common.utils.ip; |
| | | |
| | | import java.net.InetAddress; |
| | | import java.net.UnknownHostException; |
| | | import java.net.*; |
| | | import java.util.ArrayList; |
| | | import java.util.Collection; |
| | | import java.util.Enumeration; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import com.ruoyi.common.utils.ServletUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | /** |
| | | * 获取IP方法 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @Slf4j |
| | | public class IpUtils |
| | | { |
| | | public final static String REGX_0_255 = "(25[0-5]|2[0-4]\\d|1\\d{2}|[1-9]\\d|\\d)"; |
| | |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | |
| | | private static final String LOOP_BACK = "127.0.0.1"; |
| | | private static String firstNoLoopbackIPV4Address = null; |
| | | |
| | | private static Collection<InetAddress> allHostIPV4Address = null; |
| | | /** |
| | | * 获取ipv4地址,如果有多个网卡的情况,获取第一个非loopback ip地址 |
| | | * |
| | | * @return |
| | | */ |
| | | public static String getFirstNoLoopbackIPV4Address() { |
| | | if (firstNoLoopbackIPV4Address != null) { |
| | | return firstNoLoopbackIPV4Address; |
| | | } |
| | | Collection<String> allNoLoopbackAddresses = null; |
| | | try { |
| | | allNoLoopbackAddresses = getAllNoLoopbackIPV4Addresses(); |
| | | } catch (Exception e) { |
| | | log.error("获取ip失败", e); |
| | | return LOOP_BACK; |
| | | } |
| | | if (allNoLoopbackAddresses.isEmpty()) { |
| | | return LOOP_BACK; |
| | | } |
| | | |
| | | return firstNoLoopbackIPV4Address = allNoLoopbackAddresses.iterator().next(); |
| | | } |
| | | |
| | | |
| | | public static Collection<String> getAllNoLoopbackIPV4Addresses() { |
| | | Collection<String> noLoopbackAddresses = new ArrayList<String>(); |
| | | Collection<InetAddress> allInetAddresses = getAllHostIPV4Address(); |
| | | |
| | | for (InetAddress address : allInetAddresses) { |
| | | if (!address.isLoopbackAddress()) { |
| | | noLoopbackAddresses.add(address.getHostAddress()); |
| | | } |
| | | } |
| | | |
| | | return noLoopbackAddresses; |
| | | } |
| | | |
| | | public static Collection<InetAddress> getAllHostIPV4Address() { |
| | | if (allHostIPV4Address == null) { |
| | | try { |
| | | Enumeration<NetworkInterface> networkInterfaces = NetworkInterface.getNetworkInterfaces(); |
| | | Collection<InetAddress> addresses = new ArrayList<InetAddress>(); |
| | | |
| | | while (networkInterfaces.hasMoreElements()) { |
| | | NetworkInterface networkInterface = networkInterfaces.nextElement(); |
| | | Enumeration<InetAddress> inetAddresses = networkInterface.getInetAddresses(); |
| | | while (inetAddresses.hasMoreElements()) { |
| | | InetAddress inetAddress = inetAddresses.nextElement(); |
| | | if (inetAddress instanceof Inet4Address) { |
| | | addresses.add(inetAddress); |
| | | } |
| | | } |
| | | } |
| | | allHostIPV4Address = addresses; |
| | | } catch (SocketException e) { |
| | | log.error("获取ip地址失败", e); |
| | | throw new RuntimeException(e.getMessage(), e); |
| | | } |
| | | |
| | | } |
| | | return allHostIPV4Address; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotEmpty; |
| | | import javax.validation.constraints.NotNull; |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @ApiModel(value = "使用账单创建订单请求") |
| | | public class MakeOrderDto implements Serializable { |
| | | /** |
| | | * 用户ID |
| | | */ |
| | | @ApiModelProperty(value = "用户ID") |
| | | @NotBlank(message = "用户ID不能为空") |
| | | private String userId; |
| | | /** |
| | | * 用户openid |
| | | */ |
| | | @ApiModelProperty(value = "用户微信或支付宝openid") |
| | | private String openId; |
| | | |
| | | @ApiModelProperty(value = "支付金额,单位:分") |
| | | @NotNull(message = "用户ID不能为空") |
| | | private Long amount; |
| | | |
| | | @ApiModelProperty(value = "账单ID列表",notes = "如果只有1个账单ID,金额可以小于账单金额,进行部分缴费;如果是多个账单,将会核对金额,未交费金额需要与缴费金额一致") |
| | | @NotEmpty(message = "用户ID不能为空") |
| | | private List<String> billIds; |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | | @ApiModel(value = "使用账单创建订单请求") |
| | | public class MakeOrderResp implements Serializable { |
| | | /** |
| | | * 订单编号 |
| | | */ |
| | | @ApiModelProperty("订单编号") |
| | | private String orderNo; |
| | | @ApiModelProperty("金额,分") |
| | | private Long amount; |
| | | @ApiModelProperty("微信小程序支付跳转链接,用于生成二维码") |
| | | private String appletUrl; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.dto; |
| | | |
| | | import com.ruoyi.system.model.TBill; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class TBillDto extends TBill { |
| | | |
| | | private String residentName; |
| | | |
| | | private String phone; |
| | | |
| | | private String account; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.system.model.TBanner; |
| | | import com.ruoyi.system.query.TBannerQuery; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 轮播图管理 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2025-02-07 |
| | | */ |
| | | public interface TBannerMapper extends BaseMapper<TBanner> { |
| | | |
| | | /** |
| | | * 获取轮播图管理列表 |
| | | * @param query |
| | | * @param pageInfo |
| | | * @return |
| | | */ |
| | | List<TBanner> pageList(@Param("query") TBannerQuery query, @Param("pageInfo")PageInfo<TBanner> pageInfo); |
| | | |
| | | } |
| | |
| | | package com.ruoyi.system.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.system.dto.TBillDto; |
| | | import com.ruoyi.system.model.TBill; |
| | | import com.ruoyi.system.query.TBillQuery; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.Select; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface TBillMapper extends BaseMapper<TBill> { |
| | | |
| | | PageInfo<TBillDto> page(@Param("pageInfo") PageInfo<TBill> pageInfo, @Param("query") TBillQuery query); |
| | | |
| | | } |
| | |
| | | package com.ruoyi.system.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.system.model.TInformation; |
| | | import com.ruoyi.system.query.TInformationQuery; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface TInformationMapper extends BaseMapper<TInformation> { |
| | | |
| | | /** |
| | | * 获取资讯管理分页列表 |
| | | * @param query |
| | | * @param pageInfo |
| | | * @return |
| | | */ |
| | | List<TInformation> pageList(@Param("query") TInformationQuery query, @Param("pageInfo")PageInfo<TInformation> pageInfo); |
| | | } |
| | |
| | | package com.ruoyi.system.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.system.model.TItem; |
| | | import com.ruoyi.system.query.TItemQuery; |
| | | import com.ruoyi.system.vo.TItemVO; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface TItemMapper extends BaseMapper<TItem> { |
| | | |
| | | /** |
| | | * 获取维修物品分页列表 |
| | | * @param query |
| | | * @param pageInfo |
| | | * @return |
| | | */ |
| | | List<TItemVO> pageList(@Param("query") TItemQuery query, @Param("pageInfo")PageInfo<TItemVO> pageInfo); |
| | | |
| | | } |
| | |
| | | package com.ruoyi.system.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.system.model.TItemType; |
| | | import com.ruoyi.system.query.TItemTypeQuery; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface TItemTypeMapper extends BaseMapper<TItemType> { |
| | | |
| | | /** |
| | | * 获取维修物品分类管理列表 |
| | | * @param query |
| | | * @param pageInfo |
| | | * @return |
| | | */ |
| | | List<TItemType> pageList(@Param("query") TItemTypeQuery query, @Param("pageInfo")PageInfo<TItemType> pageInfo); |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.system.model.TOrderBill; |
| | | |
| | | /** |
| | | * <p> |
| | | * 订单表与账单的关联表 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2025-02-07 |
| | | */ |
| | | public interface TOrderBillMapper extends BaseMapper<TOrderBill> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.system.model.TPayOrder; |
| | | |
| | | /** |
| | | * <p> |
| | | * 支付订单表 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2025-02-07 |
| | | */ |
| | | public interface TPayOrderMapper extends BaseMapper<TPayOrder> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.ruoyi.common.core.domain.BaseModel; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * <p> |
| | | * 轮播图管理 |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2025-02-07 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("t_banner") |
| | | @ApiModel(value="TBanner对象", description="轮播图管理") |
| | | public class TBanner extends BaseModel { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableId(value = "id", type = IdType.ASSIGN_ID) |
| | | private String id; |
| | | |
| | | @ApiModelProperty(value = "图片") |
| | | @TableField("pictures") |
| | | private String pictures; |
| | | |
| | | @ApiModelProperty(value = "权重") |
| | | @TableField("sort_by") |
| | | private Integer sortBy; |
| | | |
| | | } |
| | |
| | | @TableField("contract_id") |
| | | private String contractId; |
| | | |
| | | @ApiModelProperty(value = "合同编号") |
| | | @TableField("contract_number") |
| | | private String contractNumber; |
| | | |
| | | @ApiModelProperty(value = "应缴费") |
| | | @TableField("payable_fees_money") |
| | | private BigDecimal payableFeesMoney; |
| | |
| | | @TableField("bank_serial_number") |
| | | private String bankSerialNumber; |
| | | |
| | | @ApiModelProperty(value = "实际收款") |
| | | @TableField("actual_money") |
| | | private BigDecimal actualMoney; |
| | | @ApiModelProperty(value = "欠费金额") |
| | | @TableField("outstanding_money") |
| | | private BigDecimal outstandingMoney; |
| | | |
| | | @ApiModelProperty(value = "凭证上传") |
| | | @TableField("voucher") |
| | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import org.hibernate.validator.constraints.Length; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | |
| | |
| | | private String id; |
| | | |
| | | @NotBlank(message = "部门ID不能为空") |
| | | @Length(max = 10, message = "部门ID不能超过10个字符") |
| | | @ApiModelProperty(value = "部门id") |
| | | @TableField("dept_id") |
| | | private String deptId; |
| | |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | /** |
| | | * <p> |
| | | * 资讯管理 |
| | |
| | | @TableId(value = "id", type = IdType.ASSIGN_ID) |
| | | private String id; |
| | | |
| | | @NotBlank(message = "资讯标题不能为空") |
| | | @ApiModelProperty(value = "标题") |
| | | @TableField("title_name") |
| | | private String titleName; |
| | |
| | | @TableField("info_source") |
| | | private String infoSource; |
| | | |
| | | @NotNull(message = "请选择发布时间") |
| | | @ApiModelProperty(value = "发布时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @TableField("release_time") |
| | |
| | | @TableField("content") |
| | | private String content; |
| | | |
| | | @ApiModelProperty(value = "附件") |
| | | @ApiModelProperty(value = "附件 逗号分割 ") |
| | | @TableField("attachment") |
| | | private String attachment; |
| | | |
| | | @ApiModelProperty(value = "附件名称 与附件顺序一致") |
| | | @TableField("attachment_name") |
| | | private String attachmentName; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * <p> |
| | | * 订单表与账单的关联表 |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2025-02-07 |
| | | */ |
| | | @Data |
| | | @NoArgsConstructor |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("t_order_bill") |
| | | @ApiModel(value="TOrderBill对象", description="订单表与账单的关联表") |
| | | public class TOrderBill implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableId(value = "id", type = IdType.ASSIGN_ID) |
| | | private String id; |
| | | |
| | | @ApiModelProperty(value = "订单号") |
| | | @TableField("order_no") |
| | | private String orderNo; |
| | | |
| | | @ApiModelProperty(value = "账单编号") |
| | | @TableField("bill_id") |
| | | private String billId; |
| | | |
| | | @TableField("create_time") |
| | | private LocalDateTime createTime; |
| | | |
| | | @TableField("update_time") |
| | | private LocalDateTime updateTime; |
| | | |
| | | public TOrderBill(String orderNo, String billId) { |
| | | this.orderNo = orderNo; |
| | | this.billId = billId; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * <p> |
| | | * 支付订单表 |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2025-02-07 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("t_pay_order") |
| | | @ApiModel(value="TPayOrder对象", description="支付订单表") |
| | | public class TPayOrder implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "订单号") |
| | | @TableId("id") |
| | | private String id; |
| | | |
| | | @ApiModelProperty(value = "发起支付的用户ID") |
| | | @TableField("user_id") |
| | | private String userId; |
| | | |
| | | @ApiModelProperty(value = "用户名称") |
| | | @TableField("user_name") |
| | | private String userName; |
| | | |
| | | @ApiModelProperty(value = "用户微信openid或支付宝userid") |
| | | @TableField("open_id") |
| | | private String openId; |
| | | |
| | | @ApiModelProperty(value = "用户手机号码") |
| | | @TableField("phone") |
| | | private String phone; |
| | | |
| | | @ApiModelProperty(value = "订单金额") |
| | | @TableField("amount") |
| | | private Long amount; |
| | | |
| | | @ApiModelProperty(value = "实付金额") |
| | | @TableField("act_pay_amount") |
| | | private Long actPayAmount; |
| | | |
| | | @ApiModelProperty(value = "支付时间") |
| | | @TableField("pay_time") |
| | | private LocalDateTime payTime; |
| | | |
| | | @ApiModelProperty(value = "支付方式") |
| | | @TableField("pay_type") |
| | | private String payType; |
| | | |
| | | @ApiModelProperty(value = "支付的回调信息") |
| | | @TableField("pay_info") |
| | | private String payInfo; |
| | | |
| | | @ApiModelProperty(value = "银行的支付流水编号") |
| | | @TableField("pay_no") |
| | | private String payNo; |
| | | |
| | | @ApiModelProperty(value = "支付的回调时间") |
| | | @TableField("callback_time") |
| | | private LocalDateTime callbackTime; |
| | | |
| | | @ApiModelProperty(value = "订单创建时间") |
| | | @TableField("create_time") |
| | | private LocalDateTime createTime; |
| | | |
| | | @ApiModelProperty(value = "订单更新时间") |
| | | @TableField("update_time") |
| | | private LocalDateTime updateTime; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.query; |
| | | |
| | | import com.ruoyi.common.core.domain.BasePage; |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "轮播图query") |
| | | public class TBannerQuery extends BasePage { |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | */ |
| | | private Integer payFeesStatus; |
| | | |
| | | private String phone; |
| | | |
| | | private String residentName; |
| | | |
| | | private String contractNumber; |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.query; |
| | | |
| | | import com.ruoyi.common.core.domain.BasePage; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "咨询列表query") |
| | | public class TInformationQuery extends BasePage { |
| | | |
| | | @ApiModelProperty(value = "标题") |
| | | private String titleName; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.query; |
| | | |
| | | import com.ruoyi.common.core.domain.BasePage; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "维修物品query") |
| | | public class TItemQuery extends BasePage { |
| | | |
| | | @ApiModelProperty(value = "分类id") |
| | | private String typeId; |
| | | |
| | | @ApiModelProperty(value = "物品名称") |
| | | private String itemName; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.query; |
| | | |
| | | import com.ruoyi.common.core.domain.BasePage; |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "维修物品分类query") |
| | | public class TItemTypeQuery extends BasePage { |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.system.model.TBanner; |
| | | import com.ruoyi.system.query.TBannerQuery; |
| | | |
| | | /** |
| | | * <p> |
| | | * 轮播图管理 服务类 |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2025-02-07 |
| | | */ |
| | | public interface TBannerService extends IService<TBanner> { |
| | | |
| | | /** |
| | | * 获取轮播图分页列表 |
| | | * @param query |
| | | * @return |
| | | */ |
| | | PageInfo<TBanner> pageList(TBannerQuery query); |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.system.dto.TBillDto; |
| | | import com.ruoyi.system.model.TBill; |
| | | import com.ruoyi.system.query.TBillQuery; |
| | | |
| | |
| | | */ |
| | | public interface TBillService extends IService<TBill> { |
| | | |
| | | PageInfo<TBill> queryPage(TBillQuery query); |
| | | PageInfo<TBillDto> queryPage(TBillQuery query); |
| | | |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | PageInfo<TFaultAreaDic> pageList(TFaultAreaDicQuery query); |
| | | |
| | | /** |
| | | * 判断区域是否存在 |
| | | * @param dto |
| | | * @return |
| | | */ |
| | | boolean isExit(TFaultAreaDic dto); |
| | | } |
| | |
| | | package com.ruoyi.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.system.model.TInformation; |
| | | import com.ruoyi.system.query.TInformationQuery; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface TInformationService extends IService<TInformation> { |
| | | |
| | | /** |
| | | * 分页查询 |
| | | * @param query |
| | | * @return |
| | | */ |
| | | PageInfo<TInformation> pageList(TInformationQuery query); |
| | | } |
| | |
| | | package com.ruoyi.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.system.model.TItem; |
| | | import com.ruoyi.system.query.TItemQuery; |
| | | import com.ruoyi.system.vo.TItemVO; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface TItemService extends IService<TItem> { |
| | | |
| | | /** |
| | | * 获取维修物品分页列表 |
| | | * @param query |
| | | * @return |
| | | */ |
| | | PageInfo<TItemVO> pageList(TItemQuery query); |
| | | } |
| | |
| | | package com.ruoyi.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.system.model.TItemType; |
| | | import com.ruoyi.system.query.TItemTypeQuery; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface TItemTypeService extends IService<TItemType> { |
| | | |
| | | /** |
| | | * 判断分类是否存在 |
| | | * @param dto |
| | | * @return |
| | | */ |
| | | boolean isExit(TItemType dto); |
| | | |
| | | /** |
| | | * 获取维修物品分类分页列表 |
| | | * @param query |
| | | * @return |
| | | */ |
| | | PageInfo<TItemType> pageList(TItemTypeQuery query); |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.system.model.TOrderBill; |
| | | |
| | | /** |
| | | * <p> |
| | | * 订单表与账单的关联表 服务类 |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2025-02-07 |
| | | */ |
| | | public interface TOrderBillService extends IService<TOrderBill> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.system.dto.MakeOrderDto; |
| | | import com.ruoyi.system.dto.MakeOrderResp; |
| | | import com.ruoyi.system.model.TPayOrder; |
| | | |
| | | /** |
| | | * <p> |
| | | * 支付订单表 服务类 |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2025-02-07 |
| | | */ |
| | | public interface TPayOrderService extends IService<TPayOrder> { |
| | | |
| | | MakeOrderResp makeOrder(MakeOrderDto dto); |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.common.core.domain.entity.SysRole; |
| | | import com.ruoyi.system.mapper.TBannerMapper; |
| | | import com.ruoyi.system.model.TBanner; |
| | | import com.ruoyi.system.query.TBannerQuery; |
| | | import com.ruoyi.system.service.TBannerService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 轮播图管理 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2025-02-07 |
| | | */ |
| | | @Service |
| | | public class TBannerServiceImpl extends ServiceImpl<TBannerMapper, TBanner> implements TBannerService { |
| | | |
| | | @Override |
| | | public PageInfo<TBanner> pageList(TBannerQuery query) { |
| | | PageInfo<TBanner> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); |
| | | List<TBanner> list = this.baseMapper.pageList(query,pageInfo); |
| | | pageInfo.setRecords(list); |
| | | return pageInfo; |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.redis.RedisCache; |
| | | import com.ruoyi.system.dto.TBillDto; |
| | | import com.ruoyi.system.mapper.TBillMapper; |
| | | import com.ruoyi.system.model.TBill; |
| | | import com.ruoyi.system.model.TContract; |
| | | import com.ruoyi.system.model.THouse; |
| | | import com.ruoyi.system.query.TBillQuery; |
| | | import com.ruoyi.system.service.TBillService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import io.jsonwebtoken.lang.Assert; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @Autowired |
| | | TBillMapper tBillMapper; |
| | | |
| | | public PageInfo<TBill> queryPage(TBillQuery query){ |
| | | return null; |
| | | public PageInfo<TBillDto> queryPage(TBillQuery query){ |
| | | PageInfo<TBill> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); |
| | | PageInfo<TBillDto> info = tBillMapper.page(pageInfo, query); |
| | | return info; |
| | | } |
| | | |
| | | |
| | |
| | | package com.ruoyi.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.common.constant.DictConstants; |
| | | import com.ruoyi.common.utils.DictUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.system.mapper.TFaultAreaDicMapper; |
| | | import com.ruoyi.system.model.TDept; |
| | | import com.ruoyi.system.model.TFaultAreaDic; |
| | | import com.ruoyi.system.query.TFaultAreaDicQuery; |
| | | import com.ruoyi.system.service.TFaultAreaDicService; |
| | |
| | | pageInfo.setRecords(list); |
| | | return pageInfo; |
| | | } |
| | | |
| | | @Override |
| | | public boolean isExit(TFaultAreaDic dto) { |
| | | if(StringUtils.isNotEmpty(dto.getId())){ |
| | | // 修改 |
| | | return this.count(Wrappers.lambdaQuery(TFaultAreaDic.class).ne(TFaultAreaDic::getId, dto.getId()).eq(TFaultAreaDic::getFaultAreaName, dto.getFaultAreaName())) > 0; |
| | | }else { |
| | | // 新增 |
| | | return this.count(Wrappers.lambdaQuery(TFaultAreaDic.class).eq(TFaultAreaDic::getFaultAreaName, dto.getFaultAreaName())) > 0; |
| | | } |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.system.service.impl; |
| | | |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.system.mapper.TInformationMapper; |
| | | import com.ruoyi.system.model.TInformation; |
| | | import com.ruoyi.system.query.TInformationQuery; |
| | | import com.ruoyi.system.service.TInformationService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.system.vo.HouseVO; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @Service |
| | | public class TInformationServiceImpl extends ServiceImpl<TInformationMapper, TInformation> implements TInformationService { |
| | | |
| | | @Override |
| | | public PageInfo<TInformation> pageList(TInformationQuery query) { |
| | | PageInfo<TInformation> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); |
| | | List<TInformation> list = this.baseMapper.pageList(query,pageInfo); |
| | | pageInfo.setRecords(list); |
| | | return pageInfo; |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.system.service.impl; |
| | | |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.system.mapper.TItemMapper; |
| | | import com.ruoyi.system.model.TInformation; |
| | | import com.ruoyi.system.model.TItem; |
| | | import com.ruoyi.system.query.TItemQuery; |
| | | import com.ruoyi.system.service.TItemService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.system.vo.TItemVO; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @Service |
| | | public class TItemServiceImpl extends ServiceImpl<TItemMapper, TItem> implements TItemService { |
| | | |
| | | @Override |
| | | public PageInfo<TItemVO> pageList(TItemQuery query) { |
| | | PageInfo<TItemVO> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); |
| | | List<TItemVO> list = this.baseMapper.pageList(query,pageInfo); |
| | | pageInfo.setRecords(list); |
| | | return pageInfo; |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.system.mapper.TItemTypeMapper; |
| | | import com.ruoyi.system.model.TContract; |
| | | import com.ruoyi.system.model.TFaultAreaDic; |
| | | import com.ruoyi.system.model.TItemType; |
| | | import com.ruoyi.system.query.TItemTypeQuery; |
| | | import com.ruoyi.system.service.TItemTypeService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @Service |
| | | public class TItemTypeServiceImpl extends ServiceImpl<TItemTypeMapper, TItemType> implements TItemTypeService { |
| | | |
| | | @Override |
| | | public boolean isExit(TItemType dto) { |
| | | if(StringUtils.isNotEmpty(dto.getId())){ |
| | | // 修改 |
| | | return this.count(Wrappers.lambdaQuery(TItemType.class).ne(TItemType::getId, dto.getId()).eq(TItemType::getTypeName, dto.getTypeName())) > 0; |
| | | }else { |
| | | // 新增 |
| | | return this.count(Wrappers.lambdaQuery(TItemType.class).eq(TItemType::getTypeName, dto.getTypeName())) > 0; |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public PageInfo<TItemType> pageList(TItemTypeQuery query) { |
| | | PageInfo<TItemType> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); |
| | | List<TItemType> list = this.baseMapper.pageList(query,pageInfo); |
| | | pageInfo.setRecords(list); |
| | | return pageInfo; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.system.mapper.TOrderBillMapper; |
| | | import com.ruoyi.system.model.TOrderBill; |
| | | import com.ruoyi.system.service.TOrderBillService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 订单表与账单的关联表 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2025-02-07 |
| | | */ |
| | | @Service |
| | | public class TOrderBillServiceImpl extends ServiceImpl<TOrderBillMapper, TOrderBill> implements TOrderBillService { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.constant.AmountConstant; |
| | | import com.ruoyi.common.exception.ServiceException; |
| | | import com.ruoyi.common.utils.OrderNos; |
| | | import com.ruoyi.system.dto.MakeOrderDto; |
| | | import com.ruoyi.system.dto.MakeOrderResp; |
| | | import com.ruoyi.system.mapper.TPayOrderMapper; |
| | | import com.ruoyi.system.model.TBill; |
| | | import com.ruoyi.system.model.TOrderBill; |
| | | import com.ruoyi.system.model.TPayOrder; |
| | | import com.ruoyi.system.model.TTenant; |
| | | import com.ruoyi.system.service.TBillService; |
| | | import com.ruoyi.system.service.TOrderBillService; |
| | | import com.ruoyi.system.service.TPayOrderService; |
| | | import com.ruoyi.system.service.TTenantService; |
| | | import org.apache.poi.ss.formula.functions.T; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | | * 支付订单表 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2025-02-07 |
| | | */ |
| | | @Service |
| | | public class TPayOrderServiceImpl extends ServiceImpl<TPayOrderMapper, TPayOrder> implements TPayOrderService { |
| | | |
| | | @Autowired |
| | | TBillService billService; |
| | | |
| | | @Autowired |
| | | TTenantService tTenantService; |
| | | |
| | | @Autowired |
| | | TOrderBillService tOrderBillService; |
| | | |
| | | |
| | | public long caculateRentFee(TBill bill){ |
| | | return bill.getPayableFeesMoney().add(bill.getPayableFeesPenalty()) |
| | | .subtract(bill.getActualMoney()) |
| | | .multiply(AmountConstant.b100) |
| | | .setScale(0, RoundingMode.HALF_DOWN) |
| | | .longValue(); |
| | | } |
| | | |
| | | |
| | | public String createAppletUrl(String orderNo){ |
| | | return ""+orderNo; |
| | | } |
| | | |
| | | @Override |
| | | public MakeOrderResp makeOrder(MakeOrderDto dto) { |
| | | |
| | | TTenant user = tTenantService.getById(dto.getUserId()); |
| | | if (user==null){ |
| | | throw new ServiceException("租户不存在"); |
| | | } |
| | | MakeOrderResp resp = new MakeOrderResp(); |
| | | if (dto.getBillIds().size()==1){ |
| | | TBill bill = billService.getById(dto.getBillIds().get(0)); |
| | | if (bill == null) { |
| | | throw new ServiceException("账单不存在"); |
| | | } |
| | | //计算欠费金额:租金+违约金-实收金额 |
| | | long rent = caculateRentFee(bill); |
| | | if (rent==0){ |
| | | throw new ServiceException("该订单已缴费"); |
| | | } |
| | | if (rent>dto.getAmount()){ |
| | | throw new ServiceException("支付金额超过了账单欠费金额"); |
| | | } |
| | | |
| | | TPayOrder order = new TPayOrder(); |
| | | order.setId(OrderNos.getDid(32)); |
| | | order.setAmount(dto.getAmount()); |
| | | order.setUserId(user.getId()); |
| | | order.setPhone(user.getPhone()); |
| | | order.setUserName(user.getResidentName()); |
| | | save(order); |
| | | TOrderBill tOrderBill = new TOrderBill(); |
| | | tOrderBill.setBillId(bill.getId()); |
| | | tOrderBill.setOrderNo(order.getId()); |
| | | tOrderBillService.save(tOrderBill); |
| | | resp.setAmount(dto.getAmount()); |
| | | resp.setOrderNo(order.getId()); |
| | | resp.setAppletUrl(createAppletUrl(order.getId())); |
| | | return resp; |
| | | } |
| | | List<TOrderBill> orderBills = new ArrayList<>(); |
| | | String orderNo = OrderNos.getDid(32); |
| | | List<TBill> bills = dto.getBillIds().stream().map(id -> { |
| | | TBill bill = billService.getById(id); |
| | | if (bill == null) { |
| | | throw new ServiceException("billId:" + id + "不存在"); |
| | | } |
| | | orderBills.add(new TOrderBill(orderNo,bill.getId())); |
| | | return bill; |
| | | }).collect(Collectors.toList()); |
| | | long sumRent = bills.stream().mapToLong((bill) -> caculateRentFee(bill)).sum(); |
| | | if (sumRent==0){ |
| | | throw new ServiceException("账单已缴费"); |
| | | } |
| | | if (dto.getAmount()>sumRent){ |
| | | throw new ServiceException("支付金额超过所选账单欠费金额"); |
| | | } |
| | | TPayOrder order = new TPayOrder(); |
| | | order.setId(orderNo); |
| | | order.setAmount(dto.getAmount()); |
| | | order.setUserId(user.getId()); |
| | | order.setPhone(user.getPhone()); |
| | | order.setUserName(user.getResidentName()); |
| | | save(order); |
| | | tOrderBillService.saveBatch(orderBills); |
| | | resp.setAmount(dto.getAmount()); |
| | | resp.setOrderNo(orderNo); |
| | | resp.setAppletUrl(createAppletUrl(orderNo)); |
| | | return resp; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.vo; |
| | | |
| | | import com.ruoyi.system.model.TItem; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "维修物品VO") |
| | | public class TItemVO extends TItem { |
| | | |
| | | @ApiModelProperty(value = "分类名称") |
| | | private String typeName; |
| | | |
| | | } |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.ruoyi.system.mapper.TBannerMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.system.model.TBanner"> |
| | | <id column="id" property="id" /> |
| | | <result column="pictures" property="pictures" /> |
| | | <result column="sort_by" property="sortBy" /> |
| | | <result column="create_time" property="createTime" /> |
| | | <result column="update_time" property="updateTime" /> |
| | | <result column="create_by" property="createBy" /> |
| | | <result column="update_by" property="updateBy" /> |
| | | <result column="disabled" property="disabled" /> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, pictures, sort_by, create_time, update_time, create_by, update_by, disabled |
| | | </sql> |
| | | <select id="pageList" resultType="com.ruoyi.system.model.TBanner"> |
| | | select |
| | | <include refid="Base_Column_List"/> |
| | | from t_banner |
| | | where disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()} |
| | | order by sort_by, create_time desc |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.system.model.TBill"> |
| | | <id column="id" property="id" /> |
| | | <result column="contract_id" property="contractId" /> |
| | | <result column="contract_number" property="contractNumber" /> |
| | | <result column="payable_fees_money" property="payableFeesMoney" /> |
| | | <result column="payable_fees_time" property="payableFeesTime" /> |
| | | <result column="pay_fees_status" property="payFeesStatus" /> |
| | |
| | | <result column="start_time" property="startTime" /> |
| | | <result column="end_time" property="endTime" /> |
| | | <result column="bank_serial_number" property="bankSerialNumber" /> |
| | | <result column="actual_money" property="actualMoney" /> |
| | | <result column="outstanding_money" property="outstandingMoney" /> |
| | | <result column="voucher" property="voucher" /> |
| | | <result column="create_time" property="createTime" /> |
| | | <result column="update_time" property="updateTime" /> |
| | |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, contract_id, payable_fees_money, payable_fees_time, pay_fees_status, pay_fees_money, pay_fees_time, pay_fees_type, bill_type, over_days, payable_fees_penalty, start_time, end_time, bank_serial_number, actual_money, voucher, create_time, update_time, create_by, update_by, disabled |
| | | id, contract_id,contract_number, payable_fees_money, payable_fees_time, pay_fees_status, pay_fees_money, pay_fees_time, pay_fees_type, bill_type, over_days, payable_fees_penalty, start_time, end_time, bank_serial_number, outstanding_money, voucher, create_time, update_time, create_by, update_by, disabled |
| | | </sql> |
| | | |
| | | <select id="page" resultType="com.ruoyi.system.dto.TBillDto"> |
| | | SELECT |
| | | b.*, |
| | | t.resident_name as residentName, |
| | | t.phone, |
| | | t.account |
| | | FROM |
| | | t_bill b |
| | | LEFT JOIN t_contract c ON c.contract_number = b.contract_number |
| | | LEFT JOIN t_tenant t ON t.id = c.tenant_id |
| | | <where> |
| | | <if test="query.payFeesStatus != null"> |
| | | and b.pay_fees_status = #{query.payFeesStatus} |
| | | </if> |
| | | <if test="query.phone != null and query.phone !=''"> |
| | | and t.phone = #{query.phone} |
| | | </if> |
| | | <if test="query.residentName != null and query.residentName !=''"> |
| | | and t.resident_name like concat('%',#{query.residentName},'%') |
| | | </if> |
| | | <if test="query.contractNumber != null and query.contractNumber !=''"> |
| | | and b.contract_number = #{contractNumber} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | </mapper> |
| | |
| | | SELECT <include refid="Base_Column_List"></include> |
| | | FROM t_fault_area_dic |
| | | WHERE disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()} |
| | | ORDER BY create_time DESC |
| | | ORDER BY sort_by,create_time DESC |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | <include refid="Base_Column_List"/> |
| | | from t_fault_describe_dic |
| | | where disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()} |
| | | ORDER BY create_time DESC |
| | | ORDER BY sort_by,create_time DESC |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | <result column="release_time" property="releaseTime" /> |
| | | <result column="content" property="content" /> |
| | | <result column="attachment" property="attachment" /> |
| | | <result column="attachment_name" property="attachmentName" /> |
| | | <result column="create_time" property="createTime" /> |
| | | <result column="update_time" property="updateTime" /> |
| | | <result column="create_by" property="createBy" /> |
| | |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, title_name, sort_by, info_source, release_time, content, attachment, create_time, update_time, create_by, update_by, disabled |
| | | id, title_name, sort_by, info_source, release_time, content, attachment,attachment_name, create_time, update_time, create_by, update_by, disabled |
| | | </sql> |
| | | <select id="pageList" resultType="com.ruoyi.system.model.TInformation"> |
| | | select |
| | | <include refid="Base_Column_List"/> |
| | | from t_information |
| | | <where> |
| | | <if test="query.titleName != null and query.titleName != ''"> |
| | | and title_name like concat('%',#{query.titleName},'%') |
| | | </if> |
| | | AND disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()} |
| | | </where> |
| | | ORDER BY sort_by,create_time DESC |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | <sql id="Base_Column_List"> |
| | | id, type_id, item_name, sort_by, pictures, create_time, update_time, create_by, update_by, disabled |
| | | </sql> |
| | | <select id="pageList" resultType="com.ruoyi.system.vo.TItemVO"> |
| | | select |
| | | t.id, t.type_id, t.item_name, t.sort_by, t.pictures, t.create_time, t.update_time, t.create_by, t.update_by, t.disabled |
| | | tt.type_name |
| | | from t_item t |
| | | left join t_item_type tt on t.type_id = tt.id |
| | | <where> |
| | | <if test="query.itemName != null and query.itemName != ''"> |
| | | and t.item_name like concat('%', #{query.itemName}, '%') |
| | | </if> |
| | | <if test="query.typeId != null and query.typeId != ''"> |
| | | and t.type_id = #{query.typeId} |
| | | </if> |
| | | and t.disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()} |
| | | </where> |
| | | order by t.sort_by, t.create_time desc |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | <sql id="Base_Column_List"> |
| | | id, type_name, sort_by, create_time, update_time, create_by, update_by, disabled |
| | | </sql> |
| | | <select id="pageList" resultType="com.ruoyi.system.model.TItemType"> |
| | | select |
| | | <include refid="Base_Column_List"/> |
| | | from t_item_type |
| | | where disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()} |
| | | ORDER BY sort_by,create_time DESC |
| | | </select> |
| | | |
| | | </mapper> |