1 文件已重命名
18个文件已修改
5个文件已添加
| | |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.stylefeng.guns.core.base.controller.BaseController; |
| | | import com.stylefeng.guns.core.base.tips.SuccessTip; |
| | | import com.stylefeng.guns.core.exception.GunsException; |
| | | import com.stylefeng.guns.core.exception.ServiceExceptionEnum; |
| | | import com.stylefeng.guns.core.util.DateUtil; |
| | | import com.stylefeng.guns.modular.system.controller.resp.TAgentResp; |
| | | import com.stylefeng.guns.modular.system.controller.util.ExcelUtil; |
| | |
| | | @RequestMapping(value = "/add") |
| | | @ResponseBody |
| | | public Object add(TAgent tAgent) { |
| | | |
| | | int count = tAgentService.selectCount(new EntityWrapper<TAgent>().eq("principalPhone", tAgent.getPrincipalPhone())); |
| | | if(count>0){ |
| | | return new SuccessTip(500,"该代理商已存在!"); |
| | | } |
| | | |
| | | String[] split = tAgent.getAreaId().split("/"); |
| | | // 查询省市 |
| | | // 黑龙江省/大兴安岭地区 |
| | |
| | | */ |
| | | @RequestMapping(value = "/list") |
| | | @ResponseBody |
| | | public Object list(Integer couponType,Integer couponServiceType,String createtime) { |
| | | public Object list(Integer couponType,Integer couponServiceType,String createTime) { |
| | | EntityWrapper<TCoupon> wrapper = new EntityWrapper<>(); |
| | | if(Objects.nonNull(couponType)){ |
| | | wrapper.eq("coupon_type",couponType); |
| | |
| | | wrapper.eq("coupon_service_type",couponServiceType); |
| | | } |
| | | // 开始,结束时间 |
| | | if(StringUtils.hasLength(createtime)){ |
| | | String[] split = createtime.split(" - "); |
| | | if(StringUtils.hasLength(createTime)){ |
| | | String[] split = createTime.split(" - "); |
| | | Date startTime = DateUtil.getDate_str4(split[0]); |
| | | Date endTime = DateUtil.getDate_str4(split[1]); |
| | | wrapper.between("createtime",startTime,endTime); |
| | | wrapper.between("create_time",startTime,endTime); |
| | | } |
| | | wrapper.orderBy(true,"createtime",false); |
| | | wrapper.orderBy(true,"create_time",false); |
| | | wrapper.groupBy(true,"coupon_name"); |
| | | wrapper.groupBy(true,"coupon_type"); |
| | | return tCouponService.selectList(wrapper); |
| | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.stylefeng.guns.core.base.controller.BaseController; |
| | | import com.stylefeng.guns.core.base.tips.SuccessTip; |
| | | import com.stylefeng.guns.core.shiro.ShiroKit; |
| | | import com.stylefeng.guns.core.shiro.ShiroUser; |
| | | 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.model.*; |
| | |
| | | import java.math.BigDecimal; |
| | | import java.text.DateFormat; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | |
| | | } |
| | | |
| | | /** |
| | | * 跳转区域页面 |
| | | * 佣金跳转详情页面 |
| | | */ |
| | | @RequestMapping("/areaPage") |
| | | public String areaDetail(String area,String areaId,Model model) { |
| | | @RequestMapping("/commission/driverCommissionDetail") |
| | | public String driverCommissionDetail(Integer tDriverId, Model model) { |
| | | tDriverService.driverCommissionDetail(tDriverId,model); |
| | | return PREFIX + "tDriverCommissionDetail.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转区域页面编辑 |
| | | */ |
| | | @RequestMapping("/areaPageUpdate") |
| | | public String areaPageUpdate(String area,String areaId,Model model) { |
| | | List<TRegion> tRegions = tRegionService.selectList(new EntityWrapper<TRegion>().eq("parent_id", 0)); |
| | | model.addAttribute("provinceList",tRegions); |
| | | List<Integer> provinceIds = tRegions.stream().map(TRegion::getId).collect(Collectors.toList()); |
| | |
| | | model.addAttribute("cityId",split1[1]); |
| | | model.addAttribute("districtId",split1[2]); |
| | | } |
| | | return PREFIX + "tDriverArea.html"; |
| | | return PREFIX + "tDriverAreaUpdate.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转区域页面新增 |
| | | */ |
| | | @RequestMapping("/areaPageAdd") |
| | | public String areaPageAdd(Model model) { |
| | | List<TRegion> tRegions = tRegionService.selectList(new EntityWrapper<TRegion>().eq("parent_id", 0)); |
| | | model.addAttribute("provinceList",tRegions); |
| | | return PREFIX + "tDriverAreaAdd.html"; |
| | | } |
| | | |
| | | /** |
| | |
| | | @ResponseBody |
| | | public Object commissionList(String name,String phone,Integer status) { |
| | | EntityWrapper<TDriver> wrapper = tDriverService.getCommissionPageList(name,phone,status); |
| | | wrapper.ne("isException",2); |
| | | List<TDriver> tDrivers = tDriverService.selectList(wrapper); |
| | | return tDriverService.getTDriverResp(tDrivers); |
| | | return tDriverService.getTDriverCommissionResp(tDrivers); |
| | | } |
| | | /** |
| | | * 获取异常列表 |
| | |
| | | wrapper.eq("isException",2); |
| | | List<TDriver> tDrivers = tDriverService.selectList(wrapper); |
| | | return tDriverService.getTDriverResp(tDrivers); |
| | | } |
| | | |
| | | /** |
| | | * 佣金关联列表 |
| | | */ |
| | | @RequestMapping(value = "/commission/connect/list") |
| | | @ResponseBody |
| | | public Object commissionConnectList(String driverId) { |
| | | |
| | | // 查询当前用户的用户信息 |
| | | TDriver tDriver = tDriverService.selectById(driverId); |
| | | |
| | | EntityWrapper<TDriver> wrapper = new EntityWrapper<>(); |
| | | if(StringUtils.hasLength(driverId)){ |
| | | wrapper.eq("inviterId",driverId); |
| | | } |
| | | List<TDriver> list = tDriverService.selectList(wrapper); |
| | | List<TDriverCommissionResp> commissionResp = tDriverService.getTDriverCommissionResp(list); |
| | | for (TDriverCommissionResp tDriverCommissionResp : commissionResp) { |
| | | if(Objects.nonNull(tDriver)){ |
| | | tDriverCommissionResp.setInviterName(tDriver.getName()); |
| | | tDriverCommissionResp.setInviterPhone(tDriver.getPhone()); |
| | | } |
| | | } |
| | | return commissionResp; |
| | | } |
| | | |
| | | /** |
| | |
| | | |
| | | int count = tDriverService.selectCount(new EntityWrapper<TDriver>().eq("phone", tDriver.getPhone())); |
| | | if(count>0){ |
| | | return "该司机已存在!"; |
| | | return new SuccessTip(500,"该司机已存在!"); |
| | | } |
| | | tDriverService.addOrUpdate(tDriver); |
| | | Object o = tDriverService.addOrUpdate(tDriver); |
| | | if(Objects.nonNull(o)){ |
| | | return o; |
| | | } |
| | | // 默认值板块 |
| | | tDriver.setCode(UUIDUtil.getNumberRandom(16)); |
| | | tDriver.setBalance(BigDecimal.ZERO); |
| | | tDriver.setBackgroundBalance(BigDecimal.ZERO); |
| | | tDriver.setCommission(BigDecimal.ZERO); |
| | | tDriverService.insert(tDriver); |
| | | return SUCCESS_TIP; |
| | | } |
| | |
| | | @RequestMapping(value = "/update") |
| | | @ResponseBody |
| | | public Object update(TDriver tDriver) { |
| | | TDriver driver = tDriverService.selectOne(new EntityWrapper<TDriver>().eq("phone", tDriver.getPhone()) |
| | | .last("LIMIT 1")); |
| | | if(Objects.nonNull(driver) && !tDriver.getId().equals(driver.getId())){ |
| | | return new SuccessTip(500,"该司机已存在!"); |
| | | } |
| | | // Object ocr = ocr("E:\\071bf986db0b00355c0ed190bbd3b16.png"); |
| | | // System.err.println(ocr); |
| | | tDriverService.addOrUpdate(tDriver); |
| | | Object o = tDriverService.addOrUpdate(tDriver); |
| | | if(Objects.nonNull(o)){ |
| | | return o; |
| | | } |
| | | tDriverService.updateById(tDriver); |
| | | return SUCCESS_TIP; |
| | | } |
| | |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | @ApiOperation(value = "导出司机异常列表",notes="导出司机异常列表") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."), |
| | | }) |
| | | @RequestMapping(value = "/export-commission") |
| | | @ResponseBody |
| | | public void exportCommission(String name,String phone,Integer status,HttpServletResponse response) { |
| | | try { |
| | | Date date = new Date(); |
| | | DateFormat format = new SimpleDateFormat("yyyyMMdd"); |
| | | String time1 = format.format(date); |
| | | String fileName = "CommissionInfo"+time1+".xls"; |
| | | String[] title = new String[] {"姓名","手机号","所属代理商","推广人数","关联人数", |
| | | "累计获得佣金","可提现佣金","已提现金额","状态"}; |
| | | EntityWrapper<TDriver> wrapper = tDriverService.getCommissionPageList(name,phone,status); |
| | | // wrapper.ne("isException",2); |
| | | // 是否异常 |
| | | List<TDriver> list = tDriverService.selectList(wrapper); |
| | | |
| | | List<TDriverCommissionResp> commissionResp = tDriverService.getTDriverCommissionResp(list); |
| | | |
| | | String[][] values = new String[commissionResp.size()][]; |
| | | for (int i = 0; i < commissionResp.size(); i++) { |
| | | TDriverCommissionResp d = commissionResp.get(i); |
| | | values[i] = new String[title.length]; |
| | | values[i][0] = d.getName(); |
| | | values[i][1] = d.getPhone(); |
| | | values[i][2] = d.getAgentName(); |
| | | values[i][3] = String.valueOf(Objects.isNull(d.getNumberPromoters()) ? 0:d.getNumberPromoters()); |
| | | values[i][4] = String.valueOf(d.getConnectedPersons()); |
| | | values[i][5] = String.valueOf(d.getAccumulatedCommission()); |
| | | values[i][6] = String.valueOf(Objects.isNull(d.getCommission())?0:d.getCommission()); |
| | | values[i][7] = String.valueOf(d.getWithdrawnAmount()); |
| | | Integer status1 = d.getStatus(); |
| | | if(1 == status1){ |
| | | values[i][8] = "正常"; |
| | | }else if(2 == status1){ |
| | | values[i][8] = "冻结"; |
| | | }else if(3 == status1){ |
| | | values[i][8] = "已删除"; |
| | | } |
| | | } |
| | | 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 com.stylefeng.guns.modular.system.model.TDriver; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | public class TDriverCommissionResp extends TDriver { |
| | | |
| | | // 所属代理商 |
| | | @ApiModelProperty(value = "所属代理商") |
| | | private String agentName; |
| | | // 推广人数 |
| | | @ApiModelProperty(value = "推广人数") |
| | | private Integer numberPromoters; |
| | | // 联人数 |
| | | @ApiModelProperty(value = "关联人数") |
| | | private Integer connectedPersons; |
| | | // 累计获得佣金 |
| | | @ApiModelProperty(value = "累计获得佣金") |
| | | private BigDecimal accumulatedCommission; |
| | | // 已提现金额 |
| | | @ApiModelProperty(value = "已提现金额") |
| | | private BigDecimal withdrawnAmount; |
| | | |
| | | @ApiModelProperty(value = "邀约人姓名") |
| | | private String inviterName; |
| | | |
| | | @ApiModelProperty(value = "邀约人电话") |
| | | private String inviterPhone; |
| | | |
| | | @Override |
| | | public String getInviterName() { |
| | | return inviterName; |
| | | } |
| | | |
| | | @Override |
| | | public void setInviterName(String inviterName) { |
| | | this.inviterName = inviterName; |
| | | } |
| | | |
| | | @Override |
| | | public String getInviterPhone() { |
| | | return inviterPhone; |
| | | } |
| | | |
| | | @Override |
| | | public void setInviterPhone(String inviterPhone) { |
| | | this.inviterPhone = inviterPhone; |
| | | } |
| | | |
| | | public String getAgentName() { |
| | | return agentName; |
| | | } |
| | | |
| | | public void setAgentName(String agentName) { |
| | | this.agentName = agentName; |
| | | } |
| | | |
| | | public Integer getNumberPromoters() { |
| | | return numberPromoters; |
| | | } |
| | | |
| | | public void setNumberPromoters(Integer numberPromoters) { |
| | | this.numberPromoters = numberPromoters; |
| | | } |
| | | |
| | | public Integer getConnectedPersons() { |
| | | return connectedPersons; |
| | | } |
| | | |
| | | public void setConnectedPersons(Integer connectedPersons) { |
| | | this.connectedPersons = connectedPersons; |
| | | } |
| | | |
| | | public BigDecimal getAccumulatedCommission() { |
| | | return accumulatedCommission; |
| | | } |
| | | |
| | | public void setAccumulatedCommission(BigDecimal accumulatedCommission) { |
| | | this.accumulatedCommission = accumulatedCommission; |
| | | } |
| | | |
| | | public BigDecimal getWithdrawnAmount() { |
| | | return withdrawnAmount; |
| | | } |
| | | |
| | | public void setWithdrawnAmount(BigDecimal withdrawnAmount) { |
| | | this.withdrawnAmount = withdrawnAmount; |
| | | } |
| | | } |
| | |
| | | <resultMap id="BaseResultMap" type="com.stylefeng.guns.modular.system.model.TCoupon"> |
| | | <id column="id" property="id" /> |
| | | <result column="user_id" property="userId" /> |
| | | <result column="createtime" property="createtime" /> |
| | | <result column="create_time" property="createTime" /> |
| | | <result column="coupon_name" property="couponName" /> |
| | | <result column="coupon_type" property="couponType" /> |
| | | <result column="coupon_code" property="couponCode" /> |
| | |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id,user_id, createtime, coupon_name,coupon_type,coupon_code,coupon_status,coupon_service_type,coupon_conditional_amount, |
| | | id,user_id, create_time, coupon_name,coupon_type,coupon_code,coupon_status,coupon_service_type,coupon_conditional_amount, |
| | | coupon_preferential_amount,coupon_validity,coupon_send_quantity,coupon_state |
| | | </sql> |
| | | |
| | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | private Date createtime; |
| | | @ApiModelProperty(value = "创建时间") |
| | | @TableField("create_time") |
| | | private Date createTime; |
| | | |
| | | @ApiModelProperty(value = "用户id") |
| | | @TableField("user_id") |
| | | private Integer userId; |
| | | |
| | | @ApiModelProperty(value = "代理商id") |
| | | @TableField("agentId") |
| | | @TableField("agent_id") |
| | | private Integer agentId; |
| | | |
| | | @ApiModelProperty(value = "分公司id") |
| | | @TableField("branchOfficeId") |
| | | @TableField("branch_office_id") |
| | | private Integer branchOfficeId; |
| | | |
| | | @ApiModelProperty(value = "优惠券名称") |
| | |
| | | this.id = id; |
| | | } |
| | | |
| | | public Date getCreatetime() { |
| | | return createtime; |
| | | public Date getCreateTime() { |
| | | return createTime; |
| | | } |
| | | |
| | | public void setCreatetime(Date createtime) { |
| | | this.createtime = createtime; |
| | | public void setCreateTime(Date createTime) { |
| | | this.createTime = createTime; |
| | | } |
| | | |
| | | public String getCouponName() { |
| | |
| | | public String toString() { |
| | | return "TCoupon{" + |
| | | "id=" + id + |
| | | ", createtime=" + createtime + |
| | | ", couponName=" + couponName + |
| | | "}"; |
| | | ", createTime=" + createTime + |
| | | ", userId=" + userId + |
| | | ", agentId=" + agentId + |
| | | ", branchOfficeId=" + branchOfficeId + |
| | | ", couponName='" + couponName + '\'' + |
| | | ", couponType=" + couponType + |
| | | ", couponCode='" + couponCode + '\'' + |
| | | ", couponStatus=" + couponStatus + |
| | | ", couponServiceType=" + couponServiceType + |
| | | ", couponConditionalAmount=" + couponConditionalAmount + |
| | | ", couponPreferentialAmount=" + couponPreferentialAmount + |
| | | ", couponValidity=" + couponValidity + |
| | | ", couponSendQuantity=" + couponSendQuantity + |
| | | ", couponState=" + couponState + |
| | | '}'; |
| | | } |
| | | } |
| | |
| | | @ApiModelProperty(value = "区域id") |
| | | private String areaId; |
| | | |
| | | @TableField(exist = false) |
| | | @ApiModelProperty(value = "邀请人姓名") |
| | | private String inviterName; |
| | | |
| | | @TableField(exist = false) |
| | | @ApiModelProperty(value = "邀请人电话") |
| | | private String inviterPhone; |
| | | |
| | | |
| | | public String getInviterName() { |
| | | return inviterName; |
| | | } |
| | | |
| | | public void setInviterName(String inviterName) { |
| | | this.inviterName = inviterName; |
| | | } |
| | | |
| | | public String getInviterPhone() { |
| | | return inviterPhone; |
| | | } |
| | | |
| | | public void setInviterPhone(String inviterPhone) { |
| | | this.inviterPhone = inviterPhone; |
| | | } |
| | | |
| | | public BigDecimal getCommission() { |
| | | return commission; |
| | | } |
| | |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.stylefeng.guns.modular.system.controller.resp.TDriverCommissionResp; |
| | | import com.stylefeng.guns.modular.system.controller.resp.TDriverResp; |
| | | import com.stylefeng.guns.modular.system.model.TDriver; |
| | | import com.baomidou.mybatisplus.service.IService; |
| | |
| | | * 新增修改处理数据 |
| | | * @param tDriver |
| | | */ |
| | | void addOrUpdate(TDriver tDriver); |
| | | Object addOrUpdate(TDriver tDriver); |
| | | |
| | | /** |
| | | * 查询佣金列表 |
| | |
| | | */ |
| | | EntityWrapper<TDriver> getCommissionPageList(String name, String phone, Integer status); |
| | | |
| | | /** |
| | | * 封装佣金集合 |
| | | * @param list |
| | | * @return |
| | | */ |
| | | List<TDriverCommissionResp> getTDriverCommissionResp(List<TDriver> list); |
| | | |
| | | /** |
| | | * 佣金详情 |
| | | * @param tDriverId |
| | | * @param model |
| | | */ |
| | | void driverCommissionDetail(Integer tDriverId, Model model); |
| | | } |
| | |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.stylefeng.guns.core.base.tips.SuccessTip; |
| | | import com.stylefeng.guns.core.util.DateUtil; |
| | | 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.HttpUtils; |
| | | import com.stylefeng.guns.modular.system.controller.util.UUIDUtil; |
| | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.concurrent.atomic.AtomicInteger; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | model.addAttribute("principal",""); |
| | | } |
| | | |
| | | if(Objects.nonNull(tDriver.getInviterId())){ |
| | | // 查询邀请人 |
| | | if(Objects.nonNull(tDriver.getInviterType()) && 1 == tDriver.getInviterType()){ |
| | | TAppUser tAppUser = tAppUserMapper.selectById(tDriver.getInviterId()); |
| | |
| | | }else { |
| | | model.addAttribute("inviterName",""); |
| | | model.addAttribute("inviterPhone",""); |
| | | } |
| | | } |
| | | |
| | | // 查询当前用户邀请了哪些人 |
| | |
| | | } |
| | | |
| | | @Override |
| | | public void addOrUpdate(TDriver tDriver) { |
| | | public Object addOrUpdate(TDriver tDriver) { |
| | | // 对省市区做处理 |
| | | String[] split = tDriver.getAreaId().split("/"); |
| | | // 查询省市 |
| | |
| | | tDriver.setAreaName(area.getName()); |
| | | tDriver.setAreaCode(area.getCode()); |
| | | |
| | | tDriver.setCode(UUIDUtil.getNumberRandom(16)); |
| | | tDriver.setBalance(BigDecimal.ZERO); |
| | | tDriver.setBackgroundBalance(BigDecimal.ZERO); |
| | | |
| | | // 通过省市查询代理商 |
| | | List<TAgent> tAgent = tAgentMapper.selectList(new EntityWrapper<TAgent>().eq("provinceCode", province.getCode()) |
| | | .eq("cityCode", city.getCode()) |
| | | .eq("status", 1) |
| | | .last("LIMIT 1")); |
| | | if(!CollectionUtils.isEmpty(tAgent)){ |
| | | tDriver.setAgentId(tAgent.get(0).getId()); |
| | | }else { |
| | | return new SuccessTip(500, "该区域代理商被冻结或不存在"); |
| | | } |
| | | if(StringUtils.hasLength(tDriver.getInviterPhone())){ |
| | | // 查询邀约人(司机端) |
| | | List<TDriver> emergencyDriver = tDriverMapper.selectList(new EntityWrapper<TDriver>().eq("phone", tDriver.getEmergencyPhone()) |
| | | List<TDriver> emergencyDriver = tDriverMapper.selectList(new EntityWrapper<TDriver>().eq("phone", tDriver.getInviterPhone()) |
| | | .last("LIMIT 1")); |
| | | if(!CollectionUtils.isEmpty(emergencyDriver)){ |
| | | tDriver.setInviterId(emergencyDriver.get(0).getId()); |
| | | tDriver.setInviterType(2); |
| | | }else { |
| | | return new SuccessTip(500, "该邀约人:"+tDriver.getInviterName()+"不存在"); |
| | | } |
| | | } |
| | | // 通过省市区查询分公司 |
| | | List<TBranchOffice> tBranchOffice = tBranchOfficeMapper.selectList(new EntityWrapper<TBranchOffice>().eq("provinceCode", province.getCode()) |
| | | .eq("cityCode", city.getCode()) |
| | | .eq("status", 1) |
| | | .eq("districtCode", area.getCode()) |
| | | .last("LIMIT 1")); |
| | | if(!CollectionUtils.isEmpty(tBranchOffice)){ |
| | | tDriver.setBranchOfficeId(tBranchOffice.get(0).getId()); |
| | | }else { |
| | | return new SuccessTip(500, "该区域分公司被冻结或不存在"); |
| | | } |
| | | |
| | | // ocr识别 |
| | | // JSONObject ocr = this.ocr("E:\\071bf986db0b00355c0ed190bbd3b16.png"); |
| | | // System.err.println(ocr); |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | |
| | | wrapper.orderBy(true,"approvalStatus"); |
| | | return wrapper; |
| | | } |
| | | |
| | | @Override |
| | | public List<TDriverCommissionResp> getTDriverCommissionResp(List<TDriver> drivers) { |
| | | List<TDriverCommissionResp> commissionRespList = new ArrayList<>(drivers.size()); |
| | | for (TDriver driver : drivers) { |
| | | TDriverCommissionResp commissionResp = new TDriverCommissionResp(); |
| | | BeanUtils.copyProperties(driver,commissionResp); |
| | | |
| | | // 查询代理商 |
| | | // 所属代理商 |
| | | TAgent tAgent = tAgentMapper.selectById(driver.getAgentId()); |
| | | if(Objects.nonNull(tAgent)){ |
| | | commissionResp.setAgentName(tAgent.getPrincipal()); |
| | | } |
| | | |
| | | // 关联人数 |
| | | AtomicInteger connectedPersons = new AtomicInteger(0); |
| | | |
| | | List<TDriver> inviterTwoList = tDriverMapper.selectList(new EntityWrapper<TDriver>().eq("inviterId", driver.getId())); |
| | | if(!CollectionUtils.isEmpty(inviterTwoList)){ |
| | | // 推广人数 |
| | | commissionResp.setNumberPromoters(inviterTwoList.size()); |
| | | List<Integer> inviterTwoIds = inviterTwoList.stream().map(TDriver::getId).collect(Collectors.toList()); |
| | | connectedPersons.addAndGet(inviterTwoList.size()); |
| | | // 查询三级 |
| | | List<TDriver> inviterThreeList = tDriverMapper.selectList(new EntityWrapper<TDriver>().in("inviterId", inviterTwoIds)); |
| | | if(!CollectionUtils.isEmpty(inviterThreeList)){ |
| | | List<Integer> inviterThreeIds = inviterThreeList.stream().map(TDriver::getId).collect(Collectors.toList()); |
| | | connectedPersons.addAndGet(inviterThreeList.size()); |
| | | // 查询四级 |
| | | List<TDriver> inviterFourList = tDriverMapper.selectList(new EntityWrapper<TDriver>().in("inviterId", inviterThreeIds)); |
| | | connectedPersons.addAndGet(inviterFourList.size()); |
| | | |
| | | } |
| | | } |
| | | |
| | | commissionResp.setConnectedPersons(connectedPersons.get()); |
| | | |
| | | // 已提现佣金 查询该司机的佣金提现记录 |
| | | commissionResp.setWithdrawnAmount(BigDecimal.ZERO); |
| | | |
| | | // 累计佣金 可提现佣金+已提现佣金 |
| | | commissionResp.setAccumulatedCommission(BigDecimal.ZERO); |
| | | |
| | | commissionRespList.add(commissionResp); |
| | | |
| | | } |
| | | return commissionRespList; |
| | | } |
| | | |
| | | @Override |
| | | public void driverCommissionDetail(Integer tDriverId, Model model) { |
| | | |
| | | // 查询司机 |
| | | TDriver driver = tDriverMapper.selectById(tDriverId); |
| | | |
| | | // 司机信息封装 |
| | | model.addAttribute("driverId",tDriverId); |
| | | model.addAttribute("name",driver.getName()); |
| | | model.addAttribute("phone",driver.getPhone()); |
| | | model.addAttribute("sex",driver.getSex()); |
| | | model.addAttribute("status",driver.getStatus()); |
| | | model.addAttribute("commission",driver.getCommission()); |
| | | model.addAttribute("startTimeToEndTime",new SimpleDateFormat("yyyy-MM-dd").format(driver.getCreateTime()).replace("-",".")+"-"+ |
| | | new SimpleDateFormat("yyyy-MM-dd").format(new Date()).replace("-",".")); |
| | | |
| | | // 所属代理商 |
| | | TAgent tAgent = tAgentMapper.selectById(driver.getAgentId()); |
| | | if(Objects.nonNull(tAgent)){ |
| | | model.addAttribute("agentName",tAgent.getPrincipal()); |
| | | }else { |
| | | model.addAttribute("agentName",""); |
| | | } |
| | | |
| | | // 关联人数 |
| | | AtomicInteger connectedPersons = new AtomicInteger(0); |
| | | // 推广人数 |
| | | List<TDriver> inviterTwoList = tDriverMapper.selectList(new EntityWrapper<TDriver>().eq("inviterId", driver.getId())); |
| | | if(!CollectionUtils.isEmpty(inviterTwoList)){ |
| | | model.addAttribute("numberPromoters",inviterTwoList.size()); |
| | | List<Integer> inviterTwoIds = inviterTwoList.stream().map(TDriver::getId).collect(Collectors.toList()); |
| | | connectedPersons.addAndGet(inviterTwoList.size()); |
| | | // 查询三级 |
| | | List<TDriver> inviterThreeList = tDriverMapper.selectList(new EntityWrapper<TDriver>().in("inviterId", inviterTwoIds)); |
| | | if(!CollectionUtils.isEmpty(inviterThreeList)){ |
| | | List<Integer> inviterThreeIds = inviterThreeList.stream().map(TDriver::getId).collect(Collectors.toList()); |
| | | connectedPersons.addAndGet(inviterThreeList.size()); |
| | | // 查询四级 |
| | | List<TDriver> inviterFourList = tDriverMapper.selectList(new EntityWrapper<TDriver>().in("inviterId", inviterThreeIds)); |
| | | connectedPersons.addAndGet(inviterFourList.size()); |
| | | } |
| | | }else { |
| | | model.addAttribute("numberPromoters",0); |
| | | } |
| | | model.addAttribute("connectedPersons",connectedPersons.get()); |
| | | // 已提现佣金 查询该司机的佣金提现记录 |
| | | model.addAttribute("withdrawnAmount",BigDecimal.ZERO); |
| | | // commissionResp.setWithdrawnAmount(BigDecimal.ZERO); |
| | | // 累计佣金 可提现佣金+已提现佣金 |
| | | model.addAttribute("accumulatedCommission",BigDecimal.ZERO); |
| | | // commissionResp.setAccumulatedCommission(BigDecimal.ZERO); |
| | | |
| | | } |
| | | } |
| | |
| | | <div class="col-sm-12"> |
| | | <div class="row"> |
| | | <div class="col-sm-3"> |
| | | <#TimeCon id="createtime" name="发布时间"/> |
| | | <#TimeCon id="createTime" name="发布时间"/> |
| | | </div> |
| | | <div class="col-sm-2"> |
| | | <select class="input-group" id="couponType" style="width: 180px;height: 33px" name="couponType"> |
| | |
| | | <script src="${ctxPath}/static/modular/system/tCoupon/tCoupon.js"></script> |
| | | <script type="text/javascript"> |
| | | laydate.render({ |
| | | elem: '#createtime', |
| | | elem: '#createTime', |
| | | type: 'date', |
| | | range: true |
| | | }); |
| | |
| | | @layout("/common/_container.html"){ |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-content"> |
| | | <div class="form-horizontal" style="width: "> |
| | | <div class="form-horizontal"> |
| | | |
| | | <div class="row"> |
| | | <div class="col-sm-12"> |
New file |
| | |
| | | @layout("/common/_container.html"){ |
| | | <div class="row"> |
| | | <div class="col-sm-12"> |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-content"> |
| | | <div class="row row-lg"> |
| | | <div class="col-sm-12" style="height: 100px;"> |
| | | |
| | | <div class="col-sm-4 control-label"> |
| | | <label class="col-sm-1" style="width: 20px;">省:</label> |
| | | <select class="input-group col-sm-2 " onclick="TDriver.areaCity()" id="province" style="width: 200px;height: 33px" name="province"> |
| | | <option value="">请选择省</option> |
| | | @for(i in provinceList){ |
| | | <option id="${i.id}" value="${i.name}"}>${i.name}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | | <div class="col-sm-4 control-label"> |
| | | <label class="col-sm-1" style="width: 20px;">市:</label> |
| | | <select class="input-group col-sm-2" onclick="TDriver.areaDistrict()" id="city" style="width: 200px;height: 33px" name="city"> |
| | | <option>请选择市</option> |
| | | </select> |
| | | </div> |
| | | <div class="col-sm-4 control-label"> |
| | | <label class="col-sm-1" style="width: 20px;">区:</label> |
| | | <select class="input-group col-sm-2" id="district" style="width: 200px;height: 33px" name="district"> |
| | | <option>请选择区</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="hidden-xs" id="TAppUserTableToolbar" role="group" style="text-align:center"> |
| | | <#button name="取消" icon="fa-plus" clickFun="TDriverInfoDlg.close()" /> |
| | | <#button name="确定" icon="fa-plus" clickFun="TDriver.submitArea()"/> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/static/modular/system/tDriver/tDriver.js"></script> |
| | | <script src="${ctxPath}/static/modular/system/tDriver/tDriver_info.js"></script> |
| | | <script type="text/javascript"> |
| | | </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"> |
| | | <input hidden id="driverId" value="${driverId}"> |
| | | |
| | | <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>${startTimeToEndTime}</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>${name}</label> |
| | | </div> |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <label class="control-label" >手机号:</label> |
| | | <label>${phone}</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(sex==1){ |
| | | <label>男</label> |
| | | @} |
| | | @if(sex==2){ |
| | | <label>女</label> |
| | | @} |
| | | @if(sex==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-3 control-label form-group" > |
| | | <label class="control-label" >推广人数:</label> |
| | | <label>${numberPromoters}</label> |
| | | </div> |
| | | <div class="initialLevel col-sm-2 control-label form-group" > |
| | | <label class="control-label">关联人数:</label> |
| | | <label>${connectedPersons}</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>${accumulatedCommission}</label> |
| | | </div> |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <label class="control-label" >可提现佣金:</label> |
| | | <label>${commission}</label> |
| | | </div> |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <label class="control-label" >已提现佣金:</label> |
| | | <label>${withdrawnAmount}</label> |
| | | </div> |
| | | </div> |
| | | |
| | | <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/> |
| | | <!--拒单记录表--> |
| | | <#table id="TDriverCommissionConnectTable"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/static/modular/system/tDriver/tDriverCommission.js"></script> |
| | | <script src="${ctxPath}/static/modular/system/tDriver/tDriverCommissionConnect.js"></script> |
| | | <script type="text/javascript"> |
| | | $(function () { |
| | | var queryData = {}; |
| | | queryData['driverId'] = $("#driverId").val(); |
| | | TDriverCommissionConnect.table.refresh({query: queryData}); |
| | | }); |
| | | laydate.render({ |
| | | elem: '#createTime', |
| | | 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"> |
| | | <input hidden id="driverId" value="${driverId}"> |
| | | |
| | | <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>${startTimeToEndTime}</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>${name}</label> |
| | | </div> |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <label class="control-label" >手机号:</label> |
| | | <label>${phone}</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(sex==1){ |
| | | <label>男</label> |
| | | @} |
| | | @if(sex==2){ |
| | | <label>女</label> |
| | | @} |
| | | @if(sex==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-3 control-label form-group" > |
| | | <label class="control-label" >推广人数:</label> |
| | | <label>${numberPromoters}</label> |
| | | </div> |
| | | <div class="initialLevel col-sm-2 control-label form-group" > |
| | | <label class="control-label">关联人数:</label> |
| | | <label>${connectedPersons}</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>${accumulatedCommission}</label> |
| | | </div> |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <label class="control-label" >可提现佣金:</label> |
| | | <label>${commission}</label> |
| | | </div> |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <label class="control-label" >已提现佣金:</label> |
| | | <label>${withdrawnAmount}</label> |
| | | </div> |
| | | </div> |
| | | |
| | | <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/> |
| | | <!--拒单记录表--> |
| | | <#table id="TOrderRefusalTable"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/static/modular/system/tDriver/tDriverCommission.js"></script> |
| | | <script type="text/javascript"> |
| | | $(function () { |
| | | var queryData = {}; |
| | | queryData['driverId'] = $("#driverId").val(); |
| | | TDriverCommissionConnect.table.refresh({query: queryData}); |
| | | }); |
| | | </script> |
| | | @} |
| | |
| | | <div class="col-sm-12"> |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-title"> |
| | | <h5>管理</h5> |
| | | <h5>详情</h5> |
| | | </div> |
| | | <div class="ibox-content"> |
| | | <div class="row row-lg"> |
| | |
| | | <div class="ibox-content"> |
| | | <div class="row row-lg"> |
| | | <div class="col-sm-12"> |
| | | <input hidden id="areaId" value="${areaId}"> |
| | | <input hidden id="areaId"> |
| | | |
| | | <hr/> |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <div style="background-color: gray;height: 35px;line-height: 35px"> |
| | |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <span style="color:red">*</span> |
| | | <label class="control-label" >服务区域:</label> |
| | | <input id="area" onclick="TDriver.area()" name="area" placeholder="请选择" style="height: 30px" readonly required> |
| | | <input id="area" onclick="TDriver.areaAdd()" name="area" placeholder="请选择" style="height: 30px" readonly required> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <span style="color:red">*</span> |
| | | <label class="control-label" >服务区域:</label> |
| | | <input id="area" value="${item.area}" onclick="TDriver.area()" name="area" placeholder="请选择" style="height: 30px" readonly required> |
| | | <input id="area" value="${item.area}" onclick="TDriver.areaUpdate()" name="area" placeholder="请选择" style="height: 30px" readonly required> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | |
| | | //提交信息 |
| | | var ajax = new $ax(Feng.ctxPath + "/tAgent/add", function(data){ |
| | | if(data.code == 500){ |
| | | Feng.error("添加失败!" + data.message + "!"); |
| | | return false; |
| | | } |
| | | Feng.success("添加成功!"); |
| | | window.parent.TAgent.table.refresh(); |
| | | TAgentInfoDlg.close(); |
| | | },function(data){ |
| | | Feng.error("添加失败!" + data.responseJSON.message + "!"); |
| | | Feng.error("添加失败!" + data.message + "!"); |
| | | }); |
| | | ajax.set(this.tAgentInfoData); |
| | | ajax.start(); |
| | |
| | | return [ |
| | | {field: 'selectItem', radio: true}, |
| | | {title: '主键', field: 'id', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '创建时间', field: 'createtime', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '创建时间', field: 'createTime', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '优惠券名称', field: 'couponName', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '优惠券类型', field: 'couponType', visible: true, align: 'center', valign: 'middle', |
| | | formatter: function (value, row) { |
| | |
| | | {title: '优惠券码', field: 'couponCode', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '优惠券状态', field: 'couponStatus', visible: true, align: 'center', valign: 'middle', |
| | | formatter: function (value, row) { |
| | | if (row.couponType === 1){ |
| | | if (row.couponStatus === 1){ |
| | | return '<span>未发放</span>' |
| | | }else if (row.couponType === 2){ |
| | | }else if (row.couponStatus === 2){ |
| | | return '<span>未使用</span>' |
| | | }else if (row.couponType === 3){ |
| | | }else if (row.couponStatus === 3){ |
| | | return '<span>已使用</span>' |
| | | }else if (row.couponType === 4){ |
| | | }else if (row.couponStatus === 4){ |
| | | return '<span>已过期</span>' |
| | | } |
| | | } |
| | | }, |
| | | {title: '服务类型', field: 'couponServiceType', visible: true, align: 'center', valign: 'middle', |
| | | formatter: function (value, row) { |
| | | if (row.couponType === 1){ |
| | | if (row.couponServiceType === 1){ |
| | | return '<span>通用型</span>' |
| | | } |
| | | } |
| | |
| | | {title: '优惠金额', field: 'couponPreferentialAmount', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '有效期', field: 'couponValidity', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '赠送数量', field: 'couponSendQuantity', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '状态', field: 'couponState', visible: true, align: 'center', valign: 'middle', |
| | | formatter: function (value, row) { |
| | | if (row.couponState === 1){ |
| | | return '<span>正常</span>' |
| | | }else if (row.couponState === 2){ |
| | | return '<span>冻结</span>' |
| | | }else if (row.couponState === 3){ |
| | | return '<span>已删除</span>' |
| | | } |
| | | }}, |
| | | {title: '操作', visible: true, align: 'center', valign: 'middle',width:150, |
| | | formatter: function (value, row) { |
| | | if (row.state === 1){ |
| | | return '<a href="#" onclick="TCoupon.stop('+row.id+','+row.status+')" style="color:red">停用</a>' +' ' + |
| | | if (row.couponState === 1){ |
| | | return '<a href="#" onclick="TCoupon.stop('+row.id+','+row.couponState+')" style="color:red">停用</a>' +' ' + |
| | | '<a href="#" onclick="TCoupon.delete('+row.id+')" style="color:red">删除</a>' |
| | | }else if (row.state === 2){ |
| | | return '<a href="#" onclick="TCoupon.start('+row.id+','+row.status+')" style="color:green">启用</a>' +' ' + |
| | | }else if (row.couponState === 2){ |
| | | return '<a href="#" onclick="TCoupon.start('+row.id+','+row.couponState+')" style="color:green">启用</a>' +' ' + |
| | | '<a href="#" onclick="TCoupon.delete('+row.id+')" style="color:red">删除</a>' |
| | | } |
| | | } |
| | |
| | | var queryData = {}; |
| | | queryData['couponType'] = $("#couponType").val(); |
| | | queryData['couponServiceType'] = $("#couponServiceType").val(); |
| | | queryData['createtime'] = $("#createtime").val(); |
| | | queryData['createTime'] = $("#createTime").val(); |
| | | TCoupon.table.refresh({query: queryData}); |
| | | }; |
| | | |
| | |
| | | }; |
| | | |
| | | /** |
| | | * 打开区域选择页面 |
| | | * 打开区域选择页面编辑 |
| | | */ |
| | | TDriver.area = function () { |
| | | TDriver.areaUpdate = function () { |
| | | |
| | | var area = $("#area").val(); |
| | | var areaId = $("#areaId").val(); |
| | |
| | | area: ['1000px', '270px'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tDriver/areaPage?area='+area+'&areaId='+areaId |
| | | content: Feng.ctxPath + '/tDriver/areaPageUpdate?area='+area+'&areaId='+areaId |
| | | }); |
| | | this.layerIndex = index; |
| | | } |
| | | /** |
| | | * 打开区域选择页面新增 |
| | | */ |
| | | TDriver.areaAdd = function () { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: '区域选择', |
| | | area: ['1000px', '270px'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tDriver/areaPageAdd' |
| | | }); |
| | | this.layerIndex = index; |
| | | } |
| | |
| | | |
| | | parent.$("#area").val(provinceName+'/'+cityName+'/'+districtName) |
| | | parent.$("#areaId").val(provinceId+'/'+cityId+'/'+districtId) |
| | | console.log() |
| | | TDriverInfoDlg.close(); |
| | | } |
| | | |
| | | /** |
| | | * 重置市区 |
| | | */ |
| | | TDriver.resetArea = function () { |
| | | |
| | | var city = document.getElementById('city'); |
| | | var cityIndex= city.selectedIndex ; |
| | | console.log(city.options[cityIndex].innerText) |
| | | city.options[cityIndex].innerText = "请选择市"; |
| | | |
| | | var district = document.getElementById('district'); |
| | | var districtIndex= district.selectedIndex ; |
| | | console.log(district.options[districtIndex].innerText) |
| | | district.options[districtIndex].innerText = "请选择区"; |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 打开编辑页面 |
| | | */ |
| | | TDriver.updateInfo = function (id) { |
| | |
| | | {title: '姓名', field: 'name', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '手机号', field: 'phone', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '所属代理商', field: 'agentName', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '性别', field: 'sex', visible: false, align: 'center', valign: 'middle', |
| | | formatter: function (value, row) { |
| | | if (row.sex === 1){ |
| | | return '<span>男</span>' |
| | | }else if (row.sex === 2){ |
| | | return '<span>女</span>' |
| | | }else { |
| | | return '<span>未知</span>' |
| | | } |
| | | }}, |
| | | {title: '推广人数', field: 'cumulativeOrderCount', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '关联人数', field: 'cumulativeOrderCount', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '累计获得佣金', field: 'cumulativeOrderCount', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '可提现佣金', field: 'monthOrderCount', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '已提现金额', field: 'integral', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '推广人数', field: 'numberPromoters', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '关联人数', field: 'connectedPersons', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '累计获得佣金', field: 'accumulatedCommission', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '可提现佣金', field: 'commission', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '已提现金额', field: 'withdrawnAmount', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '状态', field: 'status', visible: true, align: 'center', valign: 'middle', |
| | | formatter: function (value, row) { |
| | | if (row.status === 1){ |
| | |
| | | }}, |
| | | {title: '操作', visible: true, align: 'center', valign: 'middle',width:150, |
| | | formatter: function (value, row) { |
| | | if (row.status === 1){ |
| | | return '<a href="#" onclick="TDriverCommission.searchTDriverDetail('+row.id+')" style="color:green">详情</a>' |
| | | }else if (row.status === 2){ |
| | | return '<a href="#" onclick="TDriverCommission.searchTDriverDetail('+row.id+')" style="color:green">详情</a>' |
| | | } |
| | | } |
| | | } |
| | | ]; |
| | |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tDriver/driverDetail?tDriverId=' + id |
| | | content: Feng.ctxPath + '/tDriver/commission/driverCommissionDetail?tDriverId=' + id |
| | | }); |
| | | this.layerIndex = index; |
| | | }; |
| | |
| | | * 司机信息导出 |
| | | */ |
| | | TDriverCommission.export=function(){ |
| | | var createTime=$("#name").val() |
| | | var name=$("#name").val() |
| | | var phone=$("#phone").val() |
| | | var status=$("#status").val() |
| | | window.location.href=Feng.ctxPath + "/tDriver/export?name="+name |
| | | window.location.href=Feng.ctxPath + "/tDriver/export-commission?name="+name |
| | | +"&status="+status |
| | | +"&phone="+phone |
| | | ; |
New file |
| | |
| | | /** |
| | | * 管理初始化 |
| | | */ |
| | | var TDriverCommissionConnect = { |
| | | id: "TDriverCommissionConnectTable", //表格id |
| | | seItem: null, //选中的条目 |
| | | table: null, |
| | | layerIndex: -1 |
| | | }; |
| | | |
| | | /** |
| | | * 初始化表格的列 |
| | | */ |
| | | TDriverCommissionConnect.initColumn = function () { |
| | | return [ |
| | | {field: 'selectItem', radio: true}, |
| | | {title: '主键', field: 'id', visible: false, align: 'center', valign: 'middle'}, |
| | | {title: '关联层级', field: 'id', visible: false, align: 'center', valign: 'middle'}, |
| | | {title: '用户姓名', field: 'name', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '联系电话', field: 'phone', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '上级人员', field: 'inviterName', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '上级人员电话', field: 'inviterPhone', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '邀约人数', field: 'numberPromoters', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '状态', field: 'status', visible: true, align: 'center', valign: 'middle', |
| | | formatter: function (value, row) { |
| | | if (row.status === 1){ |
| | | return '<span>正常</span>' |
| | | }else if (row.status === 2){ |
| | | return '<span>冻结</span>' |
| | | }else if (row.status === 3){ |
| | | return '<span>已删除</span>' |
| | | } |
| | | }}, |
| | | {title: '关联人数', field: 'connectedPersons', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '操作', visible: true, align: 'center', valign: 'middle',width:150, |
| | | formatter: function (value, row) { |
| | | return '<a href="#" onclick="TDriverCommissionConnect.searchTDriverDetail('+row.id+')" style="color:blue">查询</a>' |
| | | } |
| | | } |
| | | ]; |
| | | }; |
| | | |
| | | /** |
| | | * 检查是否选中 |
| | | */ |
| | | TDriverCommissionConnect.check = function () { |
| | | var selected = $('#' + this.id).bootstrapTable('getSelections'); |
| | | if(selected.length == 0){ |
| | | Feng.info("请先选中表格中的某一记录!"); |
| | | return false; |
| | | }else{ |
| | | TDriverCommissionConnect.seItem = selected[0]; |
| | | return true; |
| | | } |
| | | }; |
| | | |
| | | /** |
| | | * 点击添加 |
| | | */ |
| | | TDriverCommissionConnect.openAddTDriver = function () { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: '添加', |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tDriver/tDriver_add' |
| | | }); |
| | | this.layerIndex = index; |
| | | }; |
| | | |
| | | /** |
| | | * 打开查看详情 |
| | | */ |
| | | TDriverCommissionConnect.openTDriverDetail = function () { |
| | | if (this.check()) { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: '详情', |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tDriver/tDriver_update/' + TDriver.seItem.id |
| | | }); |
| | | this.layerIndex = index; |
| | | } |
| | | }; |
| | | |
| | | /** |
| | | * 打开查看详情(使用中) |
| | | */ |
| | | TDriverCommissionConnect.searchTDriverDetail = function (id) { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: '详情', |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tDriver/commission/driverCommissionDetail?tDriverId=' + id |
| | | }); |
| | | this.layerIndex = index; |
| | | }; |
| | | |
| | | /** |
| | | * 删除 |
| | | */ |
| | | TDriverCommissionConnect.delete = function () { |
| | | if (this.check()) { |
| | | var ajax = new $ax(Feng.ctxPath + "/tDriver/delete", function (data) { |
| | | Feng.success("删除成功!"); |
| | | TDriverCommissionConnect.table.refresh(); |
| | | }, function (data) { |
| | | Feng.error("删除失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set("tDriverId",this.seItem.id); |
| | | ajax.start(); |
| | | } |
| | | }; |
| | | |
| | | |
| | | /** |
| | | * 查询列表 |
| | | */ |
| | | /*TDriverCommissionConnect.search = function () { |
| | | var queryData = {}; |
| | | queryData['name'] = $("#name").val(); |
| | | queryData['phone'] = $("#phone").val(); |
| | | queryData['status'] = $("#status").val(); |
| | | TDriverCommissionConnect.table.refresh({query: queryData}); |
| | | };*/ |
| | | |
| | | $(function () { |
| | | var defaultColunms = TDriverCommissionConnect.initColumn(); |
| | | var table = new BSTable(TDriverCommissionConnect.id, "/tDriver/commission/connect/list", defaultColunms); |
| | | table.setPaginationType("client"); |
| | | TDriverCommissionConnect.table = table.init(); |
| | | }); |
| | |
| | | .set('idcardBack') |
| | | .set('inviterType') |
| | | .set('inviterId') |
| | | .set('inviterName') |
| | | .set('inviterPhone') |
| | | .set('agentId') |
| | | .set('branchOfficeId') |
| | | .set('balance') |
| | |
| | | |
| | | //提交信息 |
| | | var ajax = new $ax(Feng.ctxPath + "/tDriver/add", function(data){ |
| | | if(data.code == 500){ |
| | | Feng.error("添加失败!" + data.message + "!"); |
| | | return false; |
| | | } |
| | | Feng.success("添加成功!"); |
| | | window.parent.TDriver.table.refresh(); |
| | | TDriverInfoDlg.close(); |
| | |
| | | |
| | | //提交信息 |
| | | var ajax = new $ax(Feng.ctxPath + "/tDriver/update", function(data){ |
| | | if(data.code == 500){ |
| | | Feng.error("修改失败!" + data.message + "!"); |
| | | return false; |
| | | } |
| | | Feng.success("修改成功!"); |
| | | window.parent.TDriver.table.refresh(); |
| | | TDriverInfoDlg.close(); |