订单分润统计
This commit is contained in:
@ -0,0 +1,153 @@
|
||||
package com.ruoyi.orders.controller;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.ruoyi.common.constant.UserConstants;
|
||||
import com.ruoyi.operation.domain.Company;
|
||||
import com.ruoyi.operation.service.ICompanyService;
|
||||
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.orders.domain.ZcOrderDistrib;
|
||||
import com.ruoyi.orders.service.IZcOrderDistribService;
|
||||
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-20
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/orders/distrib")
|
||||
public class ZcOrderDistribController extends BaseController
|
||||
{
|
||||
private String prefix = "orders/distrib";
|
||||
|
||||
@Autowired
|
||||
private IZcOrderDistribService zcOrderDistribService;
|
||||
@Autowired
|
||||
private ICompanyService companyService;
|
||||
|
||||
@RequiresPermissions("orders:distrib:view")
|
||||
@GetMapping()
|
||||
public String distrib(ModelMap mmap, ZcOrderDistrib zcOrderDistrib)
|
||||
{
|
||||
List<Company> companyList = companyService.getCompanyList(new Company(),getSysUser()); // 获取运营商列表
|
||||
mmap.put("companyList", companyList); // 将运营商列表传递到前端
|
||||
mmap.put("zcOrderDistrib", zcOrderDistrib);
|
||||
return prefix + "/distrib";
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询订单分成统计列表
|
||||
*/
|
||||
@RequiresPermissions("orders:distrib:list")
|
||||
@PostMapping("/list")
|
||||
@ResponseBody
|
||||
public TableDataInfo list(ZcOrderDistrib zcOrderDistrib)
|
||||
{
|
||||
startPage();
|
||||
// 运营者账号,只能查询所属商户数据
|
||||
if(UserConstants.USER_TYPE_02 .equals(getSysUser().getUserType())){
|
||||
zcOrderDistrib.setCompanyId(getSysUser().getGroupId());
|
||||
}
|
||||
|
||||
List<ZcOrderDistrib> list = zcOrderDistribService.selectZcOrderDistribList(zcOrderDistrib);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@PostMapping("/summary")
|
||||
@ResponseBody
|
||||
public Map<String, Object> getSummaryStats(ZcOrderDistrib zcOrderDistrib) {
|
||||
Map<String, Object> summary = zcOrderDistribService.getSummaryStats(zcOrderDistrib);
|
||||
return summary;
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出订单分成统计列表
|
||||
*/
|
||||
@RequiresPermissions("orders:distrib:export")
|
||||
@Log(title = "订单分成统计", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
@ResponseBody
|
||||
public AjaxResult export(ZcOrderDistrib zcOrderDistrib)
|
||||
{
|
||||
// 运营者账号,只能查询所属商户数据
|
||||
if(UserConstants.USER_TYPE_02 .equals(getSysUser().getUserType())){
|
||||
zcOrderDistrib.setCompanyId(getSysUser().getGroupId());
|
||||
}
|
||||
List<ZcOrderDistrib> list = zcOrderDistribService.selectZcOrderDistribList(zcOrderDistrib);
|
||||
ExcelUtil<ZcOrderDistrib> util = new ExcelUtil<ZcOrderDistrib>(ZcOrderDistrib.class);
|
||||
return util.exportExcel(list, "订单分成统计数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增订单分成统计
|
||||
*/
|
||||
@GetMapping("/add")
|
||||
public String add()
|
||||
{
|
||||
return prefix + "/add";
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增保存订单分成统计
|
||||
*/
|
||||
@RequiresPermissions("orders:distrib:add")
|
||||
@Log(title = "订单分成统计", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/add")
|
||||
@ResponseBody
|
||||
public AjaxResult addSave(ZcOrderDistrib zcOrderDistrib)
|
||||
{
|
||||
return toAjax(zcOrderDistribService.insertZcOrderDistrib(zcOrderDistrib));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改订单分成统计
|
||||
*/
|
||||
@RequiresPermissions("orders:distrib:edit")
|
||||
@GetMapping("/edit/{id}")
|
||||
public String edit(@PathVariable("id") Long id, ModelMap mmap)
|
||||
{
|
||||
ZcOrderDistrib zcOrderDistrib = zcOrderDistribService.selectZcOrderDistribById(id);
|
||||
mmap.put("zcOrderDistrib", zcOrderDistrib);
|
||||
return prefix + "/edit";
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改保存订单分成统计
|
||||
*/
|
||||
@RequiresPermissions("orders:distrib:edit")
|
||||
@Log(title = "订单分成统计", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/edit")
|
||||
@ResponseBody
|
||||
public AjaxResult editSave(ZcOrderDistrib zcOrderDistrib)
|
||||
{
|
||||
return toAjax(zcOrderDistribService.updateZcOrderDistrib(zcOrderDistrib));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除订单分成统计
|
||||
*/
|
||||
@RequiresPermissions("orders:distrib:remove")
|
||||
@Log(title = "订单分成统计", businessType = BusinessType.DELETE)
|
||||
@PostMapping( "/remove")
|
||||
@ResponseBody
|
||||
public AjaxResult remove(String ids)
|
||||
{
|
||||
return toAjax(zcOrderDistribService.deleteZcOrderDistribByIds(ids));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,172 @@
|
||||
package com.ruoyi.orders.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
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_order_distrib
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-08-20
|
||||
*/
|
||||
public class ZcOrderDistrib extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** ID(主键) */
|
||||
private Long id;
|
||||
|
||||
/** 关联的订单ID(外键) */
|
||||
@Excel(name = "关联的订单ID", readConverterExp = "外=键")
|
||||
private Long orderId;
|
||||
|
||||
/** 订单编号 */
|
||||
@Excel(name = "订单编号")
|
||||
private String orderNo;
|
||||
|
||||
/** 运营商id */
|
||||
private Long companyId;
|
||||
|
||||
/** 门店 */
|
||||
private Long storeId;
|
||||
|
||||
|
||||
/** 引荐人id */
|
||||
private Long referralUserId;
|
||||
|
||||
/** 分配类型:company运营商,store门店,referral推荐人,platform平台 */
|
||||
private String distribType;
|
||||
|
||||
/** 分配比例 */
|
||||
private BigDecimal distribRate;
|
||||
|
||||
/** 分配金额 */
|
||||
private BigDecimal distribAmount;
|
||||
|
||||
/** 删除标志(0代表存在 2代表删除) */
|
||||
private String delFlag;
|
||||
|
||||
@Transient
|
||||
private ZcOrderMain zcOrderMain;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setOrderId(Long orderId)
|
||||
{
|
||||
this.orderId = orderId;
|
||||
}
|
||||
|
||||
public Long getOrderId()
|
||||
{
|
||||
return orderId;
|
||||
}
|
||||
public void setOrderNo(String orderNo)
|
||||
{
|
||||
this.orderNo = orderNo;
|
||||
}
|
||||
|
||||
public String getOrderNo()
|
||||
{
|
||||
return orderNo;
|
||||
}
|
||||
public void setCompanyId(Long companyId)
|
||||
{
|
||||
this.companyId = companyId;
|
||||
}
|
||||
|
||||
public Long getCompanyId()
|
||||
{
|
||||
return companyId;
|
||||
}
|
||||
public void setStoreId(Long storeId)
|
||||
{
|
||||
this.storeId = storeId;
|
||||
}
|
||||
|
||||
public Long getStoreId()
|
||||
{
|
||||
return storeId;
|
||||
}
|
||||
public void setReferralUserId(Long referralUserId)
|
||||
{
|
||||
this.referralUserId = referralUserId;
|
||||
}
|
||||
|
||||
public Long getReferralUserId()
|
||||
{
|
||||
return referralUserId;
|
||||
}
|
||||
public void setDistribType(String distribType)
|
||||
{
|
||||
this.distribType = distribType;
|
||||
}
|
||||
|
||||
public String getDistribType()
|
||||
{
|
||||
return distribType;
|
||||
}
|
||||
public void setDistribRate(BigDecimal distribRate)
|
||||
{
|
||||
this.distribRate = distribRate;
|
||||
}
|
||||
|
||||
public BigDecimal getDistribRate()
|
||||
{
|
||||
return distribRate;
|
||||
}
|
||||
public void setDistribAmount(BigDecimal distribAmount)
|
||||
{
|
||||
this.distribAmount = distribAmount;
|
||||
}
|
||||
|
||||
public BigDecimal getDistribAmount()
|
||||
{
|
||||
return distribAmount;
|
||||
}
|
||||
public void setDelFlag(String delFlag)
|
||||
{
|
||||
this.delFlag = delFlag;
|
||||
}
|
||||
|
||||
public String getDelFlag()
|
||||
{
|
||||
return delFlag;
|
||||
}
|
||||
|
||||
public ZcOrderMain getZcOrderMain() {
|
||||
return zcOrderMain;
|
||||
}
|
||||
|
||||
public void setZcOrderMain(ZcOrderMain zcOrderMain) {
|
||||
this.zcOrderMain = zcOrderMain;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("orderId", getOrderId())
|
||||
.append("orderNo", getOrderNo())
|
||||
.append("companyId", getCompanyId())
|
||||
.append("storeId", getStoreId())
|
||||
.append("referralUserId", getReferralUserId())
|
||||
.append("distribType", getDistribType())
|
||||
.append("distribRate", getDistribRate())
|
||||
.append("distribAmount", getDistribAmount())
|
||||
.append("delFlag", getDelFlag())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@ -61,6 +61,14 @@ public class ZcOrderSub extends BaseEntity
|
||||
/** 删除标志(0代表存在 2代表删除) */
|
||||
private String delFlag;
|
||||
|
||||
@Excel(name = "支付状态")
|
||||
private String payStatus;
|
||||
/**平台支付流水号*/
|
||||
@Excel(name = "平台支付流水号")
|
||||
private String transactionId;
|
||||
|
||||
private Long bOrderId;
|
||||
|
||||
public void setSuborderId(Long suborderId)
|
||||
{
|
||||
this.suborderId = suborderId;
|
||||
@ -161,6 +169,30 @@ public class ZcOrderSub extends BaseEntity
|
||||
return delFlag;
|
||||
}
|
||||
|
||||
public String getPayStatus() {
|
||||
return payStatus;
|
||||
}
|
||||
|
||||
public void setPayStatus(String payStatus) {
|
||||
this.payStatus = payStatus;
|
||||
}
|
||||
|
||||
public String getTransactionId() {
|
||||
return transactionId;
|
||||
}
|
||||
|
||||
public void setTransactionId(String transactionId) {
|
||||
this.transactionId = transactionId;
|
||||
}
|
||||
|
||||
public Long getbOrderId() {
|
||||
return bOrderId;
|
||||
}
|
||||
|
||||
public void setbOrderId(Long bOrderId) {
|
||||
this.bOrderId = bOrderId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
|
||||
@ -0,0 +1,70 @@
|
||||
package com.ruoyi.orders.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.ruoyi.orders.domain.ZcOrderDistrib;
|
||||
|
||||
/**
|
||||
* 订单分成统计Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-08-20
|
||||
*/
|
||||
public interface ZcOrderDistribMapper
|
||||
{
|
||||
/**
|
||||
* 查询订单分成统计
|
||||
*
|
||||
* @param id 订单分成统计主键
|
||||
* @return 订单分成统计
|
||||
*/
|
||||
public ZcOrderDistrib selectZcOrderDistribById(Long id);
|
||||
|
||||
/**
|
||||
* 查询订单分成统计列表
|
||||
*
|
||||
* @param zcOrderDistrib 订单分成统计
|
||||
* @return 订单分成统计集合
|
||||
*/
|
||||
public List<ZcOrderDistrib> selectZcOrderDistribList(ZcOrderDistrib zcOrderDistrib);
|
||||
|
||||
/**
|
||||
* 查询汇总统计信息
|
||||
* @param zcOrderDistrib 查询条件
|
||||
* @return 汇总统计结果
|
||||
*/
|
||||
Map<String, Object> selectZcOrderDistribSummary(ZcOrderDistrib zcOrderDistrib);
|
||||
|
||||
/**
|
||||
* 新增订单分成统计
|
||||
*
|
||||
* @param zcOrderDistrib 订单分成统计
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertZcOrderDistrib(ZcOrderDistrib zcOrderDistrib);
|
||||
|
||||
/**
|
||||
* 修改订单分成统计
|
||||
*
|
||||
* @param zcOrderDistrib 订单分成统计
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateZcOrderDistrib(ZcOrderDistrib zcOrderDistrib);
|
||||
|
||||
/**
|
||||
* 删除订单分成统计
|
||||
*
|
||||
* @param id 订单分成统计主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteZcOrderDistribById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除订单分成统计
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteZcOrderDistribByIds(String[] ids);
|
||||
}
|
||||
@ -0,0 +1,71 @@
|
||||
package com.ruoyi.orders.service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.ruoyi.orders.domain.ZcOrderDistrib;
|
||||
|
||||
/**
|
||||
* 订单分成统计Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-08-20
|
||||
*/
|
||||
public interface IZcOrderDistribService
|
||||
{
|
||||
/**
|
||||
* 查询订单分成统计
|
||||
*
|
||||
* @param id 订单分成统计主键
|
||||
* @return 订单分成统计
|
||||
*/
|
||||
public ZcOrderDistrib selectZcOrderDistribById(Long id);
|
||||
|
||||
/**
|
||||
* 查询订单分成统计列表
|
||||
*
|
||||
* @param zcOrderDistrib 订单分成统计
|
||||
* @return 订单分成统计集合
|
||||
*/
|
||||
public List<ZcOrderDistrib> selectZcOrderDistribList(ZcOrderDistrib zcOrderDistrib);
|
||||
|
||||
/**
|
||||
* 获取汇总统计信息
|
||||
* @param zcOrderDistrib 查询条件
|
||||
* @return 汇总统计结果
|
||||
*/
|
||||
Map<String, Object> getSummaryStats(ZcOrderDistrib zcOrderDistrib);
|
||||
|
||||
|
||||
/**
|
||||
* 新增订单分成统计
|
||||
*
|
||||
* @param zcOrderDistrib 订单分成统计
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertZcOrderDistrib(ZcOrderDistrib zcOrderDistrib);
|
||||
|
||||
/**
|
||||
* 修改订单分成统计
|
||||
*
|
||||
* @param zcOrderDistrib 订单分成统计
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateZcOrderDistrib(ZcOrderDistrib zcOrderDistrib);
|
||||
|
||||
/**
|
||||
* 批量删除订单分成统计
|
||||
*
|
||||
* @param ids 需要删除的订单分成统计主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteZcOrderDistribByIds(String ids);
|
||||
|
||||
/**
|
||||
* 删除订单分成统计信息
|
||||
*
|
||||
* @param id 订单分成统计主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteZcOrderDistribById(Long id);
|
||||
}
|
||||
@ -0,0 +1,104 @@
|
||||
package com.ruoyi.orders.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.orders.mapper.ZcOrderDistribMapper;
|
||||
import com.ruoyi.orders.domain.ZcOrderDistrib;
|
||||
import com.ruoyi.orders.service.IZcOrderDistribService;
|
||||
import com.ruoyi.common.core.text.Convert;
|
||||
|
||||
/**
|
||||
* 订单分成统计Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-08-20
|
||||
*/
|
||||
@Service
|
||||
public class ZcOrderDistribServiceImpl implements IZcOrderDistribService
|
||||
{
|
||||
@Autowired
|
||||
private ZcOrderDistribMapper zcOrderDistribMapper;
|
||||
|
||||
/**
|
||||
* 查询订单分成统计
|
||||
*
|
||||
* @param id 订单分成统计主键
|
||||
* @return 订单分成统计
|
||||
*/
|
||||
@Override
|
||||
public ZcOrderDistrib selectZcOrderDistribById(Long id)
|
||||
{
|
||||
return zcOrderDistribMapper.selectZcOrderDistribById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询订单分成统计列表
|
||||
*
|
||||
* @param zcOrderDistrib 订单分成统计
|
||||
* @return 订单分成统计
|
||||
*/
|
||||
@Override
|
||||
public List<ZcOrderDistrib> selectZcOrderDistribList(ZcOrderDistrib zcOrderDistrib)
|
||||
{
|
||||
return zcOrderDistribMapper.selectZcOrderDistribList(zcOrderDistrib);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getSummaryStats(ZcOrderDistrib zcOrderDistrib) {
|
||||
return zcOrderDistribMapper.selectZcOrderDistribSummary(zcOrderDistrib);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增订单分成统计
|
||||
*
|
||||
* @param zcOrderDistrib 订单分成统计
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertZcOrderDistrib(ZcOrderDistrib zcOrderDistrib)
|
||||
{
|
||||
zcOrderDistrib.setCreateTime(DateUtils.getNowDate());
|
||||
return zcOrderDistribMapper.insertZcOrderDistrib(zcOrderDistrib);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改订单分成统计
|
||||
*
|
||||
* @param zcOrderDistrib 订单分成统计
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateZcOrderDistrib(ZcOrderDistrib zcOrderDistrib)
|
||||
{
|
||||
zcOrderDistrib.setUpdateTime(DateUtils.getNowDate());
|
||||
return zcOrderDistribMapper.updateZcOrderDistrib(zcOrderDistrib);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除订单分成统计
|
||||
*
|
||||
* @param ids 需要删除的订单分成统计主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteZcOrderDistribByIds(String ids)
|
||||
{
|
||||
return zcOrderDistribMapper.deleteZcOrderDistribByIds(Convert.toStrArray(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除订单分成统计信息
|
||||
*
|
||||
* @param id 订单分成统计主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteZcOrderDistribById(Long id)
|
||||
{
|
||||
return zcOrderDistribMapper.deleteZcOrderDistribById(id);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,203 @@
|
||||
<?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.orders.mapper.ZcOrderDistribMapper">
|
||||
|
||||
<resultMap type="ZcOrderDistrib" id="ZcOrderDistribResult" >
|
||||
<result property="id" column="id" />
|
||||
<result property="orderId" column="order_id" />
|
||||
<result property="orderNo" column="order_no" />
|
||||
<result property="companyId" column="company_id" />
|
||||
<result property="storeId" column="store_id" />
|
||||
<result property="referralUserId" column="referral_user_id" />
|
||||
<result property="distribType" column="distrib_type" />
|
||||
<result property="distribRate" column="distrib_rate" />
|
||||
<result property="distribAmount" column="distrib_amount" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
|
||||
<association property="zcOrderMain" javaType="ZcOrderMain">
|
||||
<result property="orderNo" column="main_order_no" />
|
||||
<result property="orderStatus" column="main_order_status" />
|
||||
<result property="operatorId" column="main_operator_id" />
|
||||
<result property="storeId" column="main_store_id" />
|
||||
<result property="vehicleId" column="main_vehicle_id" />
|
||||
<result property="carModelId" column="main_car_model_id" />
|
||||
<result property="customerId" column="main_customer_id" />
|
||||
<result property="customerName" column="main_customer_name" />
|
||||
<result property="customerPhone" column="main_customer_phone" />
|
||||
<result property="batteryType" column="main_battery_type" />
|
||||
<result property="rentalType" column="main_rental_type" />
|
||||
<result property="rentalDays" column="main_rental_days" />
|
||||
<result property="rentalPrice" column="main_rental_price" />
|
||||
<result property="depositPrice" column="main_deposit_price" />
|
||||
<result property="overdueFee" column="main_overdue_fee" />
|
||||
<result property="overdueType" column="main_overdue_type" />
|
||||
<result property="isDepositFree" column="main_is_deposit_free" />
|
||||
<result property="isAutoDeduct" column="main_is_auto_deduct" />
|
||||
<result property="firstOrderTime" column="main_first_order_time" />
|
||||
<result property="pickCarTime" column="main_pick_car_time" />
|
||||
<result property="startRentTime" column="main_start_rent_time" />
|
||||
<result property="endRentTime" column="main_end_rent_time" />
|
||||
<result property="reqEndRentTime" column="main_req_end_rent_time" />
|
||||
<result property="actEndRentTime" column="main_act_end_rent_time" />
|
||||
<result property="overdueDays" column="main_overdue_days" />
|
||||
<result property="renewalTimes" column="main_renewal_times" />
|
||||
<result property="chargeTimes" column="main_charge_times" />
|
||||
<result property="rentCarRuleId" column="main_rent_car_rule_id" />
|
||||
<result property="rentBatteyRuleId" column="main_rent_battey_rule_id" />
|
||||
<result property="damageAmount" column="main_damage_amount" />
|
||||
<result property="damageDesc" column="main_damage_desc" />
|
||||
<result property="orderAmount" column="main_order_amount" />
|
||||
<result property="overdueAmount" column="main_overdue_amount" />
|
||||
<result property="endOrderTime" column="main_end_order_time" />
|
||||
<result property="createTime" column="main_create_time" />
|
||||
<result property="updateTime" column="main_update_time" />
|
||||
<result property="operatorName" column="main_operator_name" />
|
||||
<result property="storeName" column="main_store_name" />
|
||||
<result property="licensePlate" column="main_license_plate" />
|
||||
</association>
|
||||
</resultMap>
|
||||
|
||||
|
||||
|
||||
<sql id="selectZcOrderDistribVo">
|
||||
select a.id, a.order_id, a.order_no, a.company_id, a.store_id, a.referral_user_id, a.distrib_type, a.distrib_rate, a.distrib_amount, a.del_flag, a.create_time, a.update_time,
|
||||
b.order_status as main_order_status, b.vehicle_id as main_vehicle_id, b.car_model_id as main_car_model_id, b.customer_id as main_customer_id, b.customer_name as main_customer_name, b.customer_phone as main_customer_phone,
|
||||
b.battery_type as main_battery_type, b.rental_type as main_rental_type, b.rental_days as main_rental_days, b.rental_price as main_rental_price, b.deposit_price as main_deposit_price, b.overdue_fee as main_overdue_fee,
|
||||
b.overdue_type as main_overdue_type, b.is_deposit_free as main_is_deposit_free, b.is_auto_deduct as main_is_auto_deduct, b.first_order_time as main_first_order_time, b.pick_car_time as main_pick_car_time, b.start_rent_time as main_start_rent_time,
|
||||
b.end_rent_time as main_end_rent_time, b.req_end_rent_time as main_req_end_rent_time, b.act_end_rent_time as main_act_end_rent_time, b.overdue_days as main_overdue_days, b.renewal_times as main_renewal_times, b.charge_times as main_charge_times,
|
||||
b.rent_car_rule_id as main_rent_car_rule_id, b.rent_battey_rule_id as main_rent_battey_rule_id, b.damage_amount as main_damage_amount,b.damage_desc as main_damage_desc, b.order_amount as main_order_amount, b.overdue_amount as main_overdue_amount,
|
||||
b.end_order_time as main_end_order_time, b.create_time as main_create_time, b.update_time as main_update_time ,
|
||||
c.company_name as main_operator_name,
|
||||
s.name as main_store_name,
|
||||
zc.license_plate as main_license_plate
|
||||
from zc_order_distrib a
|
||||
left join zc_order_main b on a.order_id = b.order_id
|
||||
left join zc_company c on c.id = a.company_id
|
||||
left join zc_company_store s on s.id = a.store_id
|
||||
left join zc_car zc on zc.id = b.vehicle_id
|
||||
</sql>
|
||||
|
||||
<select id="selectZcOrderDistribList" parameterType="ZcOrderDistrib" resultMap="ZcOrderDistribResult">
|
||||
<include refid="selectZcOrderDistribVo"/>
|
||||
<where>
|
||||
<if test="orderId != null "> and a.order_id = #{orderId}</if>
|
||||
<if test="orderNo != null and orderNo != ''"> and a.order_no = #{orderNo}</if>
|
||||
<if test="companyId != null "> and a.company_id = #{companyId}</if>
|
||||
<if test="referralUserId != null "> and a.referral_user_id = #{referralUserId}</if>
|
||||
<if test="distribType != null and distribType != ''"> and a.distrib_type = #{distribType}</if>
|
||||
<if test="distribRate != null "> and a.distrib_rate = #{distribRate}</if>
|
||||
<if test="distribAmount != null "> and a.distrib_amount = #{distribAmount}</if>
|
||||
<if test="params.beginFirstOrderTime != null and params.beginFirstOrderTime != ''"><!-- 开始时间检索 -->
|
||||
and date_format(b.first_order_time,'%y%m%d') >= date_format(#{params.beginFirstOrderTime},'%y%m%d')
|
||||
</if>
|
||||
<if test="params.endFirstOrderTime != null and params.endFirstOrderTime != ''"><!-- 结束时间检索 -->
|
||||
and date_format(b.first_order_time,'%y%m%d') <= date_format(#{params.endFirstOrderTime},'%y%m%d')
|
||||
</if>
|
||||
|
||||
<if test="zcOrderMain != null and zcOrderMain.storeName != null and zcOrderMain.storeName != '' "> and s.name = #{zcOrderMain.storeName}</if>
|
||||
<if test="zcOrderMain != null and zcOrderMain.licensePlate != null and zcOrderMain.licensePlate != '' "> and zc.license_plate = #{zcOrderMain.licensePlate}</if>
|
||||
</where>
|
||||
order by b.first_order_time desc
|
||||
</select>
|
||||
|
||||
|
||||
<!-- 汇总统计查询 -->
|
||||
<select id="selectZcOrderDistribSummary" parameterType="ZcOrderDistrib" resultType="map">
|
||||
SELECT
|
||||
COUNT(a.id) as orderCount,
|
||||
IFNULL(SUM(b.order_amount), 0) as totalOrderAmount,
|
||||
IFNULL(SUM(a.distrib_amount), 0) as totalDistribAmount
|
||||
FROM zc_order_distrib a
|
||||
LEFT JOIN zc_order_main b ON a.order_id = b.order_id
|
||||
LEFT JOIN zc_company c ON c.id = a.company_id
|
||||
LEFT JOIN zc_company_store s ON s.id = a.store_id
|
||||
LEFT JOIN zc_car zc ON zc.id = b.vehicle_id
|
||||
<where>
|
||||
<if test="orderId != null "> and a.order_id = #{orderId}</if>
|
||||
<if test="orderNo != null and orderNo != ''"> and a.order_no = #{orderNo}</if>
|
||||
<if test="companyId != null "> and a.company_id = #{companyId}</if>
|
||||
<if test="referralUserId != null "> and a.referral_user_id = #{referralUserId}</if>
|
||||
<if test="distribType != null and distribType != ''"> and a.distrib_type = #{distribType}</if>
|
||||
<if test="distribRate != null "> and a.distrib_rate = #{distribRate}</if>
|
||||
<if test="distribAmount != null "> and a.distrib_amount = #{distribAmount}</if>
|
||||
<if test="params.beginFirstOrderTime != null and params.beginFirstOrderTime != ''"><!-- 开始时间检索 -->
|
||||
and date_format(b.first_order_time,'%y%m%d') >= date_format(#{params.beginFirstOrderTime},'%y%m%d')
|
||||
</if>
|
||||
<if test="params.endFirstOrderTime != null and params.endFirstOrderTime != ''"><!-- 结束时间检索 -->
|
||||
and date_format(b.first_order_time,'%y%m%d') <= date_format(#{params.endFirstOrderTime},'%y%m%d')
|
||||
</if>
|
||||
<if test="zcOrderMain != null and zcOrderMain.storeName != null and zcOrderMain.storeName != '' "> and s.name = #{zcOrderMain.storeName}</if>
|
||||
<if test="zcOrderMain != null and zcOrderMain.licensePlate != null and zcOrderMain.licensePlate != '' "> and zc.license_plate = #{zcOrderMain.licensePlate}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectZcOrderDistribById" parameterType="Long" resultMap="ZcOrderDistribResult">
|
||||
<include refid="selectZcOrderDistribVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertZcOrderDistrib" parameterType="ZcOrderDistrib" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into zc_order_distrib
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="orderId != null">order_id,</if>
|
||||
<if test="orderNo != null and orderNo != ''">order_no,</if>
|
||||
<if test="companyId != null">company_id,</if>
|
||||
<if test="storeId != null">store_id,</if>
|
||||
<if test="referralUserId != null">referral_user_id,</if>
|
||||
<if test="distribType != null and distribType != ''">distrib_type,</if>
|
||||
<if test="distribRate != null">distrib_rate,</if>
|
||||
<if test="distribAmount != null">distrib_amount,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="orderId != null">#{orderId},</if>
|
||||
<if test="orderNo != null and orderNo != ''">#{orderNo},</if>
|
||||
<if test="companyId != null">#{companyId},</if>
|
||||
<if test="storeId != null">#{storeId},</if>
|
||||
<if test="referralUserId != null">#{referralUserId},</if>
|
||||
<if test="distribType != null and distribType != ''">#{distribType},</if>
|
||||
<if test="distribRate != null">#{distribRate},</if>
|
||||
<if test="distribAmount != null">#{distribAmount},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateZcOrderDistrib" parameterType="ZcOrderDistrib">
|
||||
update zc_order_distrib
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="orderId != null">order_id = #{orderId},</if>
|
||||
<if test="orderNo != null and orderNo != ''">order_no = #{orderNo},</if>
|
||||
<if test="companyId != null">company_id = #{companyId},</if>
|
||||
<if test="storeId != null">store_id = #{storeId},</if>
|
||||
<if test="referralUserId != null">referral_user_id = #{referralUserId},</if>
|
||||
<if test="distribType != null and distribType != ''">distrib_type = #{distribType},</if>
|
||||
<if test="distribRate != null">distrib_rate = #{distribRate},</if>
|
||||
<if test="distribAmount != null">distrib_amount = #{distribAmount},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteZcOrderDistribById" parameterType="Long">
|
||||
delete from zc_order_distrib where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteZcOrderDistribByIds" parameterType="String">
|
||||
delete from zc_order_distrib where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
@ -63,6 +63,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="createdAt" column="sub_created_at" />
|
||||
<result property="paymentId" column="sub_payment_id" />
|
||||
<result property="paidAt" column="sub_paid_at" />
|
||||
<result property="payStatus" column="sub_pay_status" />
|
||||
<result property="transactionId" column="sub_transaction_id" />
|
||||
<result property="remark" column="sub_remark" />
|
||||
<result property="delFlag" column="sub_del_flag" />
|
||||
<result property="createTime" column="sub_create_time" />
|
||||
@ -123,7 +125,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="params.beginFirstOrderTime != null and params.beginFirstOrderTime != ''"><!-- 开始时间检索 -->
|
||||
and date_format(a.first_order_time,'%y%m%d') >= date_format(#{params.beginFirstOrderTime},'%y%m%d')
|
||||
</if>
|
||||
<if test="params.endFirstOrderTime != null and params.endFirstOrderTime != ''"><!-- 结束时间检索 -->
|
||||
<if test="params.enstoreNamedFirstOrderTime != null and params.endFirstOrderTime != ''"><!-- 结束时间检索 -->
|
||||
and date_format(a.first_order_time,'%y%m%d') <= date_format(#{params.endFirstOrderTime},'%y%m%d')
|
||||
</if>
|
||||
</where>
|
||||
@ -132,7 +134,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
|
||||
<select id="selectZcOrderMainByOrderId" parameterType="Long" resultMap="ZcOrderMainZcOrderSubResult">
|
||||
select a.order_id, a.order_no, a.order_status, a.operator_id, a.store_id, a.vehicle_id, a.car_model_id, a.customer_id, a.customer_name, a.customer_phone, a.battery_type, a.rental_type, a.rental_days, a.rental_price, a.deposit_price, a.overdue_fee, a.overdue_type, a.is_deposit_free, a.is_auto_deduct, a.first_order_time, a.pick_car_time, a.start_rent_time, a.end_rent_time, a.req_end_rent_time, a.act_end_rent_time, a.overdue_days, a.renewal_times, a.charge_times, a.rent_car_rule_id, a.rent_battey_rule_id, a.damage_amount,a.damage_desc,a.order_amount, a.overdue_amount, a.end_order_time, a.del_flag, a.create_time, a.update_time,
|
||||
b.suborder_id as sub_suborder_id, b.order_id as sub_order_id, b.suborder_no as sub_suborder_no, b.suborder_type as sub_suborder_type, b.amount as sub_amount, b.payment_method as sub_payment_method, b.vin_battery_no as sub_vin_battery_no, b.created_at as sub_created_at, b.payment_id as sub_payment_id, b.paid_at as sub_paid_at, b.remark as sub_remark, b.del_flag as sub_del_flag, b.create_time as sub_create_time, b.update_time as sub_update_time,
|
||||
b.suborder_id as sub_suborder_id, b.order_id as sub_order_id, b.suborder_no as sub_suborder_no, b.suborder_type as sub_suborder_type, b.amount as sub_amount, b.payment_method as sub_payment_method, b.vin_battery_no as sub_vin_battery_no, b.created_at as sub_created_at, b.payment_id as sub_payment_id, b.paid_at as sub_paid_at, b.pay_status as sub_pay_status,b.transaction_id as sub_transaction_id, b.remark as sub_remark, b.del_flag as sub_del_flag, b.create_time as sub_create_time, b.update_time as sub_update_time,
|
||||
c.company_name as operator_name,s.name as store_name,zc.license_plate as license_plate,
|
||||
i.id as sub_id, i.order_id as sub_order_id, i.order_no as sub_order_no, i.img_type as sub_img_type, i.img_url as sub_img_url, i.create_time as sub_create_time, i.update_time as sub_update_time
|
||||
from zc_order_main a
|
||||
|
||||
@ -15,6 +15,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="createdAt" column="created_at" />
|
||||
<result property="paymentId" column="payment_id" />
|
||||
<result property="paidAt" column="paid_at" />
|
||||
<result property="payStatus" column="pay_status" />
|
||||
<result property="transactionId" column="transaction_id" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="createTime" column="create_time" />
|
||||
@ -22,7 +24,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectZcOrderSubVo">
|
||||
select suborder_id, order_id, suborder_no, suborder_type, amount, payment_method, vin_battery_no, created_at, payment_id, paid_at, remark, del_flag, create_time, update_time from zc_order_sub
|
||||
select suborder_id, order_id, suborder_no, suborder_type, amount, payment_method, vin_battery_no, created_at, payment_id, paid_at, pay_status, transaction_id, remark, del_flag, create_time, update_time from zc_order_sub
|
||||
</sql>
|
||||
|
||||
<select id="selectZcOrderSubList" parameterType="ZcOrderSub" resultMap="ZcOrderSubResult">
|
||||
@ -37,6 +39,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="createdAt != null "> and created_at = #{createdAt}</if>
|
||||
<if test="paymentId != null and paymentId != ''"> and payment_id = #{paymentId}</if>
|
||||
<if test="paidAt != null "> and paid_at = #{paidAt}</if>
|
||||
<if test="payStatus != null and payStatus != '' "> and pay_status = #{payStatus}</if>
|
||||
<if test="transactionId != null and transactionId != '' "> and transaction_id = #{transactionId}</if>
|
||||
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
|
||||
and date_format(create_time,'%y%m%d') >= date_format(#{params.beginTime},'%y%m%d')
|
||||
</if>
|
||||
@ -97,6 +101,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="createdAt != null">created_at = #{createdAt},</if>
|
||||
<if test="paymentId != null and paymentId != ''">payment_id = #{paymentId},</if>
|
||||
<if test="paidAt != null">paid_at = #{paidAt},</if>
|
||||
<if test="payStatus != null and payStatus != '' "> pay_status = #{payStatus},</if>
|
||||
<if test="transactionId != null and transactionId != '' "> transaction_id = #{transactionId},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
|
||||
@ -0,0 +1,73 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
||||
<head>
|
||||
<th:block th:include="include :: header('新增订单分成统计')" />
|
||||
</head>
|
||||
<body class="white-bg">
|
||||
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
|
||||
<form class="form-horizontal m" id="form-distrib-add">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">关联的订单ID:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="orderId" class="form-control" type="text" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">订单编号:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="orderNo" class="form-control" type="text" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">运营商id:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="companyId" class="form-control" type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">运营商id:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="storeId" class="form-control" type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">引荐人id:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="referralUserId" class="form-control" type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">分配比例:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="distribRate" class="form-control" type="text" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">分配金额:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="distribAmount" class="form-control" type="text" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">删除标志:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="delFlag" class="form-control" type="text">
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<th:block th:include="include :: footer" />
|
||||
<script th:inline="javascript">
|
||||
var prefix = ctx + "orders/distrib"
|
||||
$("#form-distrib-add").validate({
|
||||
focusCleanup: true
|
||||
});
|
||||
|
||||
function submitHandler() {
|
||||
if ($.validate.form()) {
|
||||
$.operate.save(prefix + "/add", $('#form-distrib-add').serialize());
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@ -0,0 +1,294 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
|
||||
<head>
|
||||
<th:block th:include="include :: header('订单分成统计列表')" />
|
||||
<style>
|
||||
.distrib-statistics {
|
||||
padding: 2px;
|
||||
background-color: #fff;
|
||||
border-radius: 8px;
|
||||
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
.statistics-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
.statistics-header .title {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
margin-left: 8px;
|
||||
}
|
||||
|
||||
.statistics-content {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
gap: 15px;
|
||||
}
|
||||
|
||||
.stat-item {
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
border-radius: 6px;
|
||||
width: 200px;
|
||||
}
|
||||
|
||||
.stat-item .label {
|
||||
background-color: #f8f9fa;
|
||||
font-size: 15px;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
.stat-item .value {
|
||||
font-size: 18px;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body class="gray-bg">
|
||||
<div class="container-div">
|
||||
<div class="row">
|
||||
<div class="col-sm-12 search-collapse">
|
||||
<form id="formId">
|
||||
<div class="select-list">
|
||||
<ul>
|
||||
<input type="hidden" name="distribType" th:field="*{zcOrderDistrib.distribType}"/>
|
||||
|
||||
<li>
|
||||
<label>所属运营商:</label>
|
||||
<select name="companyId" id="companyId" >
|
||||
<option value="">请选择所属运营商</option>
|
||||
<option th:each="company : ${companyList}" th:value="${company.id}" th:text="${company.companyName}"></option>
|
||||
</select>
|
||||
</li>
|
||||
<li>
|
||||
<label>所属门店:</label>
|
||||
<input type="text" name="zcOrderMain.storeName"/>
|
||||
</li>
|
||||
<li>
|
||||
<label>车辆:</label>
|
||||
<input type="text" name="zcOrderMain.licensePlate"/>
|
||||
</li>
|
||||
<li>
|
||||
<label>订单编号:</label>
|
||||
<input type="text" name="orderNo"/>
|
||||
</li>
|
||||
<li class="select-time">
|
||||
<label>下单时间: </label>
|
||||
<input type="text" class="time-input" id="beginFirstOrderTime" placeholder="开始时间" name="params[beginFirstOrderTime]"/>
|
||||
<span>-</span>
|
||||
<input type="text" class="time-input" id="endFirstOrderTime" placeholder="结束时间" name="params[endFirstOrderTime]"/>
|
||||
</li>
|
||||
<li>
|
||||
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a>
|
||||
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i> 重置</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="btn-group-sm" id="toolbar" role="group">
|
||||
|
||||
<!-- <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="orders:distrib:export">-->
|
||||
<!-- <i class="fa fa-download"></i> 导出-->
|
||||
<!-- </a>-->
|
||||
<div class="distrib-statistics">
|
||||
<div class="statistics-header">
|
||||
<i class="fa fa-circle-o-notch text-blue"></i>
|
||||
<span class="title"> <span th:text="${@dict.getLabel('key_order_distrib_type', zcOrderDistrib.distribType)}"></span>分成收益</span>
|
||||
</div>
|
||||
<div class="statistics-content">
|
||||
<div class="stat-item">
|
||||
<div class="label">订单总数</div>
|
||||
<div class="value">0笔</div>
|
||||
</div>
|
||||
<div class="stat-item">
|
||||
<div class="label">订单金额</div>
|
||||
<div class="value">0元</div>
|
||||
</div>
|
||||
<div class="stat-item">
|
||||
<div class="label">分成金额</div>
|
||||
<div class="value">0元</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-12 select-table table-striped">
|
||||
<table id="bootstrap-table"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<th:block th:include="include :: footer" />
|
||||
<script th:inline="javascript">
|
||||
var editFlag = [[${@permission.hasPermi('orders:distrib:edit')}]];
|
||||
var removeFlag = [[${@permission.hasPermi('orders:distrib:remove')}]];
|
||||
var orderStatusDatas = [[${@dict.getType('key_order_status')}]];
|
||||
var rentalTypeDatas = [[${@dict.getType('key_order_rental_type')}]];
|
||||
var depositFreeDatas = [[${@dict.getType('key_rent_deposit_free')}]];
|
||||
var autoDeductDatas = [[${@dict.getType('key_rent_auto_deduct')}]];
|
||||
var prefix = ctx + "orders/distrib";
|
||||
|
||||
$(function() {
|
||||
var options = {
|
||||
url: prefix + "/list",
|
||||
createUrl: prefix + "/add",
|
||||
updateUrl: prefix + "/edit/{id}",
|
||||
removeUrl: prefix + "/remove",
|
||||
exportUrl: prefix + "/export",
|
||||
modalName: "订单分成统计",
|
||||
columns: [{
|
||||
checkbox: true
|
||||
},
|
||||
{
|
||||
field: 'id',
|
||||
title: 'ID',
|
||||
visible: false
|
||||
},
|
||||
{
|
||||
field: 'orderId',
|
||||
title: '订单编号',
|
||||
visible: false
|
||||
},
|
||||
{
|
||||
field: 'zcOrderMain.operatorName',
|
||||
title: '所属运营商',
|
||||
width: '120px'
|
||||
},
|
||||
{
|
||||
field: 'zcOrderMain.storeName',
|
||||
title: '所属门店',
|
||||
width: '120px'
|
||||
},
|
||||
|
||||
{
|
||||
field: 'orderNo',
|
||||
title: '订单编号',
|
||||
width: '220px',
|
||||
formatter: function(value, row, index) {
|
||||
var actions = [];
|
||||
actions.push('<a class="btn btn-success btn-xs btnOption" href="javascript:void(0)" onclick="$.operate.detail(\'' + row.orderId + '\',1300,800)">' + value + '</a> ');
|
||||
return actions.join('');
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'zcOrderMain.licensePlate',
|
||||
title: '车架号',
|
||||
width: '120px'
|
||||
},
|
||||
|
||||
{
|
||||
field: 'zcOrderMain.customerName',
|
||||
title: '客户姓名',
|
||||
width: '120px'
|
||||
},
|
||||
{
|
||||
field: 'customerPhone',
|
||||
title: '联系电话',
|
||||
width: '120px'
|
||||
},
|
||||
{
|
||||
field: 'zcOrderMain.rentalType',
|
||||
title: '租赁类型',
|
||||
width: '120px',
|
||||
formatter: function(value, row, index) {
|
||||
return $.table.selectDictLabel(rentalTypeDatas, value);
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
field: 'zcOrderMain.rentalPrice',
|
||||
title: '租赁价格(元)',
|
||||
width: '120px'
|
||||
},
|
||||
{
|
||||
field: 'zcOrderMain.depositPrice',
|
||||
title: '支付押金(元)',
|
||||
width: '120px'
|
||||
},
|
||||
{
|
||||
field: 'zcOrderMain.rentalDays',
|
||||
title: '租赁天数',
|
||||
width: '120px'
|
||||
},
|
||||
{
|
||||
field: 'zcOrderMain.orderAmount',
|
||||
title: '租金总额',
|
||||
width: '120px'
|
||||
},
|
||||
{
|
||||
field: 'zcOrderMain.firstOrderTime',
|
||||
title: '首次下单时间',
|
||||
width: '160px'
|
||||
},
|
||||
{
|
||||
field: 'zcOrderMain.orderStatus',
|
||||
title: '订单状态',
|
||||
width: '120px',
|
||||
formatter: function(value, row, index) {
|
||||
return $.table.selectDictLabel(orderStatusDatas, value);
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'distribRate',
|
||||
title: '分配比例'
|
||||
},
|
||||
{
|
||||
field: 'distribAmount',
|
||||
title: '分配金额'
|
||||
}],
|
||||
onLoadSuccess: function(data) {
|
||||
loadSummaryStats(); // 表格加载成功后加载统计信息
|
||||
}
|
||||
};
|
||||
$.table.init(options);
|
||||
});
|
||||
|
||||
|
||||
function loadSummaryStats() {
|
||||
var formData = $("#formId").serialize();
|
||||
$.ajax({
|
||||
url: prefix + "/summary",
|
||||
type: "post",
|
||||
data: formData,
|
||||
success: function(result) {
|
||||
if (result) {
|
||||
// 更新统计信息
|
||||
$(".stat-item:eq(0) .value").text(formatAmount(result.orderCount) + "笔");
|
||||
$(".stat-item:eq(1) .value").text(formatAmount(result.totalOrderAmount) + "元");
|
||||
$(".stat-item:eq(2) .value").text(formatNumber(result.totalDistribAmount)+ "元");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function formatAmount(amount) {
|
||||
if (amount == null) return "0";
|
||||
return parseFloat(amount).toLocaleString('zh-CN', {maximumFractionDigits: 2});
|
||||
}
|
||||
|
||||
function formatNumber(num) {
|
||||
if (num == null) return "0";
|
||||
return parseInt(num).toLocaleString('zh-CN');
|
||||
}
|
||||
|
||||
// 修改搜索和重置函数
|
||||
var originalSearch = $.table.search;
|
||||
$.table.search = function() {
|
||||
originalSearch.call(this);
|
||||
loadSummaryStats(); // 搜索后加载统计信息
|
||||
};
|
||||
|
||||
var originalReset = $.form.reset;
|
||||
$.form.reset = function() {
|
||||
originalReset.call(this);
|
||||
loadSummaryStats(); // 重置后加载统计信息
|
||||
};
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@ -0,0 +1,68 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
||||
<head>
|
||||
<th:block th:include="include :: header('修改订单分成统计')" />
|
||||
</head>
|
||||
<body class="white-bg">
|
||||
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
|
||||
<form class="form-horizontal m" id="form-distrib-edit" th:object="${zcOrderDistrib}">
|
||||
<input name="id" th:field="*{id}" type="hidden">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">关联的订单ID:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="orderId" th:field="*{orderId}" class="form-control" type="text" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">订单编号:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="orderNo" th:field="*{orderNo}" class="form-control" type="text" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">运营商id:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="companyId" th:field="*{companyId}" class="form-control" type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">运营商id:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="storeId" th:field="*{storeId}" class="form-control" type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">引荐人id:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="referralUserId" th:field="*{referralUserId}" class="form-control" type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">分配比例:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="distribRate" th:field="*{distribRate}" class="form-control" type="text" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">分配金额:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="distribAmount" th:field="*{distribAmount}" class="form-control" type="text" required>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<th:block th:include="include :: footer" />
|
||||
<script th:inline="javascript">
|
||||
var prefix = ctx + "orders/distrib";
|
||||
$("#form-distrib-edit").validate({
|
||||
focusCleanup: true
|
||||
});
|
||||
|
||||
function submitHandler() {
|
||||
if ($.validate.form()) {
|
||||
$.operate.save(prefix + "/edit", $('#form-distrib-edit').serialize());
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@ -252,9 +252,18 @@
|
||||
{
|
||||
field: 'paymentId',
|
||||
align: 'center',
|
||||
title: '支付'
|
||||
title: '支付ID'
|
||||
},
|
||||
{
|
||||
field: 'transactionId',
|
||||
align: 'center',
|
||||
title: '平台支付流水号'
|
||||
},
|
||||
{
|
||||
field: 'payStatus',
|
||||
align: 'center',
|
||||
title: '支付状态'
|
||||
},
|
||||
|
||||
{
|
||||
field: 'paidAt',
|
||||
align: 'center',
|
||||
|
||||
@ -119,7 +119,17 @@
|
||||
},
|
||||
{
|
||||
field: 'paymentId',
|
||||
title: '支付方式'
|
||||
title: '支付ID'
|
||||
},
|
||||
{
|
||||
field: 'transactionId',
|
||||
align: 'center',
|
||||
title: '平台支付流水号'
|
||||
},
|
||||
{
|
||||
field: 'payStatus',
|
||||
align: 'center',
|
||||
title: '支付状态'
|
||||
},
|
||||
{
|
||||
field: 'paidAt',
|
||||
|
||||
Reference in New Issue
Block a user