| | |
| | | package com.stylefeng.guns.modular.system.controller.general; |
| | | |
| | | import cn.hutool.core.util.CreditCodeUtil; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.stylefeng.guns.core.base.controller.BaseController; |
| | |
| | | import com.stylefeng.guns.modular.system.controller.resp.TDriverCommissionResp; |
| | | import com.stylefeng.guns.modular.system.controller.resp.TDriverResp; |
| | | import com.stylefeng.guns.modular.system.controller.util.*; |
| | | import com.stylefeng.guns.modular.system.enums.UserTypeEnum; |
| | | import com.stylefeng.guns.modular.system.model.*; |
| | | import com.stylefeng.guns.modular.system.service.ITAgentService; |
| | | import com.stylefeng.guns.modular.system.service.ITBranchOfficeService; |
| | | import com.stylefeng.guns.modular.system.service.ITRegionService; |
| | | import com.stylefeng.guns.modular.system.service.*; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.StringUtils; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import com.stylefeng.guns.core.log.LogObjectHolder; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import com.stylefeng.guns.modular.system.service.ITDriverService; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.File; |
| | |
| | | private HttpUtils httpUtils; |
| | | @Autowired |
| | | private TokenUtils tokenUtils; |
| | | @Autowired |
| | | private ITRechargeRecordService tRechargeRecordService; |
| | | |
| | | /** |
| | | * 跳转到首页 |
| | |
| | | */ |
| | | @ApiOperation(value = "充值余额") |
| | | @RequestMapping(value = "/recharge-balance") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @ResponseBody |
| | | public Object rechargeBalance(Integer id, String money) { |
| | | TDriver tDriver = tDriverService.selectById(id); |
| | | tDriver.setBackgroundBalance(new BigDecimal(money).add(tDriver.getBackgroundBalance())); |
| | | tDriverService.updateById(tDriver); |
| | | |
| | | // 添加充值记录 |
| | | TRechargeRecord tRechargeRecord = new TRechargeRecord(); |
| | | tRechargeRecord.setType(UserTypeEnum.AGENT.getCode()); |
| | | tRechargeRecord.setUserId(id); |
| | | tRechargeRecord.setCode(UUIDUtil.getNumberRandom(16)); |
| | | tRechargeRecord.setAmount(new BigDecimal(money)); |
| | | tRechargeRecord.setPayType(2); |
| | | tRechargeRecord.setPayTime(new Date()); |
| | | tRechargeRecord.setPayStatus(2); |
| | | tRechargeRecord.setCreateTime(new Date()); |
| | | tRechargeRecord.setAgentId(Objects.requireNonNull(ShiroKit.getUser()).getId()); |
| | | tRechargeRecordService.insert(tRechargeRecord); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.controller.general; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.stylefeng.guns.core.base.controller.BaseController; |
| | | import com.stylefeng.guns.modular.system.controller.resp.RevenueExpenditureResp; |
| | | import com.stylefeng.guns.modular.system.controller.resp.TDriverCommissionResp; |
| | | import com.stylefeng.guns.modular.system.controller.util.ExcelUtil; |
| | | import com.stylefeng.guns.modular.system.model.TDriver; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.poi.hssf.usermodel.HSSFWorkbook; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | import org.springframework.ui.Model; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import com.stylefeng.guns.core.log.LogObjectHolder; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import com.stylefeng.guns.modular.system.model.TRevenue; |
| | | import com.stylefeng.guns.modular.system.service.ITRevenueService; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.OutputStream; |
| | | import java.math.BigDecimal; |
| | | import java.text.DateFormat; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * 控制器 |
| | | * |
| | | * @author fengshuonan |
| | | * @Date 2023-03-13 09:49:19 |
| | | */ |
| | | @Controller |
| | | @RequestMapping("/tRevenue") |
| | | public class TRevenueController extends BaseController { |
| | | |
| | | private String PREFIX = "/system/tRevenue/"; |
| | | |
| | | @Autowired |
| | | private ITRevenueService tRevenueService; |
| | | |
| | | /** |
| | | * 跳转到首页 |
| | | */ |
| | | @RequestMapping("") |
| | | public String index() { |
| | | return PREFIX + "tRevenue.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到添加 |
| | | */ |
| | | @RequestMapping("/tRevenue_add") |
| | | public String tRevenueAdd() { |
| | | return PREFIX + "tRevenue_add.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到修改 |
| | | */ |
| | | @RequestMapping("/tRevenue_update/{tRevenueId}") |
| | | public String tRevenueUpdate(@PathVariable Integer tRevenueId, Model model) { |
| | | TRevenue tRevenue = tRevenueService.selectById(tRevenueId); |
| | | model.addAttribute("item",tRevenue); |
| | | LogObjectHolder.me().set(tRevenue); |
| | | return PREFIX + "tRevenue_edit.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到佣金提现详情 |
| | | */ |
| | | @RequestMapping("/commissionDetail") |
| | | public String commissionDetail(String code, Model model) { |
| | | tRevenueService.commissionDetail(code,model); |
| | | return PREFIX + "tRevenueCommissionDetail.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到余额提现详情 |
| | | */ |
| | | @RequestMapping("/balanceDetail") |
| | | public String balanceDetail(String code, Model model) { |
| | | tRevenueService.balanceDetail(code,model); |
| | | return PREFIX + "tRevenueBalanceDetail.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到支付订单详情 |
| | | */ |
| | | @RequestMapping("/orderDetail") |
| | | public String orderDetail(String code, Model model) { |
| | | tRevenueService.orderDetail(code,model); |
| | | return PREFIX + "tRevenueOrderDetail.html"; |
| | | } |
| | | |
| | | /** |
| | | * 获取列表 |
| | | */ |
| | | @RequestMapping(value = "/list") |
| | | @ResponseBody |
| | | public Object list(String code,Integer businessType,Integer payType,String driverName,String businessTime) { |
| | | return tRevenueService.getPageList(code,businessType,payType,driverName,businessTime); |
| | | } |
| | | |
| | | /** |
| | | * 获取列表 |
| | | */ |
| | | @RequestMapping(value = "/list-back") |
| | | @ResponseBody |
| | | public Object listBack(String condition) { |
| | | return tRevenueService.selectList(null); |
| | | } |
| | | |
| | | /** |
| | | * 新增 |
| | | */ |
| | | @RequestMapping(value = "/add") |
| | | @ResponseBody |
| | | public Object add(TRevenue tRevenue) { |
| | | tRevenueService.insert(tRevenue); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 删除 |
| | | */ |
| | | @RequestMapping(value = "/delete") |
| | | @ResponseBody |
| | | public Object delete(@RequestParam Integer tRevenueId) { |
| | | tRevenueService.deleteById(tRevenueId); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 修改 |
| | | */ |
| | | @RequestMapping(value = "/update") |
| | | @ResponseBody |
| | | public Object update(TRevenue tRevenue) { |
| | | tRevenueService.updateById(tRevenue); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 详情 |
| | | */ |
| | | @RequestMapping(value = "/detail/{tRevenueId}") |
| | | @ResponseBody |
| | | public Object detail(@PathVariable("tRevenueId") Integer tRevenueId) { |
| | | return tRevenueService.selectById(tRevenueId); |
| | | } |
| | | |
| | | @ApiOperation(value = "导出收支明细列表",notes="导出收支明细列表") |
| | | @RequestMapping(value = "/export") |
| | | @ResponseBody |
| | | public void export(String code,Integer businessType,Integer payType,String driverName,String businessTime, HttpServletResponse response) { |
| | | try { |
| | | Date date = new Date(); |
| | | DateFormat format = new SimpleDateFormat("yyyyMMdd"); |
| | | String time1 = format.format(date); |
| | | String fileName = "RevenueExpenditureDetailsInfo"+time1+".xls"; |
| | | String[] title = new String[] {"订单号","交易时间","交易类型","司机姓名","司机电话", |
| | | "支付类型","金额","佣金提成","优惠券","余额","状态"}; |
| | | List<RevenueExpenditureResp> pageList = tRevenueService.getPageList(code, businessType, payType, driverName, businessTime); |
| | | |
| | | String[][] values = new String[pageList.size()][]; |
| | | for (int i = 0; i < pageList.size(); i++) { |
| | | RevenueExpenditureResp d = pageList.get(i); |
| | | values[i] = new String[title.length]; |
| | | values[i][0] = d.getCode(); |
| | | values[i][1] = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(d.getBusinessTime()); |
| | | Integer businessType1 = d.getBusinessType(); |
| | | if(1 == businessType1){ |
| | | values[i][2] = "支付订单"; |
| | | }else if (11 == businessType1){ |
| | | values[i][2] = "佣金提现"; |
| | | }else if (12 == businessType1){ |
| | | values[i][2] = "余额提现"; |
| | | } |
| | | values[i][3] = d.getDriverName(); |
| | | values[i][4] = d.getDriverPhone(); |
| | | Integer payType1 = d.getPayType(); |
| | | if(1 == payType1){ |
| | | values[i][5] = "微信支付"; |
| | | }else if (2 == payType1){ |
| | | values[i][5] = "余额支付"; |
| | | }else if (3 == payType1){ |
| | | values[i][5] = "线下收款"; |
| | | } |
| | | values[i][6] = String.valueOf(Objects.isNull(d.getAmount())? BigDecimal.ZERO :d.getAmount()); |
| | | values[i][7] = String.valueOf(Objects.isNull(d.getCommissionAmount())? BigDecimal.ZERO :d.getCommissionAmount()); |
| | | values[i][8] = String.valueOf(Objects.isNull(d.getDiscountedPrice())? BigDecimal.ZERO :d.getDiscountedPrice()); |
| | | values[i][9] = String.valueOf(Objects.isNull(d.getAccountBalance())? BigDecimal.ZERO :d.getAccountBalance()); |
| | | Integer state = d.getState(); |
| | | if(2 == state){ |
| | | values[i][10] = "完成"; |
| | | }else if(108 == state){ |
| | | values[i][10] = "完成"; |
| | | }else if(109 == state){ |
| | | values[i][10] = "完成"; |
| | | } |
| | | } |
| | | HSSFWorkbook wb = ExcelUtil.getHSSFWorkbook("Variance"+time1, title, values, null); |
| | | ExcelUtil.setResponseHeader(response, fileName); |
| | | OutputStream os = response.getOutputStream(); |
| | | wb.write(os); |
| | | os.flush(); |
| | | os.close(); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.controller.resp; |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | public class RevenueExpenditureResp implements Serializable { |
| | | |
| | | |
| | | @ApiModelProperty(value = "主键") |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty(value = "订单号") |
| | | private String code; |
| | | |
| | | @ApiModelProperty(value = "交易时间") |
| | | private Date businessTime; |
| | | |
| | | @ApiModelProperty(value = "交易类型 1=支付订单 11=佣金体现 12=余额提现") |
| | | private Integer businessType; |
| | | |
| | | @ApiModelProperty(value = "司机姓名") |
| | | private String driverName; |
| | | |
| | | @ApiModelProperty(value = "司机电话") |
| | | private String driverPhone; |
| | | |
| | | @ApiModelProperty(value = "支付类型 1微信支付 2余额支付 3线下收款") |
| | | private Integer payType; |
| | | |
| | | @ApiModelProperty(value = "金额") |
| | | private BigDecimal amount; |
| | | |
| | | @ApiModelProperty(value = "佣金抽成") |
| | | private BigDecimal commissionAmount; |
| | | |
| | | @ApiModelProperty(value = "优惠券金额") |
| | | private BigDecimal discountedPrice; |
| | | |
| | | @ApiModelProperty(value = "余额") |
| | | private BigDecimal accountBalance; |
| | | |
| | | @ApiModelProperty(value = "状态 (2、108、109)完成") |
| | | private Integer state; |
| | | |
| | | @ApiModelProperty(value = "司机id") |
| | | private Integer driverId; |
| | | |
| | | @ApiModelProperty(value = "订单金额") |
| | | private BigDecimal payMoney; |
| | | |
| | | @ApiModelProperty(value = "订单ID") |
| | | private Integer orderId; |
| | | |
| | | public Integer getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(Integer id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public Integer getOrderId() { |
| | | return orderId; |
| | | } |
| | | |
| | | public void setOrderId(Integer orderId) { |
| | | this.orderId = orderId; |
| | | } |
| | | |
| | | public BigDecimal getPayMoney() { |
| | | return payMoney; |
| | | } |
| | | |
| | | public void setPayMoney(BigDecimal payMoney) { |
| | | this.payMoney = payMoney; |
| | | } |
| | | |
| | | public Integer getDriverId() { |
| | | return driverId; |
| | | } |
| | | |
| | | public void setDriverId(Integer driverId) { |
| | | this.driverId = driverId; |
| | | } |
| | | |
| | | public String getCode() { |
| | | return code; |
| | | } |
| | | |
| | | public void setCode(String code) { |
| | | this.code = code; |
| | | } |
| | | |
| | | public Date getBusinessTime() { |
| | | return businessTime; |
| | | } |
| | | |
| | | public void setBusinessTime(Date businessTime) { |
| | | this.businessTime = businessTime; |
| | | } |
| | | |
| | | public Integer getBusinessType() { |
| | | return businessType; |
| | | } |
| | | |
| | | public void setBusinessType(Integer businessType) { |
| | | this.businessType = businessType; |
| | | } |
| | | |
| | | public String getDriverName() { |
| | | return driverName; |
| | | } |
| | | |
| | | public void setDriverName(String driverName) { |
| | | this.driverName = driverName; |
| | | } |
| | | |
| | | public String getDriverPhone() { |
| | | return driverPhone; |
| | | } |
| | | |
| | | public void setDriverPhone(String driverPhone) { |
| | | this.driverPhone = driverPhone; |
| | | } |
| | | |
| | | public Integer getPayType() { |
| | | return payType; |
| | | } |
| | | |
| | | public void setPayType(Integer payType) { |
| | | this.payType = payType; |
| | | } |
| | | |
| | | public BigDecimal getAmount() { |
| | | return amount; |
| | | } |
| | | |
| | | public void setAmount(BigDecimal amount) { |
| | | this.amount = amount; |
| | | } |
| | | |
| | | public BigDecimal getCommissionAmount() { |
| | | return commissionAmount; |
| | | } |
| | | |
| | | public void setCommissionAmount(BigDecimal commissionAmount) { |
| | | this.commissionAmount = commissionAmount; |
| | | } |
| | | |
| | | public BigDecimal getDiscountedPrice() { |
| | | return discountedPrice; |
| | | } |
| | | |
| | | public void setDiscountedPrice(BigDecimal discountedPrice) { |
| | | this.discountedPrice = discountedPrice; |
| | | } |
| | | |
| | | public BigDecimal getAccountBalance() { |
| | | return accountBalance; |
| | | } |
| | | |
| | | public void setAccountBalance(BigDecimal accountBalance) { |
| | | this.accountBalance = accountBalance; |
| | | } |
| | | |
| | | public Integer getState() { |
| | | return state; |
| | | } |
| | | |
| | | public void setState(Integer state) { |
| | | this.state = state; |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.dao; |
| | | |
| | | import com.stylefeng.guns.modular.system.controller.resp.RevenueExpenditureResp; |
| | | import com.stylefeng.guns.modular.system.model.TRevenue; |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 收入记录 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author stylefeng |
| | | * @since 2023-03-13 |
| | | */ |
| | | @Mapper |
| | | public interface TRevenueMapper extends BaseMapper<TRevenue> { |
| | | |
| | | /** |
| | | * 获取列表 |
| | | * @param startTime |
| | | * @param endTime |
| | | * @param code |
| | | * @param businessType |
| | | * @param payType |
| | | * @param driverName |
| | | * @param roleType |
| | | * @param objectId |
| | | * @return |
| | | */ |
| | | List<RevenueExpenditureResp> getPageList(@Param("startTime") String startTime, @Param("endTime")String endTime, @Param("code")String code, |
| | | @Param("businessType")Integer businessType, @Param("payType")Integer payType, @Param("driverName")String driverName, |
| | | @Param("roleType")Integer roleType, @Param("objectId")Integer objectId); |
| | | |
| | | /** |
| | | * |
| | | * @param code |
| | | * @param type |
| | | * @return |
| | | */ |
| | | RevenueExpenditureResp commissionOrBalanceDetail(@Param("code")String code, @Param("type")Integer type); |
| | | } |
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.stylefeng.guns.modular.system.dao.TRevenueMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.stylefeng.guns.modular.system.model.TRevenue"> |
| | | <id column="id" property="id" /> |
| | | <result column="type" property="type" /> |
| | | <result column="userType" property="userType" /> |
| | | <result column="userId" property="userId" /> |
| | | <result column="orderId" property="orderId" /> |
| | | <result column="amount" property="amount" /> |
| | | <result column="createTime" property="createTime" /> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, type, userType, userId, orderId, amount, createTime |
| | | </sql> |
| | | <select id="getPageList" resultType="com.stylefeng.guns.modular.system.controller.resp.RevenueExpenditureResp"> |
| | | SELECT |
| | | t.id, |
| | | t.businessType, |
| | | t.amount, |
| | | t.businessTime, |
| | | t.driverName, |
| | | t.driverPhone, |
| | | t.`code`, |
| | | t.payType, |
| | | t.state, |
| | | t.discountedPrice, |
| | | t.driverId, |
| | | t.accountBalance, |
| | | t.agentId, |
| | | t.payMoney, |
| | | t.orderId |
| | | FROM |
| | | (SELECT |
| | | r.id, |
| | | r.type AS businessType, |
| | | r.amount, |
| | | r.createTime AS businessTime, |
| | | d.`name` AS driverName, |
| | | d.phone AS driverPhone, |
| | | o.`code`, |
| | | o.payType, |
| | | o.state, |
| | | o.discountedPrice, |
| | | o.payMoney, |
| | | o.id AS orderId, |
| | | d.id AS driverId, |
| | | d.balance AS accountBalance, |
| | | d.agentId |
| | | FROM |
| | | t_revenue r |
| | | LEFT JOIN t_driver d ON r.userId = d.id |
| | | LEFT JOIN t_order o ON r.orderId = o.id |
| | | WHERE |
| | | ( o.state = ${@com.stylefeng.guns.modular.system.enums.OrderStateEnum@WAIT_EVALUATED.getCode()} |
| | | OR o.state = ${@com.stylefeng.guns.modular.system.enums.OrderStateEnum@FINISH.getCode()} ) |
| | | AND r.type = 1 |
| | | UNION ALL |
| | | SELECT |
| | | cw.id, |
| | | cw.businessType, |
| | | cw.amount, |
| | | cw.createTime AS businessTime, |
| | | d.`name` AS driverName, |
| | | d.phone AS driverPhone, |
| | | cw.`code`, |
| | | 0 AS payType, |
| | | cw.state, |
| | | 0 AS discountedPrice, |
| | | 0 AS payMoney, |
| | | 0 AS orderId, |
| | | d.id AS driverId, |
| | | d.balance AS accountBalance, |
| | | d.agentId |
| | | FROM |
| | | t_cash_withdrawal cw |
| | | LEFT JOIN t_driver d ON cw.userDriverId = d.id |
| | | WHERE |
| | | cw.type = 2) t |
| | | <where> |
| | | <if test="startTime != null and startTime != '' and endTime != null and endTime != ''"> |
| | | AND t.businessTime BETWEEN #{startTime} AND #{endTime} |
| | | </if> |
| | | <if test="code != null and code != ''"> |
| | | AND t.code LIKE concat('%',#{code},'%') |
| | | </if> |
| | | <if test="businessType != null"> |
| | | AND t.businessType = #{businessType} |
| | | </if> |
| | | <if test="payType != null"> |
| | | AND t.payType = #{payType} |
| | | </if> |
| | | <if test="driverName != null and driverName != ''"> |
| | | AND t.driverName LIKE concat('%',#{driverName},'%') |
| | | </if> |
| | | <if test="roleType != null and roleType == 3"> |
| | | AND t.agentId = #{objectId} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | <select id="commissionOrBalanceDetail" resultType="com.stylefeng.guns.modular.system.controller.resp.RevenueExpenditureResp"> |
| | | SELECT |
| | | cw.id, |
| | | cw.businessType, |
| | | cw.amount, |
| | | cw.createTime AS businessTime, |
| | | d.`name` AS driverName, |
| | | d.phone AS driverPhone, |
| | | cw.`code`, |
| | | 0 AS payType, |
| | | cw.state, |
| | | 0 AS discountedPrice, |
| | | 0 AS payMoney, |
| | | 0 AS orderId, |
| | | d.id AS driverId, |
| | | d.balance AS accountBalance, |
| | | d.agentId |
| | | FROM |
| | | t_cash_withdrawal cw |
| | | LEFT JOIN t_driver d ON cw.userDriverId = d.id |
| | | WHERE |
| | | cw.type = 2 AND cw.businessType = #{type} AND cw.code = #{code} |
| | | </select> |
| | | |
| | | </mapper> |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.enums; |
| | | |
| | | |
| | | |
| | | /** |
| | | * @Description 提现记录枚举 |
| | | * @Author xiaochen |
| | | * @Date 2023/02/15 9:42 |
| | | */ |
| | | public enum CashWithdrawalTypeEnum { |
| | | |
| | | COMMISSION_WITHDRAWAL(11, "佣金提现"), |
| | | BALANCE_WITHDRAWAL(12, "余额提现"); |
| | | |
| | | private String desc; |
| | | |
| | | |
| | | private int code; |
| | | |
| | | |
| | | CashWithdrawalTypeEnum(int code, String desc) { |
| | | this.code = code; |
| | | this.desc = desc; |
| | | } |
| | | |
| | | public String getDesc() { |
| | | return desc; |
| | | } |
| | | |
| | | public int getCode() { |
| | | return code; |
| | | } |
| | | |
| | | /** |
| | | * 通过code获取枚举 |
| | | * |
| | | * @param code |
| | | * @return |
| | | */ |
| | | public static CashWithdrawalTypeEnum fromCode(Integer code) { |
| | | CashWithdrawalTypeEnum[] resultTypes = CashWithdrawalTypeEnum.values(); |
| | | for (CashWithdrawalTypeEnum resultType : resultTypes) { |
| | | if (code.equals(resultType.getCode())) { |
| | | return resultType; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | } |
| | |
| | | */ |
| | | public enum OrderStateEnum { |
| | | |
| | | /*订单状态(101=待接单,102=已接单,103=前往预约点,104=到达预约点,105=开始服务,106=到达目的地,107=待评价,108=已完成,201=转单中,301=已取消)*/ |
| | | /*订单状态(101=待接单,102=已接单,103=前往预约点,104=到达预约点,105=开始服务,106=到达目的地,107=待支付,108=待评价,109=已完成,201=转单中,301=已取消,401=等待中)*/ |
| | | |
| | | PENDING_ORDER(101, "待接单"), |
| | | ORDER_RECEIVED(102, "已接单"), |
| | |
| | | ARRIVE_APPOINTMENT_POINT(104, "到达预约点"), |
| | | START_SERVICE(105, "开始服务"), |
| | | ARRIVE_IN(106, "到达目的地"), |
| | | WAIT_EVALUATED(107, "待评价"), |
| | | FINISH(108, "已完成"), |
| | | WAIT_PAY(107,"待支付"), |
| | | WAIT_EVALUATED(108, "待评价"), |
| | | FINISH(109, "已完成"), |
| | | TRANSFERRING(201, "转单中"), |
| | | CANCELED(301,"已取消"), |
| | | WAITING(401,"等待中"); |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.enums; |
| | | |
| | | |
| | | |
| | | /** |
| | | * @Description 用户司机枚举 |
| | | * @Author xiaochen |
| | | * @Date 2023/02/15 9:42 |
| | | */ |
| | | public enum RevenueTypeEnum { |
| | | |
| | | ORDER_REVENUE(1, "订单收入"), |
| | | COMMISSION_INCOME(2, "分佣收入"); |
| | | |
| | | private String desc; |
| | | |
| | | |
| | | private int code; |
| | | |
| | | |
| | | RevenueTypeEnum(int code, String desc) { |
| | | this.code = code; |
| | | this.desc = desc; |
| | | } |
| | | |
| | | public String getDesc() { |
| | | return desc; |
| | | } |
| | | |
| | | public int getCode() { |
| | | return code; |
| | | } |
| | | |
| | | /** |
| | | * 通过code获取枚举 |
| | | * |
| | | * @param code |
| | | * @return |
| | | */ |
| | | public static RevenueTypeEnum fromCode(Integer code) { |
| | | RevenueTypeEnum[] resultTypes = RevenueTypeEnum.values(); |
| | | for (RevenueTypeEnum resultType : resultTypes) { |
| | | if (code.equals(resultType.getCode())) { |
| | | return resultType; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.enums; |
| | | |
| | | |
| | | |
| | | /** |
| | | * @Description 系统规则配置 |
| | | * @Author xiaochen |
| | | * @Date 2023/02/15 9:42 |
| | | */ |
| | | public enum SystemConfigTypeEnum { |
| | | |
| | | /*类型(1=派单规则,2=佣金分成规则,3=抽成规则,4=积分规则,5=价格规则,6=余额规则,7=客服管理)*/ |
| | | |
| | | DISPATCH_RULES(1, "派单规则"), |
| | | COMMISSION_SHARING_RULES(2, "佣金分成规则"), |
| | | EXTRACTION_RULE(3, "抽成规则"), |
| | | INTEGRAL_RULE(4, "积分规则"), |
| | | PRICE_RULES(5, "价格规则"), |
| | | BALANCE_RULES(6, "余额规则"), |
| | | CUSTOMER_SERVICE_MGMT(7,"客服管理"); |
| | | |
| | | private String desc; |
| | | |
| | | |
| | | private int code; |
| | | |
| | | |
| | | SystemConfigTypeEnum(int code, String desc) { |
| | | this.code = code; |
| | | this.desc = desc; |
| | | } |
| | | |
| | | public String getDesc() { |
| | | return desc; |
| | | } |
| | | |
| | | public int getCode() { |
| | | return code; |
| | | } |
| | | |
| | | /** |
| | | * 通过code获取枚举 |
| | | * |
| | | * @param code |
| | | * @return |
| | | */ |
| | | public static SystemConfigTypeEnum fromCode(Integer code) { |
| | | SystemConfigTypeEnum[] resultTypes = SystemConfigTypeEnum.values(); |
| | | for (SystemConfigTypeEnum resultType : resultTypes) { |
| | | if (code.equals(resultType.getCode())) { |
| | | return resultType; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | } |
| | |
| | | public enum UserTypeEnum { |
| | | |
| | | USER(1, "用户"), |
| | | DRIVER(2, "司机"); |
| | | DRIVER(2, "司机"), |
| | | AGENT(3,"代理商"); |
| | | |
| | | private String desc; |
| | | |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.model; |
| | | |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.activerecord.Model; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * <p> |
| | | * 收入记录 |
| | | * </p> |
| | | * |
| | | * @author stylefeng |
| | | * @since 2023-03-13 |
| | | */ |
| | | @TableName("t_revenue") |
| | | public class TRevenue extends Model<TRevenue> { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | /** |
| | | * 收入类型(1=订单收入,2=分佣收入) |
| | | */ |
| | | private Integer type; |
| | | /** |
| | | * 用户类型(1=用户,2=司机,3=代理商) |
| | | */ |
| | | private Integer userType; |
| | | /** |
| | | * 用户id |
| | | */ |
| | | private Integer userId; |
| | | /** |
| | | * 订单id |
| | | */ |
| | | private Integer orderId; |
| | | /** |
| | | * 收入金额 |
| | | */ |
| | | private BigDecimal amount; |
| | | /** |
| | | * 添加时间 |
| | | */ |
| | | private Date createTime; |
| | | |
| | | |
| | | public Integer getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(Integer id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public Integer getType() { |
| | | return type; |
| | | } |
| | | |
| | | public void setType(Integer type) { |
| | | this.type = type; |
| | | } |
| | | |
| | | public Integer getUserType() { |
| | | return userType; |
| | | } |
| | | |
| | | public void setUserType(Integer userType) { |
| | | this.userType = userType; |
| | | } |
| | | |
| | | public Integer getUserId() { |
| | | return userId; |
| | | } |
| | | |
| | | public void setUserId(Integer userId) { |
| | | this.userId = userId; |
| | | } |
| | | |
| | | public Integer getOrderId() { |
| | | return orderId; |
| | | } |
| | | |
| | | public void setOrderId(Integer orderId) { |
| | | this.orderId = orderId; |
| | | } |
| | | |
| | | public BigDecimal getAmount() { |
| | | return amount; |
| | | } |
| | | |
| | | public void setAmount(BigDecimal amount) { |
| | | this.amount = amount; |
| | | } |
| | | |
| | | public Date getCreateTime() { |
| | | return createTime; |
| | | } |
| | | |
| | | public void setCreateTime(Date createTime) { |
| | | this.createTime = createTime; |
| | | } |
| | | |
| | | @Override |
| | | protected Serializable pkVal() { |
| | | return this.id; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "TRevenue{" + |
| | | "id=" + id + |
| | | ", type=" + type + |
| | | ", userType=" + userType + |
| | | ", userId=" + userId + |
| | | ", orderId=" + orderId + |
| | | ", amount=" + amount + |
| | | ", createTime=" + createTime + |
| | | "}"; |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.service; |
| | | |
| | | import com.stylefeng.guns.modular.system.controller.resp.RevenueExpenditureResp; |
| | | import com.stylefeng.guns.modular.system.model.TRevenue; |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import org.springframework.ui.Model; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 收入记录 服务类 |
| | | * </p> |
| | | * |
| | | * @author stylefeng |
| | | * @since 2023-03-13 |
| | | */ |
| | | public interface ITRevenueService extends IService<TRevenue> { |
| | | |
| | | /** |
| | | * 获取列表 |
| | | * @param code 订单号 |
| | | * @param businessType 交易类型 |
| | | * @param payType 支付类型 |
| | | * @param driverName 司机名称 |
| | | * @param businessTime 交易时间 |
| | | * @return |
| | | */ |
| | | List<RevenueExpenditureResp> getPageList(String code, Integer businessType, Integer payType, String driverName, String businessTime); |
| | | |
| | | /** |
| | | * 跳转到佣金提现详情 |
| | | * @param code |
| | | * @param model |
| | | */ |
| | | void commissionDetail(String code, Model model); |
| | | |
| | | /** |
| | | * 跳转到余额提现详情 |
| | | * @param code |
| | | * @param model |
| | | */ |
| | | void balanceDetail(String code, Model model); |
| | | /** |
| | | * 佣金提现余额提现封装model |
| | | */ |
| | | void packageModel(RevenueExpenditureResp revenueExpenditureResp,Model model); |
| | | |
| | | /** |
| | | * 跳转到支付订单详情 |
| | | * @param code |
| | | * @param model |
| | | */ |
| | | void orderDetail(String code, Model model); |
| | | } |
| | |
| | | // 查询司机 |
| | | TDriver tDriver = tDriverMapper.selectById(tOrder.getDriverId()); |
| | | model.addAttribute("driverName",tDriver.getName()); |
| | | model.addAttribute("driverPhone",tDriver.getPhone()); |
| | | |
| | | // 查询司机所属分公司 |
| | | TBranchOffice tBranchOffice = tBranchOfficeMapper.selectById(tDriver.getBranchOfficeId()); |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.stylefeng.guns.core.shiro.ShiroKit; |
| | | import com.stylefeng.guns.modular.system.controller.resp.RevenueExpenditureResp; |
| | | import com.stylefeng.guns.modular.system.dao.*; |
| | | import com.stylefeng.guns.modular.system.enums.CashWithdrawalTypeEnum; |
| | | import com.stylefeng.guns.modular.system.enums.RevenueTypeEnum; |
| | | import com.stylefeng.guns.modular.system.enums.SystemConfigTypeEnum; |
| | | import com.stylefeng.guns.modular.system.enums.UserTypeEnum; |
| | | import com.stylefeng.guns.modular.system.model.*; |
| | | import com.stylefeng.guns.modular.system.service.ITEvaluateService; |
| | | import com.stylefeng.guns.modular.system.service.ITOrderService; |
| | | import com.stylefeng.guns.modular.system.service.ITRevenueService; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.stylefeng.guns.modular.system.service.ITSystemConfigService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.ui.Model; |
| | | import org.springframework.util.StringUtils; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.Optional; |
| | | |
| | | /** |
| | | * <p> |
| | | * 收入记录 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author stylefeng |
| | | * @since 2023-03-13 |
| | | */ |
| | | @Service |
| | | public class TRevenueServiceImpl extends ServiceImpl<TRevenueMapper, TRevenue> implements ITRevenueService { |
| | | |
| | | @Autowired |
| | | private TRevenueMapper tRevenueMapper; |
| | | @Autowired |
| | | private TAppUserMapper tAppUserMapper; |
| | | @Autowired |
| | | private ITSystemConfigService tSystemConfigService; |
| | | @Autowired |
| | | private ITOrderService tOrderService; |
| | | @Autowired |
| | | private ITEvaluateService tEvaluateService; |
| | | |
| | | @Override |
| | | public List<RevenueExpenditureResp> getPageList(String code, Integer businessType, Integer payType, String driverName, String businessTime) { |
| | | String startTime = null; |
| | | String endTime = null; |
| | | // 开始,结束时间 |
| | | if(StringUtils.hasLength(businessTime)){ |
| | | String[] split = businessTime.split(" - "); |
| | | startTime = split[0]; |
| | | endTime = split[1]; |
| | | } |
| | | Integer roleType = Objects.requireNonNull(ShiroKit.getUser()).getRoleType(); |
| | | Integer objectId = Objects.requireNonNull(ShiroKit.getUser()).getObjectId(); |
| | | List<RevenueExpenditureResp> pageList = tRevenueMapper.getPageList(startTime, endTime, code, businessType, payType, driverName, roleType, objectId); |
| | | // 查询抽佣规则 |
| | | TSystemConfig tSystemConfig = tSystemConfigService.selectOne(new EntityWrapper<TSystemConfig>() |
| | | .eq("type", SystemConfigTypeEnum.EXTRACTION_RULE.getCode())); |
| | | for (RevenueExpenditureResp revenueExpenditureResp : pageList) { |
| | | BigDecimal commissionAmount = BigDecimal.ZERO; |
| | | if(1 == revenueExpenditureResp.getBusinessType()){ |
| | | // 计算佣金提成 |
| | | // 1.该订单的代驾用户是否为该司机邀请 |
| | | Integer count = tAppUserMapper.selectCount(new EntityWrapper<TAppUser>() |
| | | .eq("inviterType", UserTypeEnum.DRIVER.getCode()) |
| | | .eq("inviterId", revenueExpenditureResp.getDriverId())); |
| | | if(count>0){ |
| | | commissionAmount = commissionAmount.add(JSONObject.parseObject(tSystemConfig.getContent()).getBigDecimal("num1")); |
| | | } |
| | | // 2.查询跟该订单相关的分佣收入 |
| | | List<TRevenue> tRevenues = tRevenueMapper.selectList(new EntityWrapper<TRevenue>() |
| | | .eq("type", RevenueTypeEnum.COMMISSION_INCOME.getCode()) |
| | | .eq("orderId", revenueExpenditureResp.getOrderId())); |
| | | Optional<BigDecimal> reduce = tRevenues.stream().map(TRevenue::getAmount).reduce(BigDecimal::add); |
| | | if(reduce.isPresent()){ |
| | | commissionAmount = commissionAmount.add(reduce.get()); |
| | | } |
| | | revenueExpenditureResp.setCommissionAmount(commissionAmount); |
| | | } |
| | | } |
| | | return pageList; |
| | | } |
| | | |
| | | @Override |
| | | public void commissionDetail(String code, Model model) { |
| | | RevenueExpenditureResp revenueExpenditureResp = tRevenueMapper.commissionOrBalanceDetail(code, CashWithdrawalTypeEnum.COMMISSION_WITHDRAWAL.getCode()); |
| | | this.packageModel(revenueExpenditureResp,model); |
| | | } |
| | | |
| | | @Override |
| | | public void balanceDetail(String code, Model model) { |
| | | RevenueExpenditureResp revenueExpenditureResp = tRevenueMapper.commissionOrBalanceDetail(code, CashWithdrawalTypeEnum.BALANCE_WITHDRAWAL.getCode()); |
| | | this.packageModel(revenueExpenditureResp,model); |
| | | } |
| | | |
| | | @Override |
| | | public void packageModel(RevenueExpenditureResp revenueExpenditureResp,Model model) { |
| | | model.addAttribute("code",revenueExpenditureResp.getCode()); |
| | | model.addAttribute("businessTime",new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(revenueExpenditureResp.getBusinessTime())); |
| | | model.addAttribute("businessType",revenueExpenditureResp.getBusinessType()); |
| | | model.addAttribute("driverName",revenueExpenditureResp.getDriverName()); |
| | | model.addAttribute("driverPhone",revenueExpenditureResp.getDriverPhone()); |
| | | model.addAttribute("amount",revenueExpenditureResp.getAmount()); |
| | | model.addAttribute("accountBalance",revenueExpenditureResp.getAccountBalance()); |
| | | } |
| | | |
| | | @Override |
| | | public void orderDetail(String code, Model model) { |
| | | // 查询订单 |
| | | TOrder tOrder = tOrderService.selectOne(new EntityWrapper<TOrder>().eq("code", code) |
| | | .last("LIMIT 1")); |
| | | tOrderService.orderDetail(tOrder.getId(),model); |
| | | // 查询评价 |
| | | TEvaluate tEvaluate = tEvaluateService.selectOne(new EntityWrapper<TEvaluate>().eq("orderId", tOrder.getId())); |
| | | if(Objects.nonNull(tEvaluate)){ |
| | | model.addAttribute("evaluateScore",tEvaluate.getScore()); |
| | | model.addAttribute("evaluateContent",tEvaluate.getEvaluate()); |
| | | }else { |
| | | model.addAttribute("evaluateScore",""); |
| | | model.addAttribute("evaluateContent",""); |
| | | } |
| | | } |
| | | } |
| | |
| | | <div class="row row-lg"> |
| | | <div class="col-sm-12"> |
| | | <div class="row"> |
| | | <div class="col-sm-3"> |
| | | <#NameCon id="condition" name="名称" /> |
| | | <div class="col-sm-2"> |
| | | <#NameCon id="code" name="订单号" /> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <div class="col-sm-2"> |
| | | <select class="input-group" id="businessType" style="width: 180px;height: 33px" name="businessType"> |
| | | <option value="">交易类型</option> |
| | | <option value="1">佣金提现</option> |
| | | <option value="2">余额提现</option> |
| | | <option value="3">支付订单</option> |
| | | </select> |
| | | </div> |
| | | <div class="col-sm-2"> |
| | | <select class="input-group" id="payType" style="width: 180px;height: 33px" name="payType"> |
| | | <option value="">支付渠道</option> |
| | | <option value="1">微信支付</option> |
| | | <option value="2">余额支付</option> |
| | | </select> |
| | | </div> |
| | | <div class="col-sm-2"> |
| | | <#NameCon id="driverName" name="司机姓名" /> |
| | | </div> |
| | | <div class="col-sm-2"> |
| | | <#TimeCon id="businessTime" name="交易时间" /> |
| | | </div> |
| | | <div class="col-sm-2"> |
| | | <#button name="搜索" icon="fa-search" clickFun="TRechargeRecord.search()"/> |
| | | <#button name="重置" icon="fa-trash" clickFun="TRechargeRecord.resetSearch()" space="true"/> |
| | | </div> |
| | | <div class="col-sm-12"> |
| | | <button type="button" class="btn btn-primary " onclick="TRechargeRecord.export()" id="export"> |
| | | <i class="fa "></i> 导出 |
| | | </button> |
| | | </div> |
| | | </div> |
| | | <div class="hidden-xs" id="TRechargeRecordTableToolbar" role="group"> |
| | |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/static/modular/system/tRechargeRecord/tRechargeRecord.js"></script> |
| | | <script type="text/javascript"> |
| | | laydate.render({ |
| | | elem: '#businessTime', |
| | | type: 'date', |
| | | range: true |
| | | }); |
| | | </script> |
| | | @} |
New file |
| | |
| | | @layout("/common/_container.html"){ |
| | | <div class="row"> |
| | | <div class="col-sm-12"> |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-title"> |
| | | <h5>收支明细</h5> |
| | | </div> |
| | | <div class="ibox-content"> |
| | | <div class="row row-lg"> |
| | | <div class="col-sm-12"> |
| | | <div class="row"> |
| | | <div class="col-sm-2"> |
| | | <#NameCon id="code" name="订单号" /> |
| | | </div> |
| | | <div class="col-sm-2"> |
| | | <select class="input-group" id="businessType" style="width: 180px;height: 33px" name="businessType"> |
| | | <option value="">交易类型</option> |
| | | <option value="11">佣金提现</option> |
| | | <option value="12">余额提现</option> |
| | | <option value="1">支付订单</option> |
| | | </select> |
| | | </div> |
| | | <div class="col-sm-2"> |
| | | <select class="input-group" id="payType" style="width: 180px;height: 33px" name="payType"> |
| | | <option value="">支付渠道</option> |
| | | <option value="1">微信支付</option> |
| | | <option value="2">余额支付</option> |
| | | <option value="3">线下收款</option> |
| | | </select> |
| | | </div> |
| | | <div class="col-sm-2"> |
| | | <#NameCon id="driverName" name="司机姓名" /> |
| | | </div> |
| | | <div class="col-sm-2"> |
| | | <#TimeCon id="businessTime" name="交易时间" /> |
| | | </div> |
| | | <div class="col-sm-2"> |
| | | <#button name="搜索" icon="fa-search" clickFun="TRevenue.search()"/> |
| | | <#button name="重置" icon="fa-trash" clickFun="TRevenue.resetSearch()" space="true"/> |
| | | </div> |
| | | <div class="col-sm-12"> |
| | | <button type="button" class="btn btn-primary " onclick="TRevenue.export()" id="export"> |
| | | <i class="fa "></i> 导出 |
| | | </button> |
| | | </div> |
| | | </div> |
| | | <div class="hidden-xs" id="TRevenueTableToolbar" role="group"> |
| | | @if(shiro.hasPermission("/tRevenue/add")){ |
| | | <#button name="添加" icon="fa-plus" clickFun="TRevenue.openAddTRevenue()"/> |
| | | @} |
| | | @if(shiro.hasPermission("/tRevenue/update")){ |
| | | <#button name="修改" icon="fa-edit" clickFun="TRevenue.openTRevenueDetail()" space="true"/> |
| | | @} |
| | | @if(shiro.hasPermission("/tRevenue/delete")){ |
| | | <#button name="删除" icon="fa-remove" clickFun="TRevenue.delete()" space="true"/> |
| | | @} |
| | | </div> |
| | | <#table id="TRevenueTable"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/static/modular/system/tRevenue/tRevenue.js"></script> |
| | | <script type="text/javascript"> |
| | | laydate.render({ |
| | | elem: '#businessTime', |
| | | type: 'date', |
| | | range: true |
| | | }); |
| | | </script> |
| | | @} |
New file |
| | |
| | | @layout("/common/_container.html"){ |
| | | <div class="row"> |
| | | <div class="col-sm-12"> |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-title"> |
| | | <h5>详情</h5> |
| | | </div> |
| | | <div class="ibox-content"> |
| | | <div class="row row-lg"> |
| | | <div class="col-sm-12"> |
| | | |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <label class="control-label" >订单号:</label> |
| | | <label>${code}</label> |
| | | </div> |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <label class="control-label" >交易时间:</label> |
| | | <label>${businessTime}</label> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <label class="control-label" >交易类型:</label> |
| | | @if(businessType==1){ |
| | | <label>支付订单</label> |
| | | @} |
| | | @if(businessType==11){ |
| | | <label>佣金提现</label> |
| | | @} |
| | | @if(businessType==12){ |
| | | <label>余额提现</label> |
| | | @} |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <label class="control-label">司机姓名:</label> |
| | | <label>${driverName}</label> |
| | | </div> |
| | | <div class="initialLevel col-sm-2 control-label form-group" > |
| | | <label class="control-label">司机电话:</label> |
| | | <label>${driverPhone}</label> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <div class="initialLevel col-sm-2 control-label form-group" > |
| | | <label class="control-label">提现金额:</label> |
| | | <label>${amount}</label> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <div class="initialLevel col-sm-2 control-label form-group" > |
| | | <label class="control-label">余额:</label> |
| | | <label>${accountBalance}</label> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="hidden-xs" id="TDriverTableToolbar" role="group" style="text-align: center"> |
| | | <#button name="取消" icon="fa-plus" clickFun="TRevenueInfoDlg.close()" /> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/static/modular/system/tRevenue/tRevenue.js"></script> |
| | | <script src="${ctxPath}/static/modular/system/tRevenue/tRevenue_info.js"></script> |
| | | @} |
New file |
| | |
| | | @layout("/common/_container.html"){ |
| | | <div class="row"> |
| | | <div class="col-sm-12"> |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-title"> |
| | | <h5>详情</h5> |
| | | </div> |
| | | <div class="ibox-content"> |
| | | <div class="row row-lg"> |
| | | <div class="col-sm-12"> |
| | | |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <label class="control-label" >订单号:</label> |
| | | <label>${code}</label> |
| | | </div> |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <label class="control-label" >交易时间:</label> |
| | | <label>${businessTime}</label> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <label class="control-label" >交易类型:</label> |
| | | @if(businessType==1){ |
| | | <label>支付订单</label> |
| | | @} |
| | | @if(businessType==11){ |
| | | <label>佣金提现</label> |
| | | @} |
| | | @if(businessType==12){ |
| | | <label>余额提现</label> |
| | | @} |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <label class="control-label">司机姓名:</label> |
| | | <label>${driverName}</label> |
| | | </div> |
| | | <div class="initialLevel col-sm-2 control-label form-group" > |
| | | <label class="control-label">司机电话:</label> |
| | | <label>${driverPhone}</label> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <div class="initialLevel col-sm-2 control-label form-group" > |
| | | <label class="control-label">提现金额:</label> |
| | | <label>${amount}</label> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <div class="initialLevel col-sm-2 control-label form-group" > |
| | | <label class="control-label">余额:</label> |
| | | <label>${accountBalance}</label> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="hidden-xs" id="TDriverTableToolbar" role="group" style="text-align: center"> |
| | | <#button name="取消" icon="fa-plus" clickFun="TRevenueInfoDlg.close()" /> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/static/modular/system/tRevenue/tRevenue.js"></script> |
| | | <script src="${ctxPath}/static/modular/system/tRevenue/tRevenue_info.js"></script> |
| | | @} |
New file |
| | |
| | | @layout("/common/_container.html"){ |
| | | <div class="row"> |
| | | <div class="col-sm-12"> |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-title"> |
| | | <h5>详情</h5> |
| | | </div> |
| | | <div class="ibox-content"> |
| | | <div class="row row-lg"> |
| | | <div class="col-sm-12"> |
| | | |
| | | <hr/> |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <div style="background-color: gray;height: 35px;line-height: 35px"> |
| | | <label style="color: #0C0C0C">订单支付详情</label> |
| | | </div> |
| | | </div> |
| | | <hr/> |
| | | |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <label class="control-label" >下单时间:</label> |
| | | <label>${createTime}</label> |
| | | </div> |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <label class="control-label" >订单编号:</label> |
| | | <label>${code}</label> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <label class="control-label" >乘车时间:</label> |
| | | <label>${startTime}</label> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="initialLevel col-sm-12 control-label form-group" style="color: green" > |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <label class="control-label" >下单用户昵称:</label> |
| | | <label>${userName}</label> |
| | | </div> |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <label class="control-label" >下单用户手机号:</label> |
| | | <label>${userPhone}</label> |
| | | </div> |
| | | </div> |
| | | |
| | | <hr/> |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <div style="background-color: gray;height: 35px;line-height: 35px"> |
| | | <label style="color: #0C0C0C">上下地点</label> |
| | | </div> |
| | | </div> |
| | | <hr/> |
| | | |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <label class="control-label">起点:</label> |
| | | <label>${startAddress}</label> |
| | | </div> |
| | | <div class="initialLevel col-sm-2 control-label form-group" > |
| | | <label class="control-label">终点:</label> |
| | | <label>${endAddress}</label> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="initialLevel col-sm-12 control-label form-group" style="color:red;" > |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <label class="control-label">司机姓名:</label> |
| | | <label>${driverName}</label> |
| | | </div> |
| | | <div class="initialLevel col-sm-2 control-label form-group" > |
| | | <label class="control-label">司机电话:</label> |
| | | <label>${driverPhone}</label> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <label class="control-label" >上车地点:</label> |
| | | <label>${startAddress}</label> |
| | | </div> |
| | | <div class="initialLevel col-sm-2 control-label form-group" > |
| | | <label class="control-label">上车时间:</label> |
| | | <label>${boardingTime}</label> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <label class="control-label" >下车地点:</label> |
| | | <label>${endAddress}</label> |
| | | </div> |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <label class="control-label" >下车时间:</label> |
| | | <label>${getoffTime}</label> |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | <hr/> |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <div style="background-color: gray;height: 35px;line-height: 35px"> |
| | | <label style="color: #0C0C0C">费用明细</label> |
| | | </div> |
| | | </div> |
| | | <hr/> |
| | | |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <div class="initialLevel col-sm-2 control-label form-group" > |
| | | <label class="control-label" >起步价:</label> |
| | | <label>${startPrice}</label> |
| | | </div> |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <label class="control-label" >等待费:</label> |
| | | <label>${waitTimePrice}</label> |
| | | </div> |
| | | </div> |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <div class="initialLevel col-sm-2 control-label form-group" > |
| | | <label class="control-label" >里程费:</label> |
| | | <label>${overDrivePrice}</label> |
| | | </div> |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <label class="control-label" >恶劣天气:</label> |
| | | <label>${badWeatherPrice}</label> |
| | | </div> |
| | | </div> |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <div class="initialLevel col-sm-2 control-label form-group" > |
| | | <label class="control-label" >实际费用:</label> |
| | | <label>${orderMoney}</label> |
| | | </div> |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <label class="control-label" >实际支付费用:</label> |
| | | <label>${payMoney}</label> |
| | | </div> |
| | | </div> |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <div class="initialLevel col-sm-2 control-label form-group" > |
| | | <label class="control-label" >优惠券抵扣费用:</label> |
| | | <label>${discountedPrice}</label> |
| | | </div> |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <label class="control-label" >支付方式:</label> |
| | | @if(payType==1){ |
| | | <label>微信支付</label> |
| | | @} |
| | | @if(payType==2){ |
| | | <label>余额支付</label> |
| | | @} |
| | | @if(payType==3){ |
| | | <label>线下收款</label> |
| | | @} |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | <hr/> |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <div style="background-color: gray;height: 35px;line-height: 35px"> |
| | | <label style="color: #0C0C0C">评论详情</label> |
| | | </div> |
| | | </div> |
| | | <hr/> |
| | | |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <div class="initialLevel col-sm-2 control-label form-group" > |
| | | <label class="control-label" >评论分数:</label> |
| | | @if(evaluateScore==1){ |
| | | <label>非常差</label> |
| | | @} |
| | | @if(evaluateScore==2){ |
| | | <label>差</label> |
| | | @} |
| | | @if(evaluateScore==3){ |
| | | <label>一般</label> |
| | | @} |
| | | @if(evaluateScore==4){ |
| | | <label>满意</label> |
| | | @} |
| | | @if(evaluateScore==5){ |
| | | <label>非常满意</label> |
| | | @} |
| | | </div> |
| | | </div> |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <label class="control-label" >评论内容:</label> |
| | | <label>${evaluateContent}</label> |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | <div class="hidden-xs" id="TDriverTableToolbar" role="group" style="text-align: center"> |
| | | <#button name="取消" icon="fa-plus" clickFun="TRevenueInfoDlg.close()" /> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/static/modular/system/tRevenue/tRevenue.js"></script> |
| | | <script src="${ctxPath}/static/modular/system/tRevenue/tRevenue_info.js"></script> |
| | | @} |
New file |
| | |
| | | @layout("/common/_container.html"){ |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-content"> |
| | | <div class="form-horizontal"> |
| | | |
| | | <div class="row"> |
| | | <div class="col-sm-6 b-r"> |
| | | <#input id="id" name="主键" underline="true"/> |
| | | <#input id="type" name="收入类型(1=订单收入,2=分佣收入)" underline="true"/> |
| | | <#input id="userType" name="用户类型(1=用户,2=司机,3=代理商)" underline="true"/> |
| | | <#input id="userId" name="用户id"/> |
| | | </div> |
| | | |
| | | <div class="col-sm-6"> |
| | | <#input id="orderId" name="订单id" underline="true"/> |
| | | <#input id="amount" name="收入金额" underline="true"/> |
| | | <#input id="createTime" name="添加时间" underline="true"/> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="row btn-group-m-t"> |
| | | <div class="col-sm-10"> |
| | | <#button btnCss="info" name="提交" id="ensure" icon="fa-check" clickFun="TRevenueInfoDlg.addSubmit()"/> |
| | | <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" clickFun="TRevenueInfoDlg.close()"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/static/modular/system/tRevenue/tRevenue_info.js"></script> |
| | | @} |
New file |
| | |
| | | @layout("/common/_container.html"){ |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-content"> |
| | | <div class="form-horizontal"> |
| | | |
| | | <div class="row"> |
| | | <div class="col-sm-6 b-r"> |
| | | <#input id="id" name="主键" value="${item.id}" underline="true"/> |
| | | <#input id="type" name="收入类型(1=订单收入,2=分佣收入)" value="${item.type}" underline="true"/> |
| | | <#input id="userType" name="用户类型(1=用户,2=司机,3=代理商)" value="${item.userType}" underline="true"/> |
| | | <#input id="userId" name="用户id" value="${item.userId}" /> |
| | | </div> |
| | | |
| | | <div class="col-sm-6"> |
| | | <#input id="orderId" name="订单id" value="${item.orderId}" underline="true"/> |
| | | <#input id="amount" name="收入金额" value="${item.amount}" underline="true"/> |
| | | <#input id="createTime" name="添加时间" value="${item.createTime}" /> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="row btn-group-m-t"> |
| | | <div class="col-sm-10"> |
| | | <#button btnCss="info" name="提交" id="ensure" icon="fa-check" clickFun="TRevenueInfoDlg.editSubmit()"/> |
| | | <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" clickFun="TRevenueInfoDlg.close()"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/static/modular/system/tRevenue/tRevenue_info.js"></script> |
| | | @} |
New file |
| | |
| | | /** |
| | | * 管理初始化 |
| | | */ |
| | | var TRevenue = { |
| | | id: "TRevenueTable", //表格id |
| | | seItem: null, //选中的条目 |
| | | table: null, |
| | | layerIndex: -1 |
| | | }; |
| | | |
| | | /** |
| | | * 初始化表格的列 |
| | | */ |
| | | TRevenue.initColumn = function () { |
| | | return [ |
| | | {field: 'selectItem', radio: true}, |
| | | {title: '主键', field: 'id', visible: false, align: 'center', valign: 'middle'}, |
| | | {title: '收入类型(1=订单收入,2=分佣收入)', field: 'type', visible: false, align: 'center', valign: 'middle'}, |
| | | {title: '用户类型(1=用户,2=司机,3=代理商)', field: 'userType', visible: false, align: 'center', valign: 'middle'}, |
| | | {title: '用户id', field: 'userId', visible: false, align: 'center', valign: 'middle'}, |
| | | {title: '订单id', field: 'orderId', visible: false, align: 'center', valign: 'middle'}, |
| | | {title: '收入金额', field: 'amount', visible: false, align: 'center', valign: 'middle'}, |
| | | {title: '添加时间', field: 'createTime', visible: false, align: 'center', valign: 'middle'}, |
| | | |
| | | {title: '订单号', field: 'code', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '交易时间', field: 'businessTime', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '交易类型', field: 'businessType', visible: true, align: 'center', valign: 'middle', |
| | | formatter: function (value, row) { |
| | | if (row.businessType === 1){ |
| | | return '<span>支付订单</span>' |
| | | }else if (row.businessType === 11){ |
| | | return '<span>佣金提现</span>' |
| | | }else if (row.businessType === 12){ |
| | | return '<span>余额提现</span>' |
| | | } |
| | | } |
| | | }, |
| | | {title: '司机姓名', field: 'driverName', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '司机电话', field: 'driverPhone', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '支付类型', field: 'payType', visible: true, align: 'center', valign: 'middle', |
| | | formatter: function (value, row) { |
| | | if (row.payType === 1){ |
| | | return '<span>微信支付</span>' |
| | | }else if (row.payType === 2){ |
| | | return '<span>余额支付</span>' |
| | | }else if (row.payType === 3){ |
| | | return '<span>线下收款</span>' |
| | | }else if (row.payType === 0){ |
| | | return '' |
| | | } |
| | | } |
| | | }, |
| | | {title: '金额', field: 'amount', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '佣金提成', field: 'commissionAmount', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '优惠券', field: 'discountedPrice', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '余额', field: 'accountBalance', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '状态', field: 'state', visible: true, align: 'center', valign: 'middle', |
| | | formatter: function (value, row) { |
| | | if (row.state === 2){ |
| | | return '<span>完成</span>' |
| | | }else if (row.state === 108){ |
| | | return '<span>完成</span>' |
| | | }else if (row.state === 109){ |
| | | return '<span>完成</span>' |
| | | } |
| | | } |
| | | }, |
| | | {title: '操作', visible: true, align: 'center', valign: 'middle',width:150, |
| | | formatter: function (value, row) { |
| | | if (row.businessType === 1){ |
| | | return '<a href="#" onclick="TRevenue.searchTRevenueOrderDetail('+row.code+')" style="color:blue">详情</a>' |
| | | }else if (row.businessType === 11){ |
| | | return '<a href="#" onclick="TRevenue.searchTRevenueCommissionDetail('+row.code+')" style="color:blue">详情</a>' |
| | | }else if (row.businessType === 12){ |
| | | return '<a href="#" onclick="TRevenue.searchTRevenueBalanceDetail('+row.code+')" style="color:blue">详情</a>' |
| | | } |
| | | } |
| | | } |
| | | ]; |
| | | }; |
| | | |
| | | /** |
| | | * 检查是否选中 |
| | | */ |
| | | TRevenue.check = function () { |
| | | var selected = $('#' + this.id).bootstrapTable('getSelections'); |
| | | if(selected.length == 0){ |
| | | Feng.info("请先选中表格中的某一记录!"); |
| | | return false; |
| | | }else{ |
| | | TRevenue.seItem = selected[0]; |
| | | return true; |
| | | } |
| | | }; |
| | | |
| | | /** |
| | | * 点击添加 |
| | | */ |
| | | TRevenue.openAddTRevenue = function () { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: '添加', |
| | | area: ['800px', '420px'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tRevenue/tRevenue_add' |
| | | }); |
| | | this.layerIndex = index; |
| | | }; |
| | | |
| | | /** |
| | | * 打开查看详情 |
| | | */ |
| | | TRevenue.openTRevenueDetail = function () { |
| | | if (this.check()) { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: '详情', |
| | | area: ['800px', '420px'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tRevenue/tRevenue_update/' + TRevenue.seItem.id |
| | | }); |
| | | this.layerIndex = index; |
| | | } |
| | | }; |
| | | |
| | | /** |
| | | * 打开查看佣金提现详情(使用中) |
| | | */ |
| | | TRevenue.searchTRevenueCommissionDetail = function (code) { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: '佣金提现详情', |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tRevenue/commissionDetail?code=' + code |
| | | }); |
| | | this.layerIndex = index; |
| | | }; |
| | | |
| | | /** |
| | | * 打开查看余额提现详情(使用中) |
| | | */ |
| | | TRevenue.searchTRevenueBalanceDetail = function (code) { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: '余额提现详情', |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tRevenue/balanceDetail?code=' + code |
| | | }); |
| | | this.layerIndex = index; |
| | | }; |
| | | |
| | | /** |
| | | * 打开查看支付订单详情(使用中) |
| | | */ |
| | | TRevenue.searchTRevenueOrderDetail = function (code) { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: '支付订单详情', |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tRevenue/orderDetail?code=' + code |
| | | }); |
| | | this.layerIndex = index; |
| | | }; |
| | | |
| | | /** |
| | | * 删除 |
| | | */ |
| | | TRevenue.delete = function () { |
| | | if (this.check()) { |
| | | var ajax = new $ax(Feng.ctxPath + "/tRevenue/delete", function (data) { |
| | | Feng.success("删除成功!"); |
| | | TRevenue.table.refresh(); |
| | | }, function (data) { |
| | | Feng.error("删除失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set("tRevenueId",this.seItem.id); |
| | | ajax.start(); |
| | | } |
| | | }; |
| | | |
| | | /** |
| | | * 司机信息导出 |
| | | */ |
| | | TRevenue.export=function(){ |
| | | var code=$("#code").val() |
| | | var businessType=$("#businessType").val() |
| | | var payType=$("#payType").val() |
| | | var driverName=$("#driverName").val() |
| | | var businessTime=$("#businessTime").val() |
| | | window.location.href=Feng.ctxPath + "/tRevenue/export?code="+code |
| | | +"&businessType="+businessType |
| | | +"&payType="+payType |
| | | +"&driverName="+driverName |
| | | +"&businessTime="+businessTime |
| | | ; |
| | | } |
| | | |
| | | /** |
| | | * 查询列表 |
| | | */ |
| | | TRevenue.search = function () { |
| | | var queryData = {}; |
| | | queryData['code'] = $("#code").val(); |
| | | queryData['businessType'] = $("#businessType").val(); |
| | | queryData['payType'] = $("#payType").val(); |
| | | queryData['driverName'] = $("#driverName").val(); |
| | | queryData['businessTime'] = $("#businessTime").val(); |
| | | TRevenue.table.refresh({query: queryData}); |
| | | }; |
| | | |
| | | /** |
| | | * 重置 |
| | | */ |
| | | TRevenue.resetSearch = function (){ |
| | | $("#code").val(''); |
| | | $("#businessType").val(''); |
| | | $("#payType").val(''); |
| | | $("#driverName").val(''); |
| | | $("#businessTime").val(''); |
| | | TRevenue.search(); |
| | | } |
| | | |
| | | $(function () { |
| | | var defaultColunms = TRevenue.initColumn(); |
| | | var table = new BSTable(TRevenue.id, "/tRevenue/list", defaultColunms); |
| | | table.setPaginationType("client"); |
| | | TRevenue.table = table.init(); |
| | | }); |
New file |
| | |
| | | /** |
| | | * 初始化详情对话框 |
| | | */ |
| | | var TRevenueInfoDlg = { |
| | | tRevenueInfoData : {} |
| | | }; |
| | | |
| | | /** |
| | | * 清除数据 |
| | | */ |
| | | TRevenueInfoDlg.clearData = function() { |
| | | this.tRevenueInfoData = {}; |
| | | } |
| | | |
| | | /** |
| | | * 设置对话框中的数据 |
| | | * |
| | | * @param key 数据的名称 |
| | | * @param val 数据的具体值 |
| | | */ |
| | | TRevenueInfoDlg.set = function(key, val) { |
| | | this.tRevenueInfoData[key] = (typeof val == "undefined") ? $("#" + key).val() : val; |
| | | return this; |
| | | } |
| | | |
| | | /** |
| | | * 设置对话框中的数据 |
| | | * |
| | | * @param key 数据的名称 |
| | | * @param val 数据的具体值 |
| | | */ |
| | | TRevenueInfoDlg.get = function(key) { |
| | | return $("#" + key).val(); |
| | | } |
| | | |
| | | /** |
| | | * 关闭此对话框 |
| | | */ |
| | | TRevenueInfoDlg.close = function() { |
| | | parent.layer.close(window.parent.TRevenue.layerIndex); |
| | | } |
| | | |
| | | /** |
| | | * 收集数据 |
| | | */ |
| | | TRevenueInfoDlg.collectData = function() { |
| | | this |
| | | .set('id') |
| | | .set('type') |
| | | .set('userType') |
| | | .set('userId') |
| | | .set('orderId') |
| | | .set('amount') |
| | | .set('createTime'); |
| | | } |
| | | |
| | | /** |
| | | * 提交添加 |
| | | */ |
| | | TRevenueInfoDlg.addSubmit = function() { |
| | | |
| | | this.clearData(); |
| | | this.collectData(); |
| | | |
| | | //提交信息 |
| | | var ajax = new $ax(Feng.ctxPath + "/tRevenue/add", function(data){ |
| | | Feng.success("添加成功!"); |
| | | window.parent.TRevenue.table.refresh(); |
| | | TRevenueInfoDlg.close(); |
| | | },function(data){ |
| | | Feng.error("添加失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set(this.tRevenueInfoData); |
| | | ajax.start(); |
| | | } |
| | | |
| | | /** |
| | | * 提交修改 |
| | | */ |
| | | TRevenueInfoDlg.editSubmit = function() { |
| | | |
| | | this.clearData(); |
| | | this.collectData(); |
| | | |
| | | //提交信息 |
| | | var ajax = new $ax(Feng.ctxPath + "/tRevenue/update", function(data){ |
| | | Feng.success("修改成功!"); |
| | | window.parent.TRevenue.table.refresh(); |
| | | TRevenueInfoDlg.close(); |
| | | },function(data){ |
| | | Feng.error("修改失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set(this.tRevenueInfoData); |
| | | ajax.start(); |
| | | } |
| | | |
| | | $(function() { |
| | | |
| | | }); |