| | |
| | | package com.stylefeng.guns.modular.system.controller; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.stylefeng.guns.core.base.controller.BaseController; |
| | | import com.stylefeng.guns.core.common.constant.factory.PageFactory; |
| | |
| | | import com.stylefeng.guns.core.util.DateUtil; |
| | | import com.stylefeng.guns.core.util.ExcelExportUtil; |
| | | import com.stylefeng.guns.core.util.SinataUtil; |
| | | import com.stylefeng.guns.modular.system.model.Income; |
| | | import com.stylefeng.guns.modular.system.service.IIncomeService; |
| | | import com.stylefeng.guns.modular.system.model.*; |
| | | import com.stylefeng.guns.modular.system.service.*; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.math.BigDecimal; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * 控制器 |
| | |
| | | |
| | | @Autowired |
| | | private IIncomeService tIncomeService; |
| | | @Autowired |
| | | private ITOrderPrivateCarService orderPrivateCarService; |
| | | @Autowired |
| | | private ITPubTransactionDetailsService pubTransactionDetailsService; |
| | | @Autowired |
| | | private ITPubWithdrawalService pubWithdrawalService; |
| | | @Autowired |
| | | private ITDriverService driverService; |
| | | |
| | | /** |
| | | * 跳转到首页 |
| | |
| | | public String index(Integer id, Model model) { |
| | | model.addAttribute("id", id); |
| | | return PREFIX + "tIncome.html"; |
| | | } |
| | | @RequestMapping("/balance") |
| | | public String balance(Integer id, Model model) { |
| | | model.addAttribute("id", id); |
| | | return PREFIX + "balance.html"; |
| | | } |
| | | |
| | | @RequestMapping("driverWork") |
| | |
| | | page.setRecords(tIncomeService.getList(page,id)); |
| | | return super.packForBT(page); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 司机余额修改 |
| | | */ |
| | | @RequestMapping(value = "/changeMoney") |
| | | @ResponseBody |
| | | public Object oneChange(Integer id ,Integer type,String mount,String remark) { |
| | | TDriver tDriver = driverService.selectById(id); |
| | | TPubTransactionDetails tPubTransactionDetails = new TPubTransactionDetails(); |
| | | tPubTransactionDetails.setUserId(tDriver.getId()); |
| | | tPubTransactionDetails.setInsertTime(new Date()); |
| | | tPubTransactionDetails.setRemark(remark); |
| | | tPubTransactionDetails.setMoney(new BigDecimal(mount)); |
| | | tPubTransactionDetails.setState(type); |
| | | tPubTransactionDetails.setType(1); |
| | | tPubTransactionDetails.setUserType(2); |
| | | switch ( type){ |
| | | case 1: |
| | | tPubTransactionDetails.setOrderType(6); |
| | | break; |
| | | case 2: |
| | | tPubTransactionDetails.setOrderType(7); |
| | | break; |
| | | } |
| | | pubTransactionDetailsService.insert(tPubTransactionDetails); |
| | | // type=1增加 type=2减少 |
| | | switch (type){ |
| | | case 1: |
| | | BigDecimal bigDecimal = new BigDecimal(mount); |
| | | |
| | | BigDecimal add = tDriver.getBalance().add(bigDecimal); |
| | | tDriver.setBalance(add); |
| | | break; |
| | | case 2: |
| | | BigDecimal bigDecimal1 = new BigDecimal(mount); |
| | | BigDecimal subtract = tDriver.getBalance().subtract(bigDecimal1); |
| | | int comparisonResult = subtract.compareTo(BigDecimal.ZERO); |
| | | // 小于0 设置为0 不要为负数 |
| | | if (comparisonResult<0){ |
| | | // tDriver.setBalance(BigDecimal.ZERO); |
| | | |
| | | return 502; |
| | | }else{ |
| | | tDriver.setBalance(subtract); |
| | | } |
| | | break; |
| | | } |
| | | driverService.updateById(tDriver); |
| | | return SUCCESS_TIP; |
| | | } |
| | | /** |
| | | * 余额明细列表 |
| | | */ |
| | | @RequestMapping(value = "/listBalance") |
| | | @ResponseBody |
| | | public Object list(Integer id,String insertTime ,Integer handleType) { |
| | | String beginTime = null; |
| | | String endTime = null; |
| | | if (SinataUtil.isNotEmpty(insertTime)){ |
| | | String[] timeArray = insertTime.split(" - "); |
| | | beginTime = timeArray[0]; |
| | | endTime = timeArray[1]; |
| | | } |
| | | List<TOrderPrivateCar> tOrderPrivateCars = orderPrivateCarService.selectList(null); |
| | | |
| | | List<Map<String, Object>> res = new ArrayList<>(); |
| | | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | |
| | | // 跑单收入 |
| | | if (handleType == null || handleType == 1){ |
| | | Wrapper<Income> eq = new EntityWrapper<Income>() |
| | | .eq("objectId", id) |
| | | .eq("type", 2) |
| | | .eq("userType", 2); |
| | | if (beginTime!=null){ |
| | | eq.ge("insertTime", beginTime); |
| | | eq.le("insertTime", endTime); |
| | | } |
| | | List<Income> incomes = tIncomeService.selectList(eq); |
| | | for (Income income : incomes) { |
| | | Map<String, Object> temp = new HashMap<>(); |
| | | String times = simpleDateFormat.format(income.getInsertTime()); |
| | | if (income.getIncomeId()!=null){ |
| | | TOrderPrivateCar tOrderPrivateCar = tOrderPrivateCars.stream().filter(e -> e.getId() |
| | | .equals(income.getIncomeId())).findFirst().orElse(null); |
| | | temp.put("orderNumber",tOrderPrivateCar==null?null:tOrderPrivateCar.getOrderNum()); |
| | | temp.put("remark",tOrderPrivateCar.getRemark()); |
| | | } |
| | | temp.put("times",times); |
| | | temp.put("handleType","车费收入"); |
| | | temp.put("amount",income.getMoney()); |
| | | temp.put("withType","订单号"); |
| | | // todo 新增收入明细时 需要存储当前账户余额 |
| | | temp.put("balance",0); |
| | | res.add(temp); |
| | | } |
| | | } |
| | | // 司机专车订单ids |
| | | List<Integer> orderIds = orderPrivateCarService.selectList(new EntityWrapper<TOrderPrivateCar>() |
| | | .eq("driverId", id)).stream() |
| | | .map(TOrderPrivateCar::getId).collect(Collectors.toList()); |
| | | if (orderIds.isEmpty()){ |
| | | orderIds.add(-1); |
| | | } |
| | | // 车费平台手续费扣除 |
| | | if (handleType == null || handleType == 2){ |
| | | Wrapper<Income> eq = new EntityWrapper<Income>() |
| | | .eq("type", 2) |
| | | .in("incomeId",orderIds) |
| | | .eq("userType", 1); |
| | | if (beginTime!=null){ |
| | | eq.ge("insertTime", beginTime); |
| | | eq.le("insertTime", endTime); |
| | | } |
| | | List<Income> incomes = tIncomeService.selectList(eq); |
| | | for (Income income : incomes) { |
| | | Map<String, Object> temp = new HashMap<>(); |
| | | String times = simpleDateFormat.format(income.getInsertTime()); |
| | | if (income.getIncomeId()!=null){ |
| | | TOrderPrivateCar tOrderPrivateCar = tOrderPrivateCars.stream().filter(e -> e.getId() |
| | | .equals(income.getIncomeId())).findFirst().orElse(null); |
| | | temp.put("orderNumber",tOrderPrivateCar==null?null:tOrderPrivateCar.getOrderNum()); |
| | | temp.put("remark",tOrderPrivateCar==null?"":tOrderPrivateCar.getRemark()); |
| | | } |
| | | temp.put("times",times); |
| | | temp.put("handleType","车费平台手续费扣除"); |
| | | temp.put("amount",income.getMoney()); |
| | | temp.put("withType","订单号"); |
| | | // todo 新增收入明细时 需要存储当前账户余额 |
| | | temp.put("balance",0); |
| | | res.add(temp); |
| | | } |
| | | } |
| | | // 充值 |
| | | if (handleType == null || handleType == 3){ |
| | | Wrapper<TPubTransactionDetails> eq = new EntityWrapper<TPubTransactionDetails>() |
| | | .eq("userId", id) |
| | | .eq("orderType", 5) |
| | | .eq("userType", 2); |
| | | if (beginTime!=null){ |
| | | eq.ge("insertTime", beginTime); |
| | | eq.le("insertTime", endTime); |
| | | } |
| | | List<TPubTransactionDetails> pubTransactionDetails = pubTransactionDetailsService.selectList(eq); |
| | | for (TPubTransactionDetails details : pubTransactionDetails) { |
| | | Map<String, Object> temp = new HashMap<>(); |
| | | String times = simpleDateFormat.format(details.getInsertTime()); |
| | | temp.put("orderNumber",""); |
| | | temp.put("remark",""); |
| | | temp.put("times",times); |
| | | temp.put("handleType","充值"); |
| | | temp.put("amount",details.getMoney()); |
| | | temp.put("withType","交易流水号"); |
| | | // todo 新增收入明细时 需要存储当前账户余额 |
| | | temp.put("balance",0); |
| | | res.add(temp); |
| | | } |
| | | } |
| | | // 提现 |
| | | if (handleType == null || handleType == 4){ |
| | | Wrapper<TPubWithdrawal> eq = new EntityWrapper<TPubWithdrawal>() |
| | | .eq("userId", id) |
| | | .eq("state", 2) |
| | | .eq("userType", 2); |
| | | if (beginTime!=null){ |
| | | eq.ge("insertTime", beginTime); |
| | | eq.le("insertTime", endTime); |
| | | } |
| | | List<TPubWithdrawal> pubTransactionDetails = pubWithdrawalService.selectList(eq); |
| | | for (TPubWithdrawal details : pubTransactionDetails) { |
| | | Map<String, Object> temp = new HashMap<>(); |
| | | String times = simpleDateFormat.format(details.getInsertTime()); |
| | | temp.put("orderNumber",details.getOrderNumber()); |
| | | temp.put("remark",details.getRemark()); |
| | | temp.put("times",times); |
| | | temp.put("handleType","提现"); |
| | | temp.put("amount",details.getMoney()); |
| | | temp.put("withType","交易流水号"); |
| | | // todo 新增收入明细时 需要存储当前账户余额 |
| | | temp.put("balance",0); |
| | | res.add(temp); |
| | | } |
| | | } |
| | | // 平台充值 |
| | | if (handleType == null || handleType == 6){ |
| | | Wrapper<TPubTransactionDetails> eq = new EntityWrapper<TPubTransactionDetails>() |
| | | .eq("userId", id) |
| | | .eq("orderType", 6) |
| | | .eq("userType", 2); |
| | | if (beginTime!=null){ |
| | | eq.ge("insertTime", beginTime); |
| | | eq.le("insertTime", endTime); |
| | | } |
| | | List<TPubTransactionDetails> pubTransactionDetails = pubTransactionDetailsService.selectList(eq); |
| | | for (TPubTransactionDetails details : pubTransactionDetails) { |
| | | Map<String, Object> temp = new HashMap<>(); |
| | | String times = simpleDateFormat.format(details.getInsertTime()); |
| | | temp.put("orderNumber",""); |
| | | temp.put("remark",""); |
| | | temp.put("times",times); |
| | | temp.put("handleType","平台充值"); |
| | | temp.put("amount",details.getMoney()); |
| | | temp.put("withType","无"); |
| | | // todo 新增收入明细时 需要存储当前账户余额 |
| | | temp.put("balance",0); |
| | | res.add(temp); |
| | | } |
| | | } |
| | | // 平台扣除 |
| | | if (handleType == null || handleType == 7){ |
| | | Wrapper<TPubTransactionDetails> eq = new EntityWrapper<TPubTransactionDetails>() |
| | | .eq("userId", id) |
| | | .eq("orderType", 7) |
| | | .eq("userType", 2); |
| | | if (beginTime!=null){ |
| | | eq.ge("insertTime", beginTime); |
| | | eq.le("insertTime", endTime); |
| | | } |
| | | List<TPubTransactionDetails> pubTransactionDetails = pubTransactionDetailsService.selectList(eq); |
| | | for (TPubTransactionDetails details : pubTransactionDetails) { |
| | | Map<String, Object> temp = new HashMap<>(); |
| | | String times = simpleDateFormat.format(details.getInsertTime()); |
| | | |
| | | temp.put("orderNumber",""); |
| | | temp.put("remark",""); |
| | | temp.put("times",times); |
| | | temp.put("handleType","平台扣除"); |
| | | temp.put("amount",details.getMoney()); |
| | | temp.put("withType","无"); |
| | | // todo 新增收入明细时 需要存储当前账户余额 |
| | | temp.put("balance",0); |
| | | res.add(temp); |
| | | } |
| | | } |
| | | return res; |
| | | } |
| | | @RequestMapping("/getExcel") |
| | | @ResponseBody |
| | | public void getExcel( |
| | |
| | | import com.stylefeng.guns.core.util.ExcelExportUtil; |
| | | import com.stylefeng.guns.core.util.SinataUtil; |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | import com.stylefeng.guns.modular.system.model.Income; |
| | | import com.stylefeng.guns.modular.system.model.TCompany; |
| | | import com.stylefeng.guns.modular.system.model.TOrderPrivateCar; |
| | | import com.stylefeng.guns.modular.system.service.*; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | | import org.apache.poi.hssf.usermodel.HSSFWorkbook; |
| | |
| | | import javax.servlet.ServletOutputStream; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.math.BigDecimal; |
| | | import java.net.URLEncoder; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * 报表控制器 |
| | |
| | | |
| | | @Autowired |
| | | private ITDriverService driverService; |
| | | @Autowired |
| | | private IIncomeService incomeService; |
| | | @Autowired |
| | | private ITOrderPrivateCarService orderPrivateCarService; |
| | | |
| | | |
| | | |
| | |
| | | */ |
| | | @ResponseBody |
| | | @RequestMapping(value = "/queryDriverIncomeData", method = RequestMethod.POST) |
| | | public Object queryDriverIncomeData(Integer type, String time, Integer companyId){ |
| | | public Object queryDriverIncomeData(String driverName, String time, Integer companyId){ |
| | | try { |
| | | String start = null; |
| | | String end = null; |
| | |
| | | end = time.split(" - ")[1]; |
| | | } |
| | | Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); |
| | | page.setRecords(driverService.queryDriverIncomeData(page,type,start,end,companyId)); |
| | | List<Map<String, Object>> maps = driverService.queryDriverIncomeData(page, driverName, start, end, companyId); |
| | | EntityWrapper<Income> incomeEntityWrapper = new EntityWrapper<>(); |
| | | incomeEntityWrapper.eq("type",2); |
| | | incomeEntityWrapper.isNotNull("money"); |
| | | if (start!=null){ |
| | | incomeEntityWrapper.ge("insertTime", start); |
| | | incomeEntityWrapper.le("insertTime", end); |
| | | } |
| | | |
| | | List<Income> incomes = incomeService.selectList( |
| | | incomeEntityWrapper |
| | | ); |
| | | EntityWrapper<TOrderPrivateCar> driverEntityWrapper = new EntityWrapper<>(); |
| | | driverEntityWrapper.isNotNull("driverId"); |
| | | if (start!=null){ |
| | | driverEntityWrapper.ge("insertTime", start); |
| | | driverEntityWrapper.le("insertTime", end); |
| | | } |
| | | List<TOrderPrivateCar> tOrderPrivateCars = orderPrivateCarService.selectList(driverEntityWrapper); |
| | | |
| | | for (Map<String, Object> map : maps) { |
| | | Double driverMoney = 0.0; |
| | | Double platformMoney = 0.0; |
| | | |
| | | // 司机跑单收入 |
| | | List<Income> driver = incomes.stream().filter(e -> e.getUserType().equals(2) |
| | | &&map.get("id").toString().equals(e.getObjectId().toString())).collect(Collectors.toList()); |
| | | for (Income income : driver) { |
| | | driverMoney+=income.getMoney(); |
| | | } |
| | | String driverId = map.get("id").toString(); |
| | | // 查询司机订单 |
| | | List<Integer> orderIds = tOrderPrivateCars.stream().filter(e -> e.getDriverId().equals(Integer.parseInt(driverId))) |
| | | .map(TOrderPrivateCar::getId).collect(Collectors.toList()); |
| | | // 平台收入 |
| | | List<Income> platform = incomes.stream().filter(e -> e.getUserType().equals(1) |
| | | && orderIds.contains(e.getObjectId())).collect(Collectors.toList()); |
| | | for (Income income : platform) { |
| | | platformMoney+=income.getMoney(); |
| | | } |
| | | // driverMoney保留两位小数 |
| | | driverMoney = new BigDecimal(driverMoney).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); |
| | | platformMoney = new BigDecimal(platformMoney).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); |
| | | map.put("driverMoney", driverMoney); |
| | | map.put("platformMoney", platformMoney); |
| | | } |
| | | page.setRecords(maps); |
| | | return super.packForBT(page); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | |
| | | * 导出司机收益排行 |
| | | * @author yxh |
| | | * @date 2021/4/7 9:32 |
| | | * @param type |
| | | * @param driverName |
| | | * @param time |
| | | * @param companyId |
| | | * @param response |
| | | */ |
| | | @RequestMapping(value = "/downloadDriverIncomeData", method = RequestMethod.GET) |
| | | public void downloadDriverIncomeData(Integer type, String time, Integer companyId, HttpServletRequest request, HttpServletResponse response){ |
| | | public void downloadDriverIncomeData(String driverName, String time, Integer companyId, HttpServletRequest request, HttpServletResponse response){ |
| | | String start = null; |
| | | String end = null; |
| | | if(ToolUtil.isNotEmpty(time)){ |
| | | start = time.split(" - ")[0]; |
| | | end = time.split(" - ")[1]; |
| | | } |
| | | List<Map<String, Object>> list = driverService.queryDriverIncomeDataNoPage(type,start,end,companyId); |
| | | List<Map<String, Object>> list = driverService.queryDriverIncomeDataNoPage(driverName,start,end,companyId); |
| | | EntityWrapper<Income> incomeEntityWrapper = new EntityWrapper<>(); |
| | | incomeEntityWrapper.eq("type",2); |
| | | incomeEntityWrapper.isNotNull("money"); |
| | | if (start!=null){ |
| | | incomeEntityWrapper.ge("insertTime", start); |
| | | incomeEntityWrapper.le("insertTime", end); |
| | | } |
| | | |
| | | List<Income> incomes = incomeService.selectList( |
| | | incomeEntityWrapper |
| | | ); |
| | | EntityWrapper<TOrderPrivateCar> driverEntityWrapper = new EntityWrapper<>(); |
| | | driverEntityWrapper.isNotNull("driverId"); |
| | | |
| | | if (start!=null){ |
| | | driverEntityWrapper.ge("insertTime", start); |
| | | driverEntityWrapper.le("insertTime", end); |
| | | } |
| | | List<TOrderPrivateCar> tOrderPrivateCars = orderPrivateCarService.selectList(driverEntityWrapper); |
| | | |
| | | for (Map<String, Object> map : list) { |
| | | Double driverMoney = 0.0; |
| | | Double platformMoney = 0.0; |
| | | |
| | | // 司机跑单收入 |
| | | List<Income> driver = incomes.stream().filter(e -> e.getUserType().equals(2) |
| | | &&map.get("id").toString().equals(e.getObjectId().toString())).collect(Collectors.toList()); |
| | | for (Income income : driver) { |
| | | driverMoney+=income.getMoney(); |
| | | } |
| | | String driverId = map.get("id").toString(); |
| | | // 查询司机订单 |
| | | List<Integer> orderIds = tOrderPrivateCars.stream().filter(e -> e.getDriverId().equals(Integer.parseInt(driverId))) |
| | | .map(TOrderPrivateCar::getId).collect(Collectors.toList()); |
| | | // 平台收入 |
| | | List<Income> platform = incomes.stream().filter(e -> e.getUserType().equals(1) |
| | | && orderIds.contains(e.getObjectId())).collect(Collectors.toList()); |
| | | for (Income income : platform) { |
| | | platformMoney+=income.getMoney(); |
| | | } |
| | | // driverMoney保留两位小数 |
| | | driverMoney = new BigDecimal(driverMoney).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); |
| | | platformMoney = new BigDecimal(platformMoney).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); |
| | | map.put("driverMoney", driverMoney); |
| | | map.put("platformMoney", platformMoney); |
| | | } |
| | | // 表格数据 |
| | | List<List<String>> dataList = new ArrayList<>(); |
| | | // 表头行 |
| | |
| | | shellList.add("姓名"); |
| | | shellList.add("账号/手机号"); |
| | | shellList.add("所属分公司"); |
| | | shellList.add("订单总数"); |
| | | shellList.add("未支付订单数"); |
| | | shellList.add("取消订单数"); |
| | | shellList.add("已完成订单数"); |
| | | shellList.add("订单总金额"); |
| | | shellList.add("未支付订金额"); |
| | | shellList.add("实付金额"); |
| | | shellList.add("司机收入"); |
| | | shellList.add("平台手续费"); |
| | | dataList.add(shellList); |
| | | |
| | | for (Map<String, Object> map : list) { |
| | |
| | | }else{ |
| | | shellList.add("0"); |
| | | } |
| | | if(SinataUtil.isNotEmpty(map.get("privateCarNotPayNum"))){ |
| | | shellList.add(map.get("privateCarNotPayNum").toString()); |
| | | }else{ |
| | | shellList.add("0"); |
| | | } |
| | | if(SinataUtil.isNotEmpty(map.get("privateCarcancelNum"))){ |
| | | shellList.add(map.get("privateCarcancelNum").toString()); |
| | | }else{ |
| | | shellList.add("0"); |
| | | } |
| | | if(SinataUtil.isNotEmpty(map.get("privateCarTotalMoney"))){ |
| | | shellList.add(map.get("privateCarTotalMoney").toString()); |
| | | }else{ |
| | | shellList.add("0"); |
| | | } |
| | | if(SinataUtil.isNotEmpty(map.get("privateCarNotPayMoney"))){ |
| | | shellList.add(map.get("privateCarNotPayMoney").toString()); |
| | | if(SinataUtil.isNotEmpty(map.get("payMoney"))){ |
| | | shellList.add(map.get("payMoney").toString()); |
| | | }else{ |
| | | shellList.add("0"); |
| | | } |
| | | if(SinataUtil.isNotEmpty(map.get("driverMoney"))){ |
| | | shellList.add(map.get("driverMoney").toString()); |
| | | }else{ |
| | | shellList.add("0"); |
| | | } |
| | | if(SinataUtil.isNotEmpty(map.get("platformMoney"))){ |
| | | shellList.add(map.get("platformMoney").toString()); |
| | | }else{ |
| | | shellList.add("0"); |
| | | } |
| | |
| | | package com.stylefeng.guns.modular.system.controller.general; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.alipay.api.AlipayApiException; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.stylefeng.guns.core.base.controller.BaseController; |
| | |
| | | import com.stylefeng.guns.modular.system.service.ITSystemNoticeService; |
| | | import com.stylefeng.guns.modular.system.util.HttpRequestUtil; |
| | | import com.stylefeng.guns.modular.system.util.PushURL; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | | import com.stylefeng.guns.modular.system.util.alipay.AlipayUtils; |
| | | import com.stylefeng.guns.modular.system.util.alipay.UUIDUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS"); |
| | | String code = sdf.format(new Date()) + UUIDUtil.getNumberRandom(5); |
| | | TDriver tDriver = driverService.selectById(tPubWithdrawal.getUserId()); |
| | | System.err.println("支付宝提现返回信息"+AlipayUtils.aliWithdrawal(code,tPubWithdrawal.getMoney()+"",tPubWithdrawal.getCode(),tDriver.getIdCard())); |
| | | tPubWithdrawal.setOutOrderNo( code); |
| | | String s = AlipayUtils.aliWithdrawal(code, tPubWithdrawal.getMoney() + "", tPubWithdrawal.getCode(), tDriver.getIdCard()); |
| | | JSONObject res = JSONObject.parseObject(s); |
| | | JSONObject alipayFundTransUniTransferResponse = res.getJSONObject("alipay_fund_trans_uni_transfer_response"); |
| | | if (alipayFundTransUniTransferResponse!=null){ |
| | | if (alipayFundTransUniTransferResponse.getString("status").equals("Success")){ |
| | | String string = alipayFundTransUniTransferResponse.getString("order_id"); |
| | | tPubWithdrawal.setOrderNumber(string); |
| | | }else{ |
| | | return ResultUtil.error("提现失败:"+alipayFundTransUniTransferResponse.getString("msg")); |
| | | } |
| | | } |
| | | System.err.println("支付宝提现返回信息"+s); |
| | | tPubWithdrawal.setOutOrderNo(code); |
| | | tPubWithdrawalService.updateById(tPubWithdrawal); |
| | | }else if (3 == state){ //拒绝提现 |
| | | stateObj = 2; |
| | |
| | | /** |
| | | * 跳转到修改专车订单 |
| | | */ |
| | | @RequestMapping("/tOrderPrivateCar_orderDetailByOrderNumber/{orderNumber}") |
| | | public String tOrderPrivateCarUpdate(@PathVariable String orderNumber, Model model) { |
| | | Map<String, Object> item = tOrderPrivateCarService.getPrivateCarOrderDetailByOrderNumber(orderNumber); |
| | | model.addAttribute("item",item); |
| | | return PREFIX + "tOrderPrivateCar_orderDetail.html"; |
| | | } |
| | | /** |
| | | * 跳转到修改专车订单 |
| | | */ |
| | | @RequestMapping("/toChangeMoney/{tOrderPrivateCarId}") |
| | | public String toChangeMoney(@PathVariable Integer tOrderPrivateCarId, Model model) { |
| | | Map<String, Object> item = tOrderPrivateCarService.getPrivateCarOrderDetailById(tOrderPrivateCarId); |
| | |
| | | * @param companyId |
| | | * @return java.util.List<java.util.Map<java.lang.String,java.lang.Object>> |
| | | */ |
| | | List<Map<String, Object>> queryDriverIncomeData(@Param("page")Page<Map<String, Object>> page, @Param("type")Integer type, @Param("start")String start, @Param("end")String end, @Param("companyId")Integer companyId); |
| | | List<Map<String, Object>> queryDriverIncomeData(@Param("page")Page<Map<String, Object>> page, @Param("driverName")String driverName, @Param("start")String start, @Param("end")String end, @Param("companyId")Integer companyId); |
| | | |
| | | /** |
| | | * |
| | |
| | | * @param companyId |
| | | * @return java.util.List<java.util.Map<java.lang.String,java.lang.Object>> |
| | | */ |
| | | List<Map<String, Object>> queryDriverIncomeDataNoPage(@Param("type")Integer type, @Param("start")String start, @Param("end")String end, @Param("companyId")Integer companyId); |
| | | List<Map<String, Object>> queryDriverIncomeDataNoPage(@Param("driverName")String driverName, @Param("start")String start, @Param("end")String end, @Param("companyId")Integer companyId); |
| | | |
| | | /** |
| | | * 修改司机分组id |
| | |
| | | * @return |
| | | */ |
| | | Map<String,Object> getPrivateCarOrderDetailById(@Param("orderId") Integer orderId); |
| | | Map<String,Object> getPrivateCarOrderDetailByOrderNumber(@Param("orderNumber") String orderNumber); |
| | | |
| | | List<Map<String,Object>> getPrivateCarOrderListNoPage( |
| | | @Param("beginTime") String beginTime, |
| | |
| | | td.`name` as driverName, |
| | | tc1.name as companyName, |
| | | tc2.name as franchiseeName, |
| | | <if test="1 == type"> |
| | | topc1.num as privateCarTotalNum, |
| | | IFNULL(topc2.num, 0) as privateCarNotPayNum, |
| | | IFNULL(topc3.num, 0) as privateCarcancelNum, |
| | | IFNULL(topc4.taxiMoney, 0) as privateCarTotalMoney, |
| | | IFNULL(topc5.taxiMoney, 0) as privateCarNotPayMoney, |
| | | </if> |
| | | IFNULL(topc6.payMoney, 0) as payMoney, |
| | | td.state as driverState, |
| | | td.phone as driverPhone |
| | | FROM |
| | | t_driver td |
| | | LEFT JOIN (SELECT id,name FROM t_company WHERE FIND_IN_SET(type, '1,2') AND flag != 3 ) AS tc1 ON td.companyId=tc1.id |
| | | LEFT JOIN ( SELECT id,name FROM t_company WHERE type = 3 AND flag != 3 ) AS tc2 ON tc2.id = td.franchiseeId |
| | | <if test="1 == type"> |
| | | INNER JOIN ( SELECT COUNT(id) AS num, driverId FROM t_order_private_car WHERE FIND_IN_SET(state, '7,8,9,10,12') |
| | | INNER JOIN ( SELECT COUNT(id) AS num, driverId FROM t_order_private_car WHERE FIND_IN_SET(state, '8,9') |
| | | <if test="null != start and '' != start and null != end and '' != end"> |
| | | and DATE_FORMAT(travelTime, '%Y-%m-%d') between #{start} and #{end} |
| | | </if> |
| | |
| | | </if> |
| | | GROUP BY driverId |
| | | ) AS topc3 ON topc3.driverId = td.id |
| | | LEFT JOIN ( SELECT SUM(orderMoney) AS taxiMoney, driverId FROM t_order_private_car WHERE FIND_IN_SET(state, '7,8,9,12') |
| | | LEFT JOIN ( SELECT SUM(orderMoney) AS taxiMoney, driverId FROM t_order_private_car WHERE FIND_IN_SET(state, '8,9') |
| | | <if test="null != start and '' != start and null != end and '' != end"> |
| | | and DATE_FORMAT(travelTime, '%Y-%m-%d') between #{start} and #{end} |
| | | </if> |
| | |
| | | </if> |
| | | GROUP BY driverId |
| | | ) AS topc5 ON topc5.driverId = td.id |
| | | </if> |
| | | LEFT JOIN ( SELECT SUM(payMoney) AS payMoney, driverId FROM t_order_private_car WHERE FIND_IN_SET(state, '8,9') |
| | | <if test="null != start and '' != start and null != end and '' != end"> |
| | | and DATE_FORMAT(travelTime, '%Y-%m-%d') between #{start} and #{end} |
| | | </if> |
| | | GROUP BY driverId |
| | | ) AS topc6 ON topc6.driverId = td.id |
| | | <where> |
| | | <if test="null!= companyId and '' != companyId"> |
| | | td.companyId=#{companyId} or td.franchiseeId=#{companyId} |
| | | </if> |
| | | |
| | | <if test="null!= driverName and '' != driverName"> |
| | | and td.name LIKE CONCAT('%',#{driverName},'%') |
| | | </if> |
| | | </where> |
| | | </select> |
| | |
| | | td.`name` as driverName, |
| | | tc1.name as companyName, |
| | | tc2.name as franchiseeName, |
| | | <if test="1 == type"> |
| | | topc1.num as privateCarTotalNum, |
| | | IFNULL(topc2.num, 0) as privateCarNotPayNum, |
| | | IFNULL(topc3.num, 0) as privateCarcancelNum, |
| | | IFNULL(topc4.taxiMoney, 0) as privateCarTotalMoney, |
| | | IFNULL(topc5.taxiMoney, 0) as privateCarNotPayMoney, |
| | | </if> |
| | | IFNULL(topc6.payMoney, 0) as payMoney, |
| | | td.state as driverState, |
| | | td.phone as driverPhone |
| | | FROM |
| | | t_driver td |
| | | LEFT JOIN (SELECT id,name FROM t_company WHERE FIND_IN_SET(type, '1,2') AND flag != 3 ) AS tc1 ON td.companyId=tc1.id |
| | | LEFT JOIN ( SELECT id,name FROM t_company WHERE type = 3 AND flag != 3 ) AS tc2 ON tc2.id = td.franchiseeId |
| | | <if test="1 == type"> |
| | | INNER JOIN ( SELECT COUNT(id) AS num, driverId FROM t_order_private_car WHERE FIND_IN_SET(state, '7,8,9,10,12') |
| | | INNER JOIN ( SELECT COUNT(id) AS num, driverId FROM t_order_private_car WHERE FIND_IN_SET(state, '8,9') |
| | | <if test="null != start and '' != start and null != end and '' != end"> |
| | | and DATE_FORMAT(travelTime, '%Y-%m-%d') between #{start} and #{end} |
| | | </if> |
| | |
| | | </if> |
| | | GROUP BY driverId |
| | | ) AS topc3 ON topc3.driverId = td.id |
| | | LEFT JOIN ( SELECT SUM(orderMoney) AS taxiMoney, driverId FROM t_order_private_car WHERE FIND_IN_SET(state, '7,8,9,12') |
| | | LEFT JOIN ( SELECT SUM(orderMoney) AS taxiMoney, driverId FROM t_order_private_car WHERE FIND_IN_SET(state, '8,9') |
| | | <if test="null != start and '' != start and null != end and '' != end"> |
| | | and DATE_FORMAT(travelTime, '%Y-%m-%d') between #{start} and #{end} |
| | | </if> |
| | |
| | | </if> |
| | | GROUP BY driverId |
| | | ) AS topc5 ON topc5.driverId = td.id |
| | | LEFT JOIN ( SELECT SUM(payMoney) AS payMoney, driverId FROM t_order_private_car WHERE FIND_IN_SET(state, '8,9') |
| | | <if test="null != start and '' != start and null != end and '' != end"> |
| | | and DATE_FORMAT(travelTime, '%Y-%m-%d') between #{start} and #{end} |
| | | </if> |
| | | GROUP BY driverId |
| | | ) AS topc6 ON topc6.driverId = td.id |
| | | where 1=1 |
| | | <if test="null!= companyId and '' != companyId"> |
| | | and td.companyId=#{companyId} or td.franchiseeId=#{companyId} |
| | | </if> |
| | | <if test="1 == type"> |
| | | order by privateCarTotalNum desc,privateCarTotalMoney desc |
| | | <if test="null!= driverName and '' != driverName"> |
| | | and td.name LIKE CONCAT('%',#{driverName},'%') |
| | | </if> |
| | | order by privateCarTotalNum desc,privateCarTotalMoney desc |
| | | |
| | | |
| | | </select> |
| | | |
| | |
| | | LEFT JOIN (SELECT * FROM t_income where userType = 2 and type = 2 and orderType = 1 GROUP BY incomeId) as income2 on income2.incomeId = ot.id |
| | | where ot.id = #{orderId} |
| | | </select> |
| | | <!--根据专车订单编号获取专车订单详情--> |
| | | <select id="getPrivateCarOrderDetailByOrderNumber" resultType="map"> |
| | | SELECT |
| | | DATE_FORMAT(ot.insertTime,'%Y-%m-%d %H:%i') as insertTimeStr, |
| | | DATE_FORMAT(ot.travelTime,'%Y-%m-%d %H:%i') as travelTimeStr, |
| | | DATE_FORMAT(ot.boardingTime,'%Y-%m-%d %H:%i') as boardingTimeStr, |
| | | DATE_FORMAT(ot.getoffTime,'%Y-%m-%d %H:%i') as getoffTimeStr, |
| | | case when ot.orderSource = 1 then 'APP下单' |
| | | when ot.orderSource = 2 then '扫码下单' |
| | | when ot.orderSource = 3 then '小程序下单' |
| | | when ot.orderSource = 4 then '司机下单' |
| | | when ot.orderSource = 5 then '调度下单' else '' end orderSourceStr, |
| | | ui.nickName as userName,ui.phone as userPhone, |
| | | case when ot.payType = 1 then '微信' |
| | | when ot.payType = 2 then '支付宝' |
| | | when ot.payType = 3 then '余额' else '' end as payTypeStr, |
| | | |
| | | case when ot.isFree = 2 then ot.orderMoney |
| | | when ot.freeMoney > ot.orderMoney then ot.orderMoney else ot.freeMoney end as freeMoney1, |
| | | sc.`name` as serverCarModel, |
| | | case when income1.type = 1 then income1.money else 0 end as platIncome, |
| | | case when income1.type = 2 then income1.money else 0 end as companyIncome, |
| | | case when income1.type = 3 then income1.money else 0 end as franchiseeIncome, |
| | | IFNULL(income2.money,0) as driverIncome, |
| | | CONCAT(di.`name`,'-',di.phone) as driver, |
| | | CONCAT(cb.`name`,'-',ci.carLicensePlate) as car, |
| | | cc.`name` as companyName,ot.* |
| | | FROM t_order_private_car as ot |
| | | LEFT JOIN t_user as ui on ui.id = ot.userId |
| | | LEFT JOIN t_driver as di on di.id = ot.driverId |
| | | LEFT JOIN t_car as ci on ci.id= ot.carId |
| | | LEFT JOIN t_car_brand as cb on cb.id = ci.carBrandId |
| | | LEFT JOIN t_company as cc on cc.id = ot.companyId |
| | | LEFT JOIN t_server_carmodel as sc on sc.id = ot.serverCarModelId |
| | | LEFT JOIN (SELECT ii.money,ii.incomeId,cc.type FROM t_income as ii |
| | | LEFT JOIN t_company as cc on ii.objectId = cc.id |
| | | where ii.userType = 1 and ii.type = 2 and ii.orderType = 1 GROUP BY ii.incomeId) as income1 on income1.incomeId = ot.id |
| | | LEFT JOIN (SELECT * FROM t_income where userType = 2 and type = 2 and orderType = 1 GROUP BY incomeId) as income2 on income2.incomeId = ot.id |
| | | where ot.orderNum = #{orderNumber} |
| | | </select> |
| | | |
| | | |
| | | <!--根据条件查询专车订单列表noPage--> |
| | |
| | | * 订单号 |
| | | */ |
| | | private String orderNum; |
| | | private String remark; |
| | | /** |
| | | * 下单地点经度 |
| | | */ |
| | |
| | | public void setIsException(Integer isException) { |
| | | this.isException = isException; |
| | | } |
| | | |
| | | public String getRemark() { |
| | | return remark; |
| | | } |
| | | |
| | | public void setRemark(String remark) { |
| | | this.remark = remark; |
| | | } |
| | | } |
| | |
| | | */ |
| | | private Integer userType; |
| | | /** |
| | | * 订单类型(1=专车,2=出租车,3=城际,4=小件物流,5=余额充值) |
| | | * 订单类型(1=专车,2=出租车,3=城际,4=小件物流,5=余额充值 6平台充值 7平台扣除) |
| | | */ |
| | | private Integer orderType; |
| | | /** |
| | |
| | | private BigDecimal money; |
| | | // 提现订单号 |
| | | private String outOrderNo; |
| | | // 提现流水号 |
| | | private String orderNumber; |
| | | /** |
| | | * 状态(1=待处理,2=成功,3=失败) |
| | | */ |
| | |
| | | public void setOutOrderNo(String outOrderNo) { |
| | | this.outOrderNo = outOrderNo; |
| | | } |
| | | |
| | | public String getOrderNumber() { |
| | | return orderNumber; |
| | | } |
| | | |
| | | public void setOrderNumber(String orderNumber) { |
| | | this.orderNumber = orderNumber; |
| | | } |
| | | } |
| | |
| | | * @param companyId |
| | | * @return java.util.List<java.util.Map<java.lang.String,java.lang.Object>> |
| | | */ |
| | | List<Map<String, Object>> queryDriverIncomeData(Page<Map<String, Object>> page, Integer type, String start,String end, Integer companyId); |
| | | List<Map<String, Object>> queryDriverIncomeData(Page<Map<String, Object>> page, String driverName, String start,String end, Integer companyId); |
| | | |
| | | /** |
| | | * |
| | |
| | | * @param companyId |
| | | * @return java.util.List<java.util.Map<java.lang.String,java.lang.Object>> |
| | | */ |
| | | List<Map<String, Object>> queryDriverIncomeDataNoPage(Integer type, String start, String end, Integer companyId); |
| | | List<Map<String, Object>> queryDriverIncomeDataNoPage(String driverName, String start, String end, Integer companyId); |
| | | |
| | | /** |
| | | * 修改司机分组id |
| | |
| | | * @return |
| | | */ |
| | | Map<String,Object> getPrivateCarOrderDetailById(@Param("orderId") Integer orderId); |
| | | Map<String,Object> getPrivateCarOrderDetailByOrderNumber(@Param("orderNumber") String orderNumber); |
| | | |
| | | /** |
| | | * 专车订单列表不分页 |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> queryDriverIncomeData(Page<Map<String, Object>> page, Integer type, String start,String end, Integer companyId) { |
| | | return this.baseMapper.queryDriverIncomeData(page,type,start,end,companyId); |
| | | public List<Map<String, Object>> queryDriverIncomeData(Page<Map<String, Object>> page, String driverName, String start,String end, Integer companyId) { |
| | | return this.baseMapper.queryDriverIncomeData(page,driverName,start,end,companyId); |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> queryDriverIncomeDataNoPage(Integer type, String start, String end, Integer companyId) { |
| | | return this.baseMapper.queryDriverIncomeDataNoPage(type,start,end,companyId); |
| | | public List<Map<String, Object>> queryDriverIncomeDataNoPage(String driverName, String start, String end, Integer companyId) { |
| | | return this.baseMapper.queryDriverIncomeDataNoPage(driverName,start,end,companyId); |
| | | } |
| | | |
| | | @Override |
| | |
| | | public Map<String, Object> getPrivateCarOrderDetailById(Integer orderId) { |
| | | return this.baseMapper.getPrivateCarOrderDetailById(orderId); |
| | | } |
| | | @Override |
| | | public Map<String, Object> getPrivateCarOrderDetailByOrderNumber(String orderNumber) { |
| | | return this.baseMapper.getPrivateCarOrderDetailByOrderNumber(orderNumber); |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> getPrivateCarOrderListNoPage(String beginTime, String endTime, Integer roleType, Integer objectId, String orderNum, Integer orderSource, String userName, String userPhone, String passengers, String passengersPhone, Integer serverCarModelId, String driver, Integer state, |
| | |
| | | <div class="col-sm-12"> |
| | | <div class="row"> |
| | | <div class="col-sm-3"> |
| | | <#SelectCon id="type" name="类别" > |
| | | <option value="1">专车</option> |
| | | <!--<option value="2">出租车</option> |
| | | <option value="3">跨城</option> |
| | | <option value="4">小件物流</option>--> |
| | | </#SelectCon> |
| | | </div> |
| | | <#NameCon id="driverName" name="司机名称" /> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <#TimeCon id="time" name="起止时间" isTime="false"/> |
| | | </div> |
| | |
| | | <#button name="邀请信息" icon="fa-eye" clickFun="YesDriver.inviteInfo()" space="true"/> |
| | | @} |
| | | <#button name="收入明细" icon="fa-eye" clickFun="YesDriver.income()" space="true"/> |
| | | <#button name="余额明细" icon="fa-eye" clickFun="YesDriver.balance()" space="true"/> |
| | | <#button name="余额修改" icon="fa-edit" clickFun="YesDriver.changeMoney()" space="true"/> |
| | | @if(shiro.hasPermission("/tDriver/updateTeamId")){ |
| | | <input id="updateTeamId" type="hidden" /> |
| | | @} |
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"> |
| | | <input type="hidden" id="id" value="${id}"> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <#TimeCon id="insertTime" name="日期范围" isTime="false"/> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <#SelectCon id="handleType" name="操作类型" > |
| | | <option value="">全部</option> |
| | | <option value="1">车费收入</option> |
| | | <option value="2">车费平台手续费扣除</option> |
| | | <option value="3">充值</option> |
| | | <option value="4">提现</option> |
| | | <option value="5">平台充值</option> |
| | | <option value="6">平台扣除</option> |
| | | </#SelectCon> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <#button name="搜索" icon="fa-search" clickFun="TIncome.search()"/> |
| | | <#button name="重置" icon="fa-trash" clickFun="TIncome.resetSearch()" space="true"/> |
| | | </div> |
| | | <#table id="TIncomeTable"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <script> |
| | | laydate.render({ |
| | | elem: '#insertTime' |
| | | ,range: true |
| | | }); |
| | | </script> |
| | | <script src="${ctxPath}/static/modular/system/tIncome/balance.js"></script> |
| | | @} |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="col-sm-3" > |
| | | <#input id="orderMagnitude" name="订单额度" value="" /> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="col-sm-3" > |
| | | <#input id="orderMagnitude" name="订单额度" value="${item.orderMagnitude}" /> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | |
| | | <div class="col-sm-3"> |
| | | <#SelectCon id="withdrawalType" name="提现方式" > |
| | | <option value="">全部</option> |
| | | <option value="1">银行卡</option> |
| | | <option value="2">线下</option> |
| | | <option value="1">支付宝</option> |
| | | </#SelectCon> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | |
| | | {title: '姓名', field: 'driverName', visible: true, align: 'center', valign: 'middle',width:'100px'}, |
| | | {title: '账号/手机号', field: 'driverPhone', visible: true, align: 'center', valign: 'middle',width:'100px'}, |
| | | {title: '所属分公司', field: 'companyName', visible: true, align: 'center', valign: 'middle',width:'100px'}, |
| | | {title: '订单总数', field: 'privateCarTotalNum', visible: true,sortable : true, align: 'center', valign: 'middle',width:'100px'}, |
| | | {title: '未支付订单数', field: 'privateCarNotPayNum', visible: true,sortable : true, align: 'center', valign: 'middle',width:'100px'}, |
| | | {title: '取消订单数', field: 'privateCarcancelNum', visible: true,sortable : true, align: 'center', valign: 'middle',width:'100px'}, |
| | | {title: '已完成订单数', field: 'privateCarTotalNum', visible: true,sortable : true, align: 'center', valign: 'middle',width:'100px'}, |
| | | {title: '订单总金额', field: 'privateCarTotalMoney', visible: true,sortable : true, align: 'center', valign: 'middle',width:'100px'}, |
| | | {title: '未支付订金额', field: 'privateCarNotPayMoney', visible: true,sortable : true, align: 'center', valign: 'middle',width:'100px'}, |
| | | {title: '运营状态', field: 'driverState', visible: true, align: 'center', valign: 'middle',width:'100px',formatter: function (value,row) { |
| | | if(row.driverState=='3'){ |
| | | return '<span class="label label-primary">服务中</span>'; |
| | | }else if(row.driverState=='2'){ |
| | | return '<span class="label label-warning">听单中</span>'; |
| | | }else if(row.driverState=='1'){ |
| | | return '<span class="label label-error">离线</span>'; |
| | | }else{ |
| | | return '' |
| | | } |
| | | }}, |
| | | {title: '实付金额', field: 'payMoney', visible: true,sortable : true, align: 'center', valign: 'middle',width:'100px'}, |
| | | {title: '司机收入', field: 'driverMoney', visible: true,sortable : true, align: 'center', valign: 'middle',width:'100px'}, |
| | | {title: '平台手续费', field: 'platformMoney', visible: true,sortable : true, align: 'center', valign: 'middle',width:'100px'}, |
| | | |
| | | ] |
| | | }; |
| | |
| | | */ |
| | | DriverIncomelData.search = function () { |
| | | var queryData = {}; |
| | | queryData['type'] = $("#type").val(); |
| | | queryData['driverName'] = $("#driverName").val(); |
| | | queryData['time'] = $("#time").val(); |
| | | queryData['companyId'] = $("#company").val(); |
| | | DriverIncomelData.table.refresh({query: queryData}); |
| | | }; |
| | | |
| | | DriverIncomelData.resetSearch = function () { |
| | | $("#type").val("1"); |
| | | $("#driverName").val(""); |
| | | $("#time").val(""); |
| | | $("#company").val(""); |
| | | DriverIncomelData.search(); |
| | |
| | | |
| | | } |
| | | }; |
| | | YesDriver.balance=function(){ |
| | | if (this.check()) { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: '余额明细', |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tIncome/balance?id='+ YesDriver.seItem.id |
| | | }); |
| | | this.layerIndex = index; |
| | | |
| | | } |
| | | }; |
| | | /** |
| | | * 余额修改 |
| | | */ |
| | | YesDriver.changeMoney = function () { |
| | | if (this.check()) { |
| | | // 所选司机余额 |
| | | var balance = YesDriver.seItem.balance; |
| | | var index = layer.load(1,{ |
| | | type: 1 |
| | | , title: '余额修改' |
| | | , area: ['50%', '50%'] |
| | | , offset: 'auto' //具体配置参考:http://www.layui.com/doc/modules/layer.html#offset |
| | | , id: 'layerDemo' //防止重复弹出cge |
| | | , content: '<div class="form-horizontal">' + |
| | | ' <div class="col-sm-11" >' + |
| | | ' <div class="col-sm-11">' + |
| | | ' <div class="form-group">\n' + |
| | | ' <label class="col-sm-3 control-label">当前余额:</label>\n' + |
| | | ' <div class="col-sm-9">\n' + |
| | | ' <label > '+balance+'元'+'</label> '+ |
| | | ' </div>\n' + |
| | | ' </div>\n' + |
| | | |
| | | ' <div class="form-group">\n' + |
| | | ' <label class="col-sm-3 control-label">操作类型:</label>\n' + |
| | | '<div class="col-sm-3">'+ |
| | | |
| | | '<select id = "type" class="form-control">'+ |
| | | '<option value="1">增加</option>'+ |
| | | '<option value="2">减少</option>'+ |
| | | '</select>'+ |
| | | '</div>\n'+ |
| | | '</div>\n'+ |
| | | ' <div class="form-group">\n' + |
| | | ' <label class="col-sm-3 control-label">变更金额:</label>\n' + |
| | | ' <div class="col-sm-9">\n' + |
| | | ' <input type="number" id="mount" value=""> 元 '+ |
| | | ' </div>\n' + |
| | | ' </div>\n' + |
| | | ' <div class="form-group">\n' + |
| | | ' <label class="col-sm-3 control-label">备注:</label>\n' + |
| | | ' <div class="col-sm-9">\n' + |
| | | ' <input type="text" id="remark" value=""> '+ |
| | | ' </div>\n' + |
| | | ' </div>\n' + |
| | | ' </div>' + |
| | | ' </div>' + |
| | | '</div>' |
| | | , btn: ['关闭', '保存'] |
| | | , btnAlign: 'c' //按钮居中 |
| | | , shade: 0.5 //不显示遮罩 |
| | | ,load:1 |
| | | , yes: function () { |
| | | layer.closeAll(); |
| | | }, |
| | | btn2:function () { |
| | | var id = YesDriver.seItem.id; |
| | | var mount = $("#mount").val(); |
| | | var type = $("#type").val(); |
| | | var ajax = new $ax(Feng.ctxPath + "/tDriver/changeMoney", function (data) { |
| | | if (data == 502){ |
| | | Feng.error("司机余额小于扣除的金额!"); |
| | | return; |
| | | } |
| | | if (data.code == 200) { |
| | | Feng.success("操作成功!"); |
| | | window.location.reload(); |
| | | window.parent.layer.closeAll(); |
| | | } |
| | | }, function (data) { |
| | | Feng.error("操作失败!") |
| | | window.location.reload(); |
| | | window.parent.layer.closeAll(); |
| | | return Feng.error("操作失败!"); |
| | | }); |
| | | ajax.set("id", id); |
| | | ajax.set("mount", mount); |
| | | ajax.set("type", type); |
| | | ajax.set("remark", remark); |
| | | ajax.start(); |
| | | layer.closeAll(); |
| | | } |
| | | }); |
| | | this.layerIndex = index; |
| | | } |
| | | }; |
| | | |
| | | |
| | | |
| | | var agreement; |
| | | $(function(){ |
| | | agreement = new agreement(); |
New file |
| | |
| | | /** |
| | | * 管理初始化 |
| | | */ |
| | | var TIncome = { |
| | | id: "TIncomeTable", //表格id |
| | | seItem: null, //选中的条目 |
| | | table: null, |
| | | layerIndex: -1 |
| | | }; |
| | | |
| | | /** |
| | | * 初始化表格的列 |
| | | */ |
| | | TIncome.initColumn = function () { |
| | | return [ |
| | | {field: 'selectItem',visible: false, radio: true}, |
| | | {title: '日期', field: 'times', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '操作类型', field: 'handleType', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '金额', field: 'amount', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '关联类型', field: 'withType', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '关联订单号', field: 'orderNumber', visible: true, align: 'center', valign: 'middle', formatter: function(value, row, index) { |
| | | if (value) { |
| | | return '<a href="javascript:void(0)" onclick="TIncome.orderDetail(\'' + value + '\')">' + value + '</a>'; |
| | | } |
| | | return value; |
| | | }}, {title: '备注', field: 'remark', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '账户余额', field: 'balance', visible: true, align: 'center', valign: 'middle'}, |
| | | ]; |
| | | }; |
| | | |
| | | /** |
| | | * 检查是否选中 |
| | | */ |
| | | TIncome.check = function () { |
| | | var selected = $('#' + this.id).bootstrapTable('getSelections'); |
| | | if(selected.length == 0){ |
| | | Feng.info("请先选中表格中的某一记录!"); |
| | | return false; |
| | | }else{ |
| | | TIncome.seItem = selected[0]; |
| | | return true; |
| | | } |
| | | }; |
| | | /** |
| | | * 打开查看专车订单详情 |
| | | */ |
| | | TIncome.orderDetail = function (value) { |
| | | if (this.check()) { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: '专车订单详情', |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tOrderPrivateCar/tOrderPrivateCar_orderDetailByOrderNumber/' + value |
| | | }); |
| | | this.layerIndex = index; |
| | | } |
| | | }; |
| | | /** |
| | | * 点击添加 |
| | | */ |
| | | TIncome.openAddTIncome = function () { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: '添加', |
| | | area: ['800px', '420px'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tIncome/tIncome_add' |
| | | }); |
| | | this.layerIndex = index; |
| | | }; |
| | | |
| | | /** |
| | | * 打开查看详情 |
| | | */ |
| | | TIncome.openTIncomeDetail = function () { |
| | | if (this.check()) { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: '详情', |
| | | area: ['800px', '420px'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tIncome/tIncome_update/' + TIncome.seItem.id |
| | | }); |
| | | this.layerIndex = index; |
| | | } |
| | | }; |
| | | |
| | | /** |
| | | * 删除 |
| | | */ |
| | | TIncome.delete = function () { |
| | | if (this.check()) { |
| | | var ajax = new $ax(Feng.ctxPath + "/tIncome/delete", function (data) { |
| | | Feng.success("删除成功!"); |
| | | TIncome.table.refresh(); |
| | | }, function (data) { |
| | | Feng.error("删除失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set("tIncomeId",this.seItem.id); |
| | | ajax.start(); |
| | | } |
| | | }; |
| | | TIncome.excel=function(){ |
| | | //$("#tOrderPrivateCarForm").submit(); |
| | | window.location.href=Feng.ctxPath + "/tIncome/getExcel?id="+$("#id").val(); |
| | | }; |
| | | /** |
| | | * 查询列表 |
| | | */ |
| | | TIncome.search = function () { |
| | | var queryData = {}; |
| | | queryData['insertTime'] = $("#insertTime").val(); |
| | | queryData['handleType'] = $("#handleType").val(); |
| | | queryData['id'] = $("#id").val(); |
| | | TIncome.table.refresh({query: queryData}); |
| | | }; |
| | | TIncome.resetSearch = function () { |
| | | $("#insertTime").val(""); |
| | | $("#handleType").val(""); |
| | | $("#id").val(""); |
| | | TIncome.search(); |
| | | }; |
| | | $(function () { |
| | | var defaultColunms = TIncome.initColumn(); |
| | | var table = new BSTable(TIncome.id, "/tIncome/listBalance", defaultColunms); |
| | | table.setPaginationType("client"); |
| | | var queryData = {}; |
| | | queryData['id'] = $("#id").val(); |
| | | table.setQueryParams(queryData); |
| | | TIncome.table = table.init(); |
| | | }); |
| | |
| | | .set('insertTime') |
| | | .set('insertUser') |
| | | .set('updateTime') |
| | | .set('updateUser'); |
| | | .set('updateUser') |
| | | .set('orderMagnitude'); |
| | | } |
| | | /** |
| | | * 提交添加 |