租电订单

This commit is contained in:
19173159168
2025-08-18 23:36:15 +08:00
parent 8a45487020
commit d25251405c
15 changed files with 766 additions and 59 deletions

View File

@ -0,0 +1,127 @@
package com.ruoyi.baseUser.controller;
import java.util.List;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.baseUser.domain.ZcBaseWalletChange;
import com.ruoyi.baseUser.service.IZcBaseWalletChangeService;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 钱包变更记录Controller
*
* @author ruoyi
* @date 2025-08-16
*/
@Controller
@RequestMapping("/baseUser/walletChange")
public class ZcBaseWalletChangeController extends BaseController
{
private String prefix = "baseUser/walletChange";
@Autowired
private IZcBaseWalletChangeService zcBaseWalletChangeService;
@RequiresPermissions("baseUser:walletChange:view")
@GetMapping()
public String walletChange()
{
return prefix + "/walletChange";
}
/**
* 查询钱包变更记录列表
*/
@RequiresPermissions("baseUser:walletChange:list")
@PostMapping("/list")
@ResponseBody
public TableDataInfo list(ZcBaseWalletChange zcBaseWalletChange)
{
startPage();
List<ZcBaseWalletChange> list = zcBaseWalletChangeService.selectZcBaseWalletChangeList(zcBaseWalletChange);
return getDataTable(list);
}
/**
* 导出钱包变更记录列表
*/
@RequiresPermissions("baseUser:walletChange:export")
@Log(title = "钱包变更记录", businessType = BusinessType.EXPORT)
@PostMapping("/export")
@ResponseBody
public AjaxResult export(ZcBaseWalletChange zcBaseWalletChange)
{
List<ZcBaseWalletChange> list = zcBaseWalletChangeService.selectZcBaseWalletChangeList(zcBaseWalletChange);
ExcelUtil<ZcBaseWalletChange> util = new ExcelUtil<ZcBaseWalletChange>(ZcBaseWalletChange.class);
return util.exportExcel(list, "钱包变更记录数据");
}
/**
* 新增钱包变更记录
*/
@GetMapping("/add")
public String add()
{
return prefix + "/add";
}
/**
* 新增保存钱包变更记录
*/
@RequiresPermissions("baseUser:walletChange:add")
@Log(title = "钱包变更记录", businessType = BusinessType.INSERT)
@PostMapping("/add")
@ResponseBody
public AjaxResult addSave(ZcBaseWalletChange zcBaseWalletChange)
{
return toAjax(zcBaseWalletChangeService.insertZcBaseWalletChange(zcBaseWalletChange));
}
/**
* 修改钱包变更记录
*/
@RequiresPermissions("baseUser:walletChange:edit")
@GetMapping("/edit/{id}")
public String edit(@PathVariable("id") Long id, ModelMap mmap)
{
ZcBaseWalletChange zcBaseWalletChange = zcBaseWalletChangeService.selectZcBaseWalletChangeById(id);
mmap.put("zcBaseWalletChange", zcBaseWalletChange);
return prefix + "/edit";
}
/**
* 修改保存钱包变更记录
*/
@RequiresPermissions("baseUser:walletChange:edit")
@Log(title = "钱包变更记录", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
@ResponseBody
public AjaxResult editSave(ZcBaseWalletChange zcBaseWalletChange)
{
return toAjax(zcBaseWalletChangeService.updateZcBaseWalletChange(zcBaseWalletChange));
}
/**
* 删除钱包变更记录
*/
@RequiresPermissions("baseUser:walletChange:remove")
@Log(title = "钱包变更记录", businessType = BusinessType.DELETE)
@PostMapping( "/remove")
@ResponseBody
public AjaxResult remove(String ids)
{
return toAjax(zcBaseWalletChangeService.deleteZcBaseWalletChangeByIds(ids));
}
}

View File

@ -7,6 +7,7 @@ import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import org.springframework.data.annotation.Transient;
/**
* 钱包变更记录对象 zc_base_wallet_change
@ -22,15 +23,19 @@ public class ZcBaseWalletChange extends BaseEntity
private Long id;
/** 用户id */
@Excel(name = "用户id")
private Long userId;
@Transient
@Excel(name = "用户")
private String userName;
/** 变更类型 */
@Excel(name = "变更类型")
@Excel(name = "变更类型", dictType = "key_wallet_change_type")
private String changeType;
/** 支付类型 */
@Excel(name = "支付类型")
@Excel(name = "支付类型", dictType = "key_wallet_pay_type")
private String payType;
/** 变更时间 */
@ -72,7 +77,15 @@ public class ZcBaseWalletChange extends BaseEntity
this.changeType = changeType;
}
public String getChangeType()
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getChangeType()
{
return changeType;
}

View File

@ -0,0 +1,61 @@
package com.ruoyi.baseUser.mapper;
import java.util.List;
import com.ruoyi.baseUser.domain.ZcBaseWalletChange;
/**
* 钱包变更记录Mapper接口
*
* @author ruoyi
* @date 2025-08-16
*/
public interface ZcBaseWalletChangeMapper
{
/**
* 查询钱包变更记录
*
* @param id 钱包变更记录主键
* @return 钱包变更记录
*/
public ZcBaseWalletChange selectZcBaseWalletChangeById(Long id);
/**
* 查询钱包变更记录列表
*
* @param zcBaseWalletChange 钱包变更记录
* @return 钱包变更记录集合
*/
public List<ZcBaseWalletChange> selectZcBaseWalletChangeList(ZcBaseWalletChange zcBaseWalletChange);
/**
* 新增钱包变更记录
*
* @param zcBaseWalletChange 钱包变更记录
* @return 结果
*/
public int insertZcBaseWalletChange(ZcBaseWalletChange zcBaseWalletChange);
/**
* 修改钱包变更记录
*
* @param zcBaseWalletChange 钱包变更记录
* @return 结果
*/
public int updateZcBaseWalletChange(ZcBaseWalletChange zcBaseWalletChange);
/**
* 删除钱包变更记录
*
* @param id 钱包变更记录主键
* @return 结果
*/
public int deleteZcBaseWalletChangeById(Long id);
/**
* 批量删除钱包变更记录
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteZcBaseWalletChangeByIds(String[] ids);
}

View File

@ -0,0 +1,61 @@
package com.ruoyi.baseUser.service;
import java.util.List;
import com.ruoyi.baseUser.domain.ZcBaseWalletChange;
/**
* 钱包变更记录Service接口
*
* @author ruoyi
* @date 2025-08-16
*/
public interface IZcBaseWalletChangeService
{
/**
* 查询钱包变更记录
*
* @param id 钱包变更记录主键
* @return 钱包变更记录
*/
public ZcBaseWalletChange selectZcBaseWalletChangeById(Long id);
/**
* 查询钱包变更记录列表
*
* @param zcBaseWalletChange 钱包变更记录
* @return 钱包变更记录集合
*/
public List<ZcBaseWalletChange> selectZcBaseWalletChangeList(ZcBaseWalletChange zcBaseWalletChange);
/**
* 新增钱包变更记录
*
* @param zcBaseWalletChange 钱包变更记录
* @return 结果
*/
public int insertZcBaseWalletChange(ZcBaseWalletChange zcBaseWalletChange);
/**
* 修改钱包变更记录
*
* @param zcBaseWalletChange 钱包变更记录
* @return 结果
*/
public int updateZcBaseWalletChange(ZcBaseWalletChange zcBaseWalletChange);
/**
* 批量删除钱包变更记录
*
* @param ids 需要删除的钱包变更记录主键集合
* @return 结果
*/
public int deleteZcBaseWalletChangeByIds(String ids);
/**
* 删除钱包变更记录信息
*
* @param id 钱包变更记录主键
* @return 结果
*/
public int deleteZcBaseWalletChangeById(Long id);
}

View File

@ -0,0 +1,97 @@
package com.ruoyi.baseUser.service.impl;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.baseUser.mapper.ZcBaseWalletChangeMapper;
import com.ruoyi.baseUser.domain.ZcBaseWalletChange;
import com.ruoyi.baseUser.service.IZcBaseWalletChangeService;
import com.ruoyi.common.core.text.Convert;
/**
* 钱包变更记录Service业务层处理
*
* @author ruoyi
* @date 2025-08-16
*/
@Service
public class ZcBaseWalletChangeServiceImpl implements IZcBaseWalletChangeService
{
@Autowired
private ZcBaseWalletChangeMapper zcBaseWalletChangeMapper;
/**
* 查询钱包变更记录
*
* @param id 钱包变更记录主键
* @return 钱包变更记录
*/
@Override
public ZcBaseWalletChange selectZcBaseWalletChangeById(Long id)
{
return zcBaseWalletChangeMapper.selectZcBaseWalletChangeById(id);
}
/**
* 查询钱包变更记录列表
*
* @param zcBaseWalletChange 钱包变更记录
* @return 钱包变更记录
*/
@Override
public List<ZcBaseWalletChange> selectZcBaseWalletChangeList(ZcBaseWalletChange zcBaseWalletChange)
{
return zcBaseWalletChangeMapper.selectZcBaseWalletChangeList(zcBaseWalletChange);
}
/**
* 新增钱包变更记录
*
* @param zcBaseWalletChange 钱包变更记录
* @return 结果
*/
@Override
public int insertZcBaseWalletChange(ZcBaseWalletChange zcBaseWalletChange)
{
zcBaseWalletChange.setCreateTime(DateUtils.getNowDate());
return zcBaseWalletChangeMapper.insertZcBaseWalletChange(zcBaseWalletChange);
}
/**
* 修改钱包变更记录
*
* @param zcBaseWalletChange 钱包变更记录
* @return 结果
*/
@Override
public int updateZcBaseWalletChange(ZcBaseWalletChange zcBaseWalletChange)
{
zcBaseWalletChange.setUpdateTime(DateUtils.getNowDate());
return zcBaseWalletChangeMapper.updateZcBaseWalletChange(zcBaseWalletChange);
}
/**
* 批量删除钱包变更记录
*
* @param ids 需要删除的钱包变更记录主键
* @return 结果
*/
@Override
public int deleteZcBaseWalletChangeByIds(String ids)
{
return zcBaseWalletChangeMapper.deleteZcBaseWalletChangeByIds(Convert.toStrArray(ids));
}
/**
* 删除钱包变更记录信息
*
* @param id 钱包变更记录主键
* @return 结果
*/
@Override
public int deleteZcBaseWalletChangeById(Long id)
{
return zcBaseWalletChangeMapper.deleteZcBaseWalletChangeById(id);
}
}

View File

@ -36,8 +36,9 @@ public class ZcOrderSubController extends BaseController
@RequiresPermissions("orders:orderSub:view")
@GetMapping()
public String orderSub()
public String orderSub(ModelMap mmap, ZcOrderSub zcOrderSub)
{
mmap.put("zcOrderSub", zcOrderSub);
return prefix + "/orderSub";
}

View File

@ -22,15 +22,14 @@ public class ZcOrderSub extends BaseEntity
private Long suborderId;
/** 关联的订单ID外键 */
@Excel(name = "关联的订单ID", readConverterExp = "外=键")
private Long orderId;
/** 子订单编号 */
@Excel(name = "订单编号")
@Excel(name = "订单编号")
private String suborderNo;
/** 子订单类型(首租、续租、逾期、押金、租电等) */
@Excel(name = "订单类型", readConverterExp = "首=租、续租、逾期、押金、租电等")
@Excel(name = "订单类型", dictType = "key_order_suborder_type")
private String suborderType;
/** 订单金额 */
@ -38,7 +37,7 @@ public class ZcOrderSub extends BaseEntity
private BigDecimal amount;
/** 支付方式 */
@Excel(name = "支付方式")
@Excel(name = "支付方式",dictType = "key_order_payment_method")
private String paymentMethod;
/** 车架/电池编号 */
@ -46,8 +45,8 @@ public class ZcOrderSub extends BaseEntity
private String vinBatteryNo;
/** 订单产生时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "订单产生时间", width = 30, dateFormat = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "订单产生时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date createdAt;
/** 支付ID */
@ -55,8 +54,8 @@ public class ZcOrderSub extends BaseEntity
private String paymentId;
/** 实际支付时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "实际支付时间", width = 30, dateFormat = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "实际支付时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date paidAt;
/** 删除标志0代表存在 2代表删除 */