From c2a1f5f286b8a7372811b61acf2f31303b68db61 Mon Sep 17 00:00:00 2001
From: xuhy <3313886187@qq.com>
Date: 星期三, 22 二月 2023 18:46:00 +0800
Subject: [PATCH] 司机管理新增,修改

---
 management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/resp/TDriverResp.java           |   49 ++
 management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TDriverServiceImpl.java       |   34 +
 management/guns-admin/src/main/webapp/static/modular/system/tAppUser/tAppUserException.js                        |    8 
 management/guns-admin/src/main/webapp/WEB-INF/view/system/tDriver/tDriver_add.html                               |  165 ++++++--
 management/guns-admin/src/main/webapp/WEB-INF/view/system/tDriver/tDriver_edit.html                              |  141 +++++++
 management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/resp/TAppUserResp.java          |   54 ++
 management/guns-admin/src/main/webapp/WEB-INF/view/system/tAgent/tAgent_add.html                                 |  115 +++--
 management/guns-admin/src/main/webapp/static/modular/system/tDriver/tDriver.js                                   |  100 +++++
 management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TAppUserController.java |   34 +
 management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/TOrderRefusalMapper.java               |    2 
 management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TAgentController.java   |    1 
 management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TDriverController.java  |  123 ++++++
 management/guns-admin/src/main/webapp/WEB-INF/view/system/tAppUser/tAppUserDetail.html                           |    2 
 management/guns-admin/src/main/webapp/WEB-INF/view/system/tDriver/tDriverArea.html                               |   42 ++
 management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TAgentServiceImpl.java        |    2 
 management/guns-admin/src/main/webapp/static/modular/system/tDriver/tDriver_info.js                              |    2 
 management/guns-admin/src/main/webapp/static/modular/system/tDriver/tOrderRefusal.js                             |  101 +++++
 management/guns-admin/src/main/webapp/static/modular/system/tAppUser/tAppUser.js                                 |    6 
 management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TDriver.java                         |   24 +
 management/guns-admin/src/main/webapp/WEB-INF/view/system/tDriver/tDriverDetail.html                             |   10 
 management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TAppUserServiceImpl.java      |    3 
 management/guns-admin/src/main/webapp/WEB-INF/view/system/tAppUser/tAppUserDetailException.html                  |    2 
 management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/util/UUIDUtil.java              |   99 +++++
 23 files changed, 981 insertions(+), 138 deletions(-)

diff --git a/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TAgentController.java b/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TAgentController.java
index 4e3dabe..4df1237 100644
--- a/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TAgentController.java
+++ b/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TAgentController.java
@@ -127,7 +127,6 @@
     @RequestMapping(value = "/add")
     @ResponseBody
     public Object add(TAgent tAgent) {
-        System.err.println(tAgent);
         String[] split = tAgent.getAreaId().split("/");
         // 查询省市
         // 黑龙江省/大兴安岭地区
diff --git a/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TAppUserController.java b/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TAppUserController.java
index db2eab3..2e10b03 100644
--- a/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TAppUserController.java
+++ b/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TAppUserController.java
@@ -3,13 +3,17 @@
 import com.baomidou.mybatisplus.mapper.EntityWrapper;
 import com.stylefeng.guns.core.base.controller.BaseController;
 import com.stylefeng.guns.core.log.LogObjectHolder;
+import com.stylefeng.guns.modular.system.controller.resp.TAppUserResp;
 import com.stylefeng.guns.modular.system.controller.util.ExcelUtil;
 import com.stylefeng.guns.modular.system.enums.CouponStatusEnum;
+import com.stylefeng.guns.modular.system.enums.OrderStateEnum;
 import com.stylefeng.guns.modular.system.exports.TAppUserExceptionExport;
 import com.stylefeng.guns.modular.system.model.TAppUser;
 import com.stylefeng.guns.modular.system.model.TCoupon;
+import com.stylefeng.guns.modular.system.model.TOrder;
 import com.stylefeng.guns.modular.system.service.ITAppUserService;
 import com.stylefeng.guns.modular.system.service.ITCouponService;
+import com.stylefeng.guns.modular.system.service.ITOrderService;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
@@ -18,10 +22,12 @@
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.ui.Model;
+import org.springframework.util.CollectionUtils;
 import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletResponse;
 import java.io.OutputStream;
+import java.math.BigDecimal;
 import java.text.DateFormat;
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;
@@ -46,6 +52,8 @@
     private ITAppUserService tAppUserService;
     @Autowired
     private ITCouponService tCouponService;
+    @Autowired
+    private ITOrderService tOrderService;
 
     /**
      * 跳转到首页
@@ -139,7 +147,6 @@
     @RequestMapping("/userDetail")
     public String userDetail(Integer tAppUserId, Model model) {
         tAppUserService.detail(tAppUserId,model);
-
         return PREFIX + "tAppUserDetail.html";
     }
 
@@ -164,7 +171,30 @@
         EntityWrapper<TAppUser> wrapper = tAppUserService.getUserListWrapper(createTime,nickname,phone,id,status);
         // 是否异常
         wrapper.eq("is_exception",2);
-        return tAppUserService.selectList(wrapper);
+        List<TAppUser> tAppUsers = tAppUserService.selectList(wrapper);
+        List<TAppUserResp> tAppUserRespList = new ArrayList<>(tAppUsers.size());
+        for (TAppUser tAppUser : tAppUsers) {
+            TAppUserResp tAppUserResp = new TAppUserResp();
+            BeanUtils.copyProperties(tAppUser,tAppUserResp);
+            List<TCoupon> tCoupons = tCouponService.selectList(new EntityWrapper<TCoupon>().eq("user_id", tAppUser.getId()));
+            List<TCoupon> notUsedList = tCoupons.stream().filter(coupon -> coupon.getCouponStatus().equals(CouponStatusEnum.NOT_USED.getCode())).collect(Collectors.toList());
+            tAppUserResp.setCouponSum(tCoupons.size());
+            tAppUserResp.setNotUsedCount(notUsedList.size());
+            List<TOrder> orders = tOrderService.selectList(new EntityWrapper<TOrder>().eq("userId", tAppUser.getId()).orderBy(true,"createTime",false));
+            if(!CollectionUtils.isEmpty(orders)){
+                List<TOrder> collect1 = orders.stream().filter(order->Objects.nonNull(order.getState()))
+                        .filter(order -> OrderStateEnum.WAIT_EVALUATED.getCode() == order.getState() ||
+                                OrderStateEnum.FINISH.getCode() == order.getState()).collect(Collectors.toList());
+                if(!CollectionUtils.isEmpty(collect1)) {
+                    tAppUserResp.setConsumeSum(collect1.size());
+                    // 总消费金额
+                    collect1.stream().map(TOrder::getPayMoney).reduce(BigDecimal::add)
+                            .ifPresent(tAppUserResp::setConsumePrice);
+                }
+            }
+            tAppUserRespList.add(tAppUserResp);
+        }
+        return tAppUserRespList;
     }
 
 
diff --git a/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TDriverController.java b/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TDriverController.java
index d49eb15..907dfaa 100644
--- a/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TDriverController.java
+++ b/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TDriverController.java
@@ -6,14 +6,19 @@
 import com.stylefeng.guns.core.shiro.ShiroUser;
 import com.stylefeng.guns.modular.system.controller.resp.TDriverResp;
 import com.stylefeng.guns.modular.system.controller.util.ExcelUtil;
-import com.stylefeng.guns.modular.system.model.TAgent;
-import com.stylefeng.guns.modular.system.model.TAppUser;
+import com.stylefeng.guns.modular.system.controller.util.UUIDUtil;
+import com.stylefeng.guns.modular.system.model.*;
+import com.stylefeng.guns.modular.system.service.ITAgentService;
+import com.stylefeng.guns.modular.system.service.ITBranchOfficeService;
+import com.stylefeng.guns.modular.system.service.ITRegionService;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiModelProperty;
 import io.swagger.annotations.ApiOperation;
+import org.apache.logging.log4j.core.util.UuidUtil;
 import org.apache.poi.hssf.usermodel.HSSFWorkbook;
 import org.apache.shiro.subject.Subject;
+import org.springframework.beans.BeanUtils;
 import org.springframework.stereotype.Controller;
 import org.springframework.util.StringUtils;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -23,7 +28,6 @@
 import org.springframework.beans.factory.annotation.Autowired;
 import com.stylefeng.guns.core.log.LogObjectHolder;
 import org.springframework.web.bind.annotation.RequestParam;
-import com.stylefeng.guns.modular.system.model.TDriver;
 import com.stylefeng.guns.modular.system.service.ITDriverService;
 
 import javax.servlet.http.HttpServletResponse;
@@ -50,6 +54,15 @@
     @Autowired
     private ITDriverService tDriverService;
 
+    @Autowired
+    private ITRegionService tRegionService;
+
+    @Autowired
+    private ITAgentService tAgentService;
+
+    @Autowired
+    private ITBranchOfficeService tBranchOfficeService;
+
     /**
      * 跳转到首页
      */
@@ -69,10 +82,31 @@
     /**
      * 跳转到修改
      */
-    @RequestMapping("/tDriver_update/{tDriverId}")
-    public String tDriverUpdate(@PathVariable Integer tDriverId, Model model) {
+    @RequestMapping("/tDriver_update")
+    public String tDriverUpdate( Integer tDriverId, Model model) {
         TDriver tDriver = tDriverService.selectById(tDriverId);
-        model.addAttribute("item",tDriver);
+        TDriverResp tDriverResp = new TDriverResp();
+        BeanUtils.copyProperties(tDriver,tDriverResp);
+
+        // 查询邀请人
+        TDriver tDriver1 = tDriverService.selectById(tDriver.getInviterId());
+        if(Objects.nonNull(tDriver1)){
+            tDriverResp.setInviterName(tDriver1.getName());
+            tDriverResp.setInviterPhone(tDriver1.getPhone());
+        }
+
+        // 查询区域
+        TRegion district = tRegionService.selectOne(new EntityWrapper<TRegion>().eq("code", tDriver.getAreaCode())
+                .last("LIMIT 1"));
+        TRegion city = tRegionService.selectOne(new EntityWrapper<TRegion>().eq("code", tDriver.getCityCode())
+                .last("LIMIT 1"));
+
+        tDriverResp.setArea(tDriver.getProvinceName()+"/"+tDriver.getCityName()+"/"+tDriver.getAreaName());
+        if(Objects.nonNull(district) && Objects.nonNull(city)){
+            tDriverResp.setAreaId(city.getParentId()+"/"+city.getId()+"/"+district.getId());
+        }
+
+        model.addAttribute("item",tDriverResp);
         LogObjectHolder.me().set(tDriver);
         return PREFIX + "tDriver_edit.html";
     }
@@ -140,8 +174,17 @@
     @RequestMapping("/driverDetail")
     public String driverDetail(Integer tDriverId, Model model) {
         tDriverService.detail(tDriverId,model);
-
         return PREFIX + "tDriverDetail.html";
+    }
+
+    /**
+     * 跳转区域页面
+     */
+    @RequestMapping("/areaPage")
+    public String areaDetail(Model model) {
+        List<TRegion> tRegions = tRegionService.selectList(new EntityWrapper<TRegion>().eq("parent_id", 0));
+        model.addAttribute("province",tRegions);
+        return PREFIX + "tDriverArea.html";
     }
 
     /**
@@ -200,6 +243,56 @@
     @RequestMapping(value = "/add")
     @ResponseBody
     public Object add(TDriver tDriver) {
+
+        int count = tDriverService.selectCount(new EntityWrapper<TDriver>().eq("phone", tDriver.getPhone()));
+        if(count>0){
+            return "该司机已存在!";
+        }
+
+        // 对省市区做处理
+        String[] split = tDriver.getAreaId().split("/");
+        // 查询省市
+        // 黑龙江省/大兴安岭地区
+        // 702/852
+        TRegion province = tRegionService.selectById(split[0]);
+        tDriver.setProvinceName(province.getName());
+        tDriver.setProvinceCode(province.getCode());
+
+        TRegion city = tRegionService.selectById(split[1]);
+        tDriver.setCityName(city.getName());
+        tDriver.setCityCode(city.getCode());
+
+        TRegion area = tRegionService.selectById(split[2]);
+        tDriver.setAreaName(area.getName());
+        tDriver.setAreaCode(area.getCode());
+
+        tDriver.setCode(UUIDUtil.getNumberRandom(16));
+        tDriver.setBalance(BigDecimal.ZERO);
+        tDriver.setBackgroundBalance(BigDecimal.ZERO);
+
+        // 通过省市查询代理商
+        TAgent tAgent = tAgentService.selectOne(new EntityWrapper<TAgent>().eq("provinceCode", province.getCode())
+                .eq("cityCode", city.getCode())
+                .last("LIMIT 1"));
+        if(Objects.nonNull(tAgent)){
+            tDriver.setAgentId(tAgent.getId());
+        }
+        // 查询邀约人(司机端)
+        TDriver emergencyDriver = tDriverService.selectOne(new EntityWrapper<TDriver>().eq("phone", tDriver.getEmergencyPhone())
+                .last("LIMIT 1"));
+        if(Objects.nonNull(emergencyDriver)){
+            tDriver.setInviterId(emergencyDriver.getId());
+            tDriver.setInviterType(2);
+        }
+        // 通过省市区查询分公司
+        TBranchOffice tBranchOffice = tBranchOfficeService.selectOne(new EntityWrapper<TBranchOffice>().eq("provinceCode", province.getCode())
+                .eq("cityCode", city.getCode())
+                .eq("districtCode", area.getCode())
+                .last("LIMIT 1"));
+        if(Objects.nonNull(tBranchOffice)){
+            tDriver.setBranchOfficeId(tBranchOffice.getId());
+        }
+
         tDriverService.insert(tDriver);
         return SUCCESS_TIP;
     }
@@ -265,6 +358,22 @@
         return tDriverService.selectById(tDriverId);
     }
 
+    @ApiOperation(value = "省查询",notes="省查询")
+    @RequestMapping(value = "/areaProvince")
+    @ResponseBody
+    public Object areaProvince(Model model) {
+        return tRegionService.selectList(new EntityWrapper<TRegion>().eq("parent_id", 0));
+    }
+
+    @ApiOperation(value = "市区查询",notes="市区查询")
+    @RequestMapping(value = "/areaCity")
+    @ResponseBody
+    public Object areaCity(Integer parentId) {
+        return tRegionService.selectList(new EntityWrapper<TRegion>().eq("parent_id",parentId));
+    }
+
+
+
     @ApiOperation(value = "导出司机列表",notes="导出司机列表")
     @ApiImplicitParams({
             @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."),
diff --git a/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/resp/TAppUserResp.java b/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/resp/TAppUserResp.java
new file mode 100644
index 0000000..2522e2f
--- /dev/null
+++ b/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/resp/TAppUserResp.java
@@ -0,0 +1,54 @@
+package com.stylefeng.guns.modular.system.controller.resp;
+
+import com.stylefeng.guns.modular.system.model.TAppUser;
+import com.stylefeng.guns.modular.system.model.TOrder;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.math.BigDecimal;
+
+public class TAppUserResp extends TAppUser {
+
+    @ApiModelProperty(value = "优惠券总数")
+    private Integer couponSum;
+
+    @ApiModelProperty(value = "剩余优惠券")
+    private  Integer notUsedCount;
+
+    @ApiModelProperty(value = "消费次数")
+    private  Integer consumeSum;
+
+    @ApiModelProperty(value = "历史消费")
+    private BigDecimal consumePrice;
+
+    public Integer getCouponSum() {
+        return couponSum;
+    }
+
+    public void setCouponSum(Integer couponSum) {
+        this.couponSum = couponSum;
+    }
+
+    public Integer getNotUsedCount() {
+        return notUsedCount;
+    }
+
+    public void setNotUsedCount(Integer notUsedCount) {
+        this.notUsedCount = notUsedCount;
+    }
+
+    public Integer getConsumeSum() {
+        return consumeSum;
+    }
+
+    public void setConsumeSum(Integer consumeSum) {
+        this.consumeSum = consumeSum;
+    }
+
+    public BigDecimal getConsumePrice() {
+        return consumePrice;
+    }
+
+    public void setConsumePrice(BigDecimal consumePrice) {
+        this.consumePrice = consumePrice;
+    }
+}
diff --git a/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/resp/TDriverResp.java b/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/resp/TDriverResp.java
index cc7c340..3230778 100644
--- a/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/resp/TDriverResp.java
+++ b/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/resp/TDriverResp.java
@@ -25,6 +25,55 @@
     @ApiModelProperty(value = "连续未上线天数")
     private Integer notOnlineCount;
 
+
+    @ApiModelProperty(value = "邀请人姓名")
+    private String inviterName;
+
+    @ApiModelProperty(value = "邀请人电话")
+    private String inviterPhone;
+
+    @ApiModelProperty(value = "加盟区域")
+    private String area;
+
+    @ApiModelProperty(value = "加盟区域ID")
+    private String areaId;
+
+    @Override
+    public String getAreaId() {
+        return areaId;
+    }
+
+    @Override
+    public void setAreaId(String areaId) {
+        this.areaId = areaId;
+    }
+
+    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;
+    }
+
+    @Override
+    public String getArea() {
+        return area;
+    }
+
+    @Override
+    public void setArea(String area) {
+        this.area = area;
+    }
+
     public Integer getNotOnlineCount() {
         return notOnlineCount;
     }
diff --git a/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/util/UUIDUtil.java b/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/util/UUIDUtil.java
new file mode 100644
index 0000000..394feb2
--- /dev/null
+++ b/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/util/UUIDUtil.java
@@ -0,0 +1,99 @@
+package com.stylefeng.guns.modular.system.controller.util;
+
+
+
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.UUID;
+
+/**
+ * 定义生成随机码的工具类
+ */
+public class UUIDUtil {
+
+    private int i = 1;
+
+
+    /**
+     * 定义生成原生的UUID随机码
+     * @return
+     */
+    public static String getNativeUUID(){
+        return UUID.randomUUID().toString();
+    }
+
+
+    /**
+     * 生成32位随机码
+     * @return
+     */
+    public static String getRandomCode(){
+        return UUIDUtil.getNativeUUID().replaceAll("-", "");
+    }
+
+
+    /**
+     * 获取给定长度的随机码
+     * @param num
+     * @return
+     * @throws Exception
+     */
+    public static String getRandomCode(Integer num) throws Exception{
+        String str = null;
+        if(0 < num){
+            if(num % 32 > 0){
+                Integer s = num / 32;
+                Integer l = num % 32;
+                StringBuffer sb = new StringBuffer();
+                for(int i = 0; i < s; i++){
+                    sb.append(UUIDUtil.getRandomCode());
+                }
+                sb.append(UUIDUtil.getRandomCode().substring(0, l));
+                str = sb.toString();
+            }else if(num % 32 == 0){
+                Integer s = num / 32;
+                StringBuffer sb = new StringBuffer();
+                for(int i = 0; i < s; i++){
+                    sb.append(UUIDUtil.getRandomCode());
+                }
+                str = sb.toString();
+            }else{
+                str = UUIDUtil.getRandomCode().substring(0, num);
+            }
+        }else{
+            throw new Exception("参数只能大于0");
+        }
+        return str;
+    }
+
+
+    /**
+     * 获取根据当前时间的字符串数据
+     * @return
+     */
+    public synchronized static String getTimeStr(){
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMddHHmmssSSS");
+        return simpleDateFormat.format(new Date());
+    }
+
+
+
+    /**
+     * @Description: 获取数字随机码
+     * @Author pzb
+     * @Date 2021/8/11 16:52
+     * @Param
+     * @Return
+     * @Exception
+     */
+    public static String getNumberRandom(Integer num){
+        if(null == num){
+            num = 32;
+        }
+        StringBuffer sb = new StringBuffer();
+        for(int i = 0; i < num; i++){
+            sb.append(Double.valueOf(Math.random() * 10).intValue());
+        }
+        return sb.toString();
+    }
+}
diff --git a/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/TOrderRefusalMapper.java b/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/TOrderRefusalMapper.java
index 2cbe428..e54ca9b 100644
--- a/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/TOrderRefusalMapper.java
+++ b/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/TOrderRefusalMapper.java
@@ -2,6 +2,7 @@
 
 import com.stylefeng.guns.modular.system.model.TOrderRefusal;
 import com.baomidou.mybatisplus.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
 
 /**
  * <p>
@@ -11,6 +12,7 @@
  * @author stylefeng
  * @since 2023-02-21
  */
+@Mapper
 public interface TOrderRefusalMapper extends BaseMapper<TOrderRefusal> {
 
 }
diff --git a/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TDriver.java b/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TDriver.java
index 778bd4f..fdb2968 100644
--- a/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TDriver.java
+++ b/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TDriver.java
@@ -166,6 +166,30 @@
     @ApiModelProperty(value = "驾驶证初次领证时间")
     private Date firstCertificateTime;
 
+    @TableField(exist = false)
+    @ApiModelProperty(value = "区域")
+    private String area;
+
+    @TableField(exist = false)
+    @ApiModelProperty(value = "区域id")
+    private String areaId;
+
+    public String getArea() {
+        return area;
+    }
+
+    public void setArea(String area) {
+        this.area = area;
+    }
+
+    public String getAreaId() {
+        return areaId;
+    }
+
+    public void setAreaId(String areaId) {
+        this.areaId = areaId;
+    }
+
     public Date getFirstCertificateTime() {
         return firstCertificateTime;
     }
diff --git a/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TAgentServiceImpl.java b/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TAgentServiceImpl.java
index 3ba7242..584192f 100644
--- a/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TAgentServiceImpl.java
+++ b/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TAgentServiceImpl.java
@@ -168,7 +168,7 @@
 
             if(!CollectionUtils.isEmpty(tDrivers)){
                 // 司机数
-                List<TDriver> drivers = tDrivers.stream().filter(driver -> driver.getAgentId().equals(tAgent.getId())).collect(Collectors.toList());
+                List<TDriver> drivers = tDrivers.stream().filter(driver -> tAgent.getId().equals(driver.getAgentId())).collect(Collectors.toList());
                 tAgentResp.setDriverCount(drivers.size());
                 // 司机充值计算
                 List<Integer> driverIds = drivers.stream().map(TDriver::getId).collect(Collectors.toList());
diff --git a/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TAppUserServiceImpl.java b/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TAppUserServiceImpl.java
index ceb0da7..a151726 100644
--- a/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TAppUserServiceImpl.java
+++ b/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TAppUserServiceImpl.java
@@ -53,7 +53,7 @@
         model.addAttribute("nickname",tAppUser.getNickname());
         model.addAttribute("remark",tAppUser.getRemark());
         model.addAttribute("createTime",DateUtil.formatDate(tAppUser.getCreateTime()));
-        // 客户渠道
+        //  todo 客户渠道
         model.addAttribute("customerChannel","");
 
         // 消费信息:优惠券数据
@@ -61,6 +61,7 @@
         List<TCoupon> notUsedList = tCoupons.stream().filter(coupon -> coupon.getCouponStatus().equals(CouponStatusEnum.NOT_USED.getCode())).collect(Collectors.toList());
         List<TCoupon> usedList = tCoupons.stream().filter(coupon -> coupon.getCouponStatus().equals(CouponStatusEnum.USED.getCode())).collect(Collectors.toList());
         List<TCoupon> expiredList = tCoupons.stream().filter(coupon -> coupon.getCouponStatus().equals(CouponStatusEnum.EXPIRED.getCode())).collect(Collectors.toList());
+        model.addAttribute("couponSum",tCoupons.size());
         model.addAttribute("notUsedCount",notUsedList.size());
         model.addAttribute("usedCount",usedList.size());
         model.addAttribute("expiredCount",expiredList.size());
diff --git a/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TDriverServiceImpl.java b/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TDriverServiceImpl.java
index 9d0bbb6..65a23b0 100644
--- a/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TDriverServiceImpl.java
+++ b/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TDriverServiceImpl.java
@@ -47,6 +47,8 @@
     private TDriverMapper tDriverMapper;
     @Autowired
     private TAppUserMapper tAppUserMapper;
+    @Autowired
+    private TOrderRefusalMapper tOrderRefusalMapper;
 
     @Override
     public EntityWrapper<TDriver> getPageList(String createTime, String phone, Integer status) {
@@ -104,10 +106,9 @@
                     && order.getState().equals(OrderStateEnum.WAIT_EVALUATED.getCode()) && order.getState().equals(OrderStateEnum.FINISH.getCode())
             && new SimpleDateFormat("yyyyMM").format(order.getCreateTime()).equals(monthDate)).collect(Collectors.toList());
             tDriverResp.setMonthOrderCount(monthOrderCount.size());
-            // TODO 拒单次数
-            List<TOrder> refusalCount = tOrders.stream().filter(order -> order.getDriverId().equals(tDriver.getId())
-                    && order.getState().equals(OrderStateEnum.CANCELED.getCode())).collect(Collectors.toList());
-            tDriverResp.setRefusalCount(refusalCount.size());
+            // 拒单次数
+            List<TOrderRefusal> driverRefusalList = tOrderRefusalMapper.selectList(new EntityWrapper<TOrderRefusal>().eq("driver_id", tDriver.getId()));
+            tDriverResp.setRefusalCount(driverRefusalList.size());
 
             tDriverRespList.add(tDriverResp);
         }
@@ -137,11 +138,15 @@
         model.addAttribute("createTime",new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(tDriver.getCreateTime()));
 
         // 计算驾龄
-        ZoneId zoneId = ZoneId.systemDefault();
-        LocalDate firstTime = tDriver.getFirstCertificateTime().toInstant().atZone(zoneId).toLocalDate();
-        LocalDate now = tDriver.getFirstCertificateTime().toInstant().atZone(zoneId).toLocalDate();
-        Period period = Period.between(firstTime, now);
-        model.addAttribute("drivingExperience",period.getYears());
+        if(Objects.nonNull(tDriver.getFirstCertificateTime())){
+            ZoneId zoneId = ZoneId.systemDefault();
+            LocalDate firstTime = tDriver.getFirstCertificateTime().toInstant().atZone(zoneId).toLocalDate();
+            LocalDate now = tDriver.getFirstCertificateTime().toInstant().atZone(zoneId).toLocalDate();
+            Period period = Period.between(firstTime, now);
+            model.addAttribute("drivingExperience",period.getYears());
+        }else {
+            model.addAttribute("drivingExperience",0);
+        }
 
         List<TOrder> tOrders = tOrderMapper.selectList(new EntityWrapper<TOrder>());
 
@@ -166,11 +171,11 @@
         }
 
         // 查询邀请人
-        if(1 == tDriver.getInviterType()){
+        if(Objects.nonNull(tDriver.getInviterType()) && 1 == tDriver.getInviterType()){
             TAppUser tAppUser = tAppUserMapper.selectById(tDriver.getInviterId());
             model.addAttribute("inviterName",tAppUser.getNickname());
             model.addAttribute("inviterPhone",tAppUser.getPhone());
-        }else if(2 == tDriver.getInviterType()){
+        }else if(Objects.nonNull(tDriver.getInviterType()) && 2 == tDriver.getInviterType()){
             TDriver tDriver1 = tDriverMapper.selectById(tDriver.getInviterId());
             model.addAttribute("inviterName",tDriver1.getName());
             model.addAttribute("inviterPhone",tDriver1.getPhone());
@@ -189,10 +194,9 @@
                     && order.getState().equals(OrderStateEnum.WAIT_EVALUATED.getCode()) && order.getState().equals(OrderStateEnum.FINISH.getCode())
                     && new SimpleDateFormat("yyyyMM").format(order.getCreateTime()).equals(monthDate)).collect(Collectors.toList());
             model.addAttribute("monthOrderCount",monthOrderCount.size());
-            // TODO 拒单次数
-            List<TOrder> refusalCount = tOrders.stream().filter(order -> order.getDriverId().equals(tDriver.getId())
-                    && order.getState().equals(OrderStateEnum.CANCELED.getCode())).collect(Collectors.toList());
-            model.addAttribute("refusalCount",refusalCount.size());
+            // 拒单次数
+            List<TOrderRefusal> driverRefusalList = tOrderRefusalMapper.selectList(new EntityWrapper<TOrderRefusal>().eq("driver_id", tDriver.getId()));
+            model.addAttribute("refusalCount",driverRefusalList.size());
         }else {
             model.addAttribute("cumulativeOrderCount","");
             model.addAttribute("monthOrderCount","");
diff --git a/management/guns-admin/src/main/webapp/WEB-INF/view/system/tAgent/tAgent_add.html b/management/guns-admin/src/main/webapp/WEB-INF/view/system/tAgent/tAgent_add.html
index a86a8cf..ae8f418 100644
--- a/management/guns-admin/src/main/webapp/WEB-INF/view/system/tAgent/tAgent_add.html
+++ b/management/guns-admin/src/main/webapp/WEB-INF/view/system/tAgent/tAgent_add.html
@@ -3,71 +3,82 @@
     <div class="ibox-content">
         <div class="form-horizontal">
 
-            <div class="row">
-                <input hidden id="areaId" value="areaId">
-                <div class="col-sm-12">
-                    <div class="form-group">
-                        <label class="col-sm-3 control-label">负责人姓名:</label>
-                        <div class="col-sm-6">
-                            <input class="form-control" id="principal" name="principal" type="text">
+            <div class="row" >
+                <div class="col-sm-12" style="text-align: center">
+                    <input hidden id="areaId" value="areaId">
+                    <div class="initialLevel col-sm-12 control-label form-group" style="text-align: center">
+                        <div class="initialLevel col-sm-6 control-label form-group"  >
+                            <span style="color:red">*</span>
+                            <label class="control-label" >负责人姓名:</label>
+                            <input id="principal" name="principal" type="text" style="height: 30px" required>
                         </div>
                     </div>
-                    <div class="hr-line-dashed"></div>
-                </div>
-                <div class="col-sm-12">
-                    <div class="form-group">
-                        <label class="col-sm-3 control-label">联系电话:</label>
-                        <div class="col-sm-6">
-                            <input class="form-control" id="principalPhone" name="principalPhone" type="text">
+                    <!--<div class="col-sm-12">
+                        <div class="form-group">
+                            <span style="color:red">*</span>
+                            <label class="col-sm-3 control-label">负责人姓名:</label>
+                            <div class="col-sm-6">
+                                <input class="form-control" id="principal" name="principal" type="text">
+                            </div>
+                        </div>
+                        <div class="hr-line-dashed"></div>
+                    </div>-->
+                    <div class="initialLevel col-sm-12 control-label form-group">
+                        <div class="initialLevel col-sm-6 control-label form-group"  >
+                            <span style="color:red">*</span>
+                            <label class="control-label" >联系电话:</label>
+                            <input id="principalPhone" name="principalPhone" type="number" style="height: 30px" required>
                         </div>
                     </div>
-                    <div class="hr-line-dashed"></div>
-                </div>
-                <div class="col-sm-12">
-                    <div class="form-group">
-                        <label class="col-sm-3 control-label">邮箱:</label>
-                        <div class="col-sm-6">
-                            <input class="form-control" id="email" name="email" type="text">
+
+                    <div class="initialLevel col-sm-12 control-label form-group">
+                        <div class="initialLevel col-sm-6 control-label form-group"  >
+                            <label class="control-label" >邮箱:</label>
+                            <input id="email" name="email" type="email" style="height: 30px" required>
                         </div>
                     </div>
-                    <div class="hr-line-dashed"></div>
+
+                    <div class="initialLevel col-sm-12 control-label form-group">
+                        <div class="initialLevel col-sm-6 control-label form-group"  >
+                            <span style="color:red">*</span>
+                            <label class="control-label" >代理区域:</label>
+                            <input id="area" onclick="TAgent.area()" name="area" placeholder="请选择" style="height: 30px" readonly>
+                        </div>
+                    </div>
+
+                    <!--<div class="col-sm-12">
+                        <div class="form-group">
+                            <span style="color:red">*</span>
+                            <label class="col-sm-3 control-label">代理区域:</label>
+                            <div class="col-sm-6">
+                                <input class="form-control" id="area" onclick="TAgent.area()" name="area" type="text" placeholder="请选择">
+                            </div>
+                        </div>
+                        <div class="hr-line-dashed"></div>
+                    </div>-->
+
+                    <div class="initialLevel col-sm-12 control-label form-group">
+                        <div class="initialLevel col-sm-6 control-label form-group"  >
+                            <label class="control-label" >开户银行:</label>
+                            <input id="bankDeposit" name="bankDeposit" type="text" style="height: 30px" required>
+                        </div>
+                    </div>
+
+                    <div class="initialLevel col-sm-12 control-label form-group">
+                        <div class="initialLevel col-sm-6 control-label form-group"  >
+                            <label class="control-label" >银行账户:</label>
+                            <input id="bankAccount" name="bankAccount" type="number" style="height: 30px" required>
+                        </div>
+                    </div>
+
                 </div>
 
-                <div class="col-sm-12">
-                    <div class="form-group">
-                        <label class="col-sm-3 control-label">代理区域:</label>
-                        <div class="col-sm-6">
-                            <input class="form-control" id="area" onclick="TAgent.area()" name="area" type="text" placeholder="请选择">
-                        </div>
-                    </div>
-                    <div class="hr-line-dashed"></div>
-                </div>
-
-                <div class="col-sm-12">
-                    <div class="form-group">
-                        <label class="col-sm-3 control-label">开户银行:</label>
-                        <div class="col-sm-6">
-                            <input class="form-control" id="bankDeposit" name="bankDeposit" type="text">
-                        </div>
-                    </div>
-                    <div class="hr-line-dashed"></div>
-                </div>
-
-                <div class="col-sm-12">
-                    <div class="form-group">
-                        <label class="col-sm-3 control-label">银行账户:</label>
-                        <div class="col-sm-6">
-                            <input class="form-control" id="bankAccount" name="bankAccount" type="text">
-                        </div>
-                    </div>
-                    <div class="hr-line-dashed"></div>
-                </div>
             </div>
 
             <div class="row btn-group-m-t">
                 <div class="col-sm-10" style="text-align: center">
-                    <#button btnCss="info" name="提交" id="ensure" icon="fa-check" clickFun="TAgentInfoDlg.addSubmit()"/>
                     <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" clickFun="TAgentInfoDlg.close()"/>
+                    <#button btnCss="info" name="提交" id="ensure" icon="fa-check" clickFun="TAgentInfoDlg.addSubmit()"/>
                 </div>
             </div>
         </div>
diff --git a/management/guns-admin/src/main/webapp/WEB-INF/view/system/tAppUser/tAppUserDetail.html b/management/guns-admin/src/main/webapp/WEB-INF/view/system/tAppUser/tAppUserDetail.html
index c587b89..2fa1341 100644
--- a/management/guns-admin/src/main/webapp/WEB-INF/view/system/tAppUser/tAppUserDetail.html
+++ b/management/guns-admin/src/main/webapp/WEB-INF/view/system/tAppUser/tAppUserDetail.html
@@ -18,7 +18,7 @@
 
                         <div class="initialLevel col-sm-12 control-label form-group"  >
                             <div class="initialLevel col-sm-1 control-label form-group"  style="margin-left: 10px" >
-                                <img src="https://lmg.jj20.com/up/allimg/1114/040221103339/210402103339-7-1200.jpg" />
+                                <img src="${avatar}" style="height: 100px;width: 100px"/>
                             </div>
                             <div class="initialLevel col-sm-3 control-label form-group"  >
                                 <label class="control-label" >昵称:</label>
diff --git a/management/guns-admin/src/main/webapp/WEB-INF/view/system/tAppUser/tAppUserDetailException.html b/management/guns-admin/src/main/webapp/WEB-INF/view/system/tAppUser/tAppUserDetailException.html
index 49027f2..aa752b8 100644
--- a/management/guns-admin/src/main/webapp/WEB-INF/view/system/tAppUser/tAppUserDetailException.html
+++ b/management/guns-admin/src/main/webapp/WEB-INF/view/system/tAppUser/tAppUserDetailException.html
@@ -18,7 +18,7 @@
 
                         <div class="initialLevel col-sm-12 control-label form-group"  >
                             <div class="initialLevel col-sm-1 control-label form-group"  style="margin-left: 10px" >
-                                <img src="https://lmg.jj20.com/up/allimg/1114/040221103339/210402103339-7-1200.jpg" />
+                                <img src="${avatar}" style="height: 100px;width: 100px"/>
                             </div>
                             <div class="initialLevel col-sm-3 control-label form-group" >
                                 <label class="control-label" >昵称:</label>
diff --git a/management/guns-admin/src/main/webapp/WEB-INF/view/system/tDriver/tDriverArea.html b/management/guns-admin/src/main/webapp/WEB-INF/view/system/tDriver/tDriverArea.html
new file mode 100644
index 0000000..11100a6
--- /dev/null
+++ b/management/guns-admin/src/main/webapp/WEB-INF/view/system/tDriver/tDriverArea.html
@@ -0,0 +1,42 @@
+@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 province){
+                                <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 value="">请选择市</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 value="">请选择区</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>
+@}
diff --git a/management/guns-admin/src/main/webapp/WEB-INF/view/system/tDriver/tDriverDetail.html b/management/guns-admin/src/main/webapp/WEB-INF/view/system/tDriver/tDriverDetail.html
index a4a6e19..5e45363 100644
--- a/management/guns-admin/src/main/webapp/WEB-INF/view/system/tDriver/tDriverDetail.html
+++ b/management/guns-admin/src/main/webapp/WEB-INF/view/system/tDriver/tDriverDetail.html
@@ -66,11 +66,11 @@
                         <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>
-                                <img src="https://lmg.jj20.com/up/allimg/1114/040221103339/210402103339-7-1200.jpg" />
+                                <img id="" src="${idcardFront}" style="height: 100px;width: 100px"/>
                             </div>
                             <div class="initialLevel col-sm-2 control-label form-group" >
                                 <label class="control-label">身份证背面照:</label>
-                                <img src="https://lmg.jj20.com/up/allimg/1114/040221103339/210402103339-7-1200.jpg" />
+                                <img src="${idcardBack}" style="height: 100px;width: 100px"/>
                             </div>
                         </div>
 
@@ -152,13 +152,13 @@
 </div>
 <script src="${ctxPath}/static/modular/system/tDriver/tDriver.js"></script>
 <script src="${ctxPath}/static/modular/system/tDriver/tDriver_info.js"></script>
-<script src="${ctxPath}/static/modular/system/tOrderRefusal/tOrderRefusal.js"></script>
+<script src="${ctxPath}/static/modular/system/tDriver/tOrderRefusal.js"></script>
 <script type="text/javascript">
-    /*$(function () {
+    $(function () {
         var queryData = {};
         queryData['condition'] = $("#driverId").val();;
         TOrderRefusal.table.refresh({query: queryData});
-    });*/
+    });
     laydate.render({
         elem: '#createTime',
         type: 'date',
diff --git a/management/guns-admin/src/main/webapp/WEB-INF/view/system/tDriver/tDriver_add.html b/management/guns-admin/src/main/webapp/WEB-INF/view/system/tDriver/tDriver_add.html
index 615e008..90fb3a1 100644
--- a/management/guns-admin/src/main/webapp/WEB-INF/view/system/tDriver/tDriver_add.html
+++ b/management/guns-admin/src/main/webapp/WEB-INF/view/system/tDriver/tDriver_add.html
@@ -1,53 +1,132 @@
 @layout("/common/_container.html"){
-<div class="ibox float-e-margins">
-    <div class="ibox-content">
-        <div class="form-horizontal">
-
-            <div class="row">
-                <div class="col-sm-6 b-r">
-                            <#input id="id" name="主键" underline="true"/>
-                            <#input id="code" name="编号" underline="true"/>
-                            <#input id="name" name="姓名" underline="true"/>
-                            <#input id="avatar" name="头像" underline="true"/>
-                            <#input id="phone" name="手机号" underline="true"/>
-                            <#input id="password" name="密码" underline="true"/>
-                            <#input id="sex" name="性别(1=男,2=女)" underline="true"/>
-                            <#input id="source" name="来源(1=)" underline="true"/>
-                            <#input id="emergencyContact" name="紧急联系人" underline="true"/>
-                            <#input id="emergencyPhone" name="紧急联系电话" underline="true"/>
-                            <#input id="driverLicenseNumber" name="驾驶证号码" underline="true"/>
-                            <#input id="driverLicense" name="驾驶证照片" underline="true"/>
-                            <#input id="idcard" name="身份证号码" underline="true"/>
-                            <#input id="idcardFront" name="身份证正面照"/>
-                </div>
-
-                <div class="col-sm-6">
-                            <#input id="idcardBack" name="身份证背面照" underline="true"/>
-                            <#input id="inviterType" name="邀约人类型(1=用户,2=司机)" underline="true"/>
-                            <#input id="inviterId" name="邀约人id" underline="true"/>
-                            <#input id="agentId" name="代理商id" underline="true"/>
-                            <#input id="branchOfficeId" name="分公司id" underline="true"/>
-                            <#input id="balance" name="账户余额" underline="true"/>
-                            <#input id="approvalStatus" name="审核状态(1=待审核,2=已同意,3=已拒绝)" underline="true"/>
-                            <#input id="approvalNotes" name="审核注释" underline="true"/>
-                            <#input id="approvalUserId" name="审核用户id" underline="true"/>
-                            <#input id="approvalTime" name="审核时间" underline="true"/>
-                            <#input id="serverStatus" name="服务状态(1=空闲,2=服务中)" underline="true"/>
-                            <#input id="integral" name="剩余积分" underline="true"/>
-                            <#input id="status" name="状态(1=正常,2=冻结,3=删除)" underline="true"/>
-                            <#input id="createTime" name="添加时间" underline="true"/>
-                </div>
+<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="areaId" value="${areaId}">
+                        <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;text-align:left;">司机信息</label>
+                            </div>
+                        </div>
+                        <hr/>
+                        <div class="col-sm-12"  style="cursor: pointer;text-align: right;">
+                            <div class="initialLevel col-sm-12 control-label form-group"  >
+                                <div class="initialLevel col-sm-3 control-label form-group"  >
+                                    <span style="color:red">*</span>
+                                    <label class="control-label" >姓名:</label>
+                                    <input id="name" type="text" style="height: 30px" required>
+                                </div>
+                                <div class="initialLevel col-sm-3 control-label form-group"  >
+                                    <span style="color:red">*</span>
+                                    <label class="control-label" >手机号:</label>
+                                    <input id="phone" type="number" style="height: 30px" required>
+                                </div>
+                            </div>
 
-            <div class="row btn-group-m-t">
-                <div class="col-sm-10">
-                    <#button btnCss="info" name="提交" id="ensure" icon="fa-check" clickFun="TDriverInfoDlg.addSubmit()"/>
-                    <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" clickFun="TDriverInfoDlg.close()"/>
+                            <div class="initialLevel col-sm-12 control-label form-group"  >
+                                <div class="initialLevel col-sm-3 control-label form-group"  >
+                                    <span style="color:red">*</span>
+                                    <label class="control-label" >紧急联系人姓名:</label>
+                                    <input id="emergencyContact" type="text" style="height: 30px" required>
+                                </div>
+                                <div class="initialLevel col-sm-3 control-label form-group"  >
+                                    <span style="color:red">*</span>
+                                    <label class="control-label" >紧急联系人电话:</label>
+                                    <input id="emergencyPhone" type="number" style="height: 30px" required>
+                                </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>
+                                    <input id="inviterName" type="text" style="height: 30px">
+                                </div>
+                                <div class="initialLevel col-sm-3 control-label form-group"  >
+                                    <label class="control-label" >邀约人电话:</label>
+                                    <input id="inviterPhone" type="number" style="height: 30px">
+                                </div>
+                            </div>
+
+                            <div class="initialLevel col-sm-12 control-label form-group"  >
+                            <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>
+                            </div>
+                        </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;text-align:right">认证资料</label>
+                            </div>
+                        </div>
+                        <hr/>
+
+                        <div class="col-sm-12">
+                            <div class="initialLevel col-sm-12 control-label form-group"  >
+                                <div class="initialLevel col-sm-3 control-label form-group"  >
+                                    <span style="color:red">*</span>
+                                    <label class="control-label" >身份证号码:</label>
+                                    <input id="idcard" type="text" style="height: 30px" required>
+                                </div>
+                            </div>
+
+                            <div class="initialLevel col-sm-12 control-label form-group"  >
+                                <div class="initialLevel col-sm-3 control-label form-group"  >
+                                    <span style="color:red">*</span>
+                                    <label class="control-label" >身份证正面照:</label>
+                                    <#uploadImg id="idcardFront"/>
+                                </div>
+                                <div class="initialLevel col-sm-3 control-label form-group"  >
+                                    <span style="color:red">*</span>
+                                    <label class="control-label" >身份证背面照:</label>
+                                    <#uploadImg id="idcardBack"/>
+                                </div>
+                            </div>
+
+                            <div class="initialLevel col-sm-12 control-label form-group"  >
+                                <div class="initialLevel col-sm-3 control-label form-group"  >
+                                    <span style="color:red">*</span>
+                                    <label class="control-label" >驾驶证:</label>
+                                    <#uploadImg id="driverLicense"/>
+                                </div>
+                            </div>
+                        </div>
+                    </div>
+                </div>
+
+                <div class="row btn-group-m-t">
+                    <div class="col-sm-10" style="text-align: center">
+                        <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" clickFun="TDriverInfoDlg.close()"/>
+                        <#button btnCss="info" name="提交" id="ensure" icon="fa-check" clickFun="TDriverInfoDlg.addSubmit()"/>
+                    </div>
                 </div>
             </div>
         </div>
-
     </div>
 </div>
 <script src="${ctxPath}/static/modular/system/tDriver/tDriver_info.js"></script>
+<script src="${ctxPath}/static/modular/system/tDriver/tDriver.js"></script>
+<script type="text/javascript">
+    $(function () {
+        var idCardPositive = new $WebUpload("idcardFront");
+        idCardPositive.setUploadBarId("progressBar");
+        idCardPositive.init();
+        var idCardPositive = new $WebUpload("idcardBack");
+        idCardPositive.setUploadBarId("progressBar");
+        idCardPositive.init();
+        var idCardPositive = new $WebUpload("driverLicense");
+        idCardPositive.setUploadBarId("progressBar");
+        idCardPositive.init();
+    });
+</script>
 @}
diff --git a/management/guns-admin/src/main/webapp/WEB-INF/view/system/tDriver/tDriver_edit.html b/management/guns-admin/src/main/webapp/WEB-INF/view/system/tDriver/tDriver_edit.html
index 4ca8c12..d2b958c 100644
--- a/management/guns-admin/src/main/webapp/WEB-INF/view/system/tDriver/tDriver_edit.html
+++ b/management/guns-admin/src/main/webapp/WEB-INF/view/system/tDriver/tDriver_edit.html
@@ -1,5 +1,121 @@
 @layout("/common/_container.html"){
-<div class="ibox float-e-margins">
+<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="id" value="${item.id}"/>
+                        <input hidden id="areaId" value="${item.areaId}">
+                        <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;text-align:left;">司机信息</label>
+                            </div>
+                        </div>
+                        <hr/>
+                        <div class="col-sm-12"  style="cursor: pointer;text-align: right;">
+                            <div class="initialLevel col-sm-12 control-label form-group"  >
+                                <div class="initialLevel col-sm-3 control-label form-group"  >
+                                    <span style="color:red">*</span>
+                                    <label class="control-label" >姓名:</label>
+                                    <input id="name" value="${item.name}" type="text" style="height: 30px" required>
+                                </div>
+                                <div class="initialLevel col-sm-3 control-label form-group"  >
+                                    <span style="color:red">*</span>
+                                    <label class="control-label" >手机号:</label>
+                                    <input id="phone" value="${item.phone}" type="number" style="height: 30px" required>
+                                </div>
+                            </div>
+
+                            <div class="initialLevel col-sm-12 control-label form-group"  >
+                                <div class="initialLevel col-sm-3 control-label form-group"  >
+                                    <span style="color:red">*</span>
+                                    <label class="control-label" >紧急联系人姓名:</label>
+                                    <input id="emergencyContact" value="${item.emergencyContact}" type="text" style="height: 30px" required>
+                                </div>
+                                <div class="initialLevel col-sm-3 control-label form-group"  >
+                                    <span style="color:red">*</span>
+                                    <label class="control-label" >紧急联系人电话:</label>
+                                    <input id="emergencyPhone" value="${item.emergencyPhone}" type="number" style="height: 30px" required>
+                                </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>
+                                    <input id="inviterName" value="${item.inviterName}" type="text" style="height: 30px">
+                                </div>
+                                <div class="initialLevel col-sm-3 control-label form-group"  >
+                                    <label class="control-label" >邀约人电话:</label>
+                                    <input id="inviterPhone" value="${item.inviterPhone}" type="number" style="height: 30px">
+                                </div>
+                            </div>
+
+                            <div class="initialLevel col-sm-12 control-label form-group"  >
+                                <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>
+                                </div>
+                            </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;text-align:right">认证资料</label>
+                            </div>
+                        </div>
+                        <hr/>
+
+                        <div class="col-sm-12">
+                            <div class="initialLevel col-sm-12 control-label form-group"  >
+                                <div class="initialLevel col-sm-3 control-label form-group"  >
+                                    <span style="color:red">*</span>
+                                    <label class="control-label" >身份证号码:</label>
+                                    <input id="idcard" value="${item.idcard}" type="text" style="height: 30px" required>
+                                </div>
+                            </div>
+
+                            <div class="initialLevel col-sm-12 control-label form-group"  >
+                                <div class="initialLevel col-sm-3 control-label form-group"  >
+                                    <span style="color:red">*</span>
+                                    <label class="control-label" >身份证正面照:</label>
+                                    <#uploadImg id="idcardFront" fileImg="${item.idcardFront}"/>
+                                </div>
+                                <div class="initialLevel col-sm-3 control-label form-group"  >
+                                    <span style="color:red">*</span>
+                                    <label class="control-label" >身份证背面照:</label>
+                                    <#uploadImg id="idcardBack" fileImg="${item.idcardBack}"/>
+                                </div>
+                            </div>
+
+                            <div class="initialLevel col-sm-12 control-label form-group"  >
+                                <div class="initialLevel col-sm-3 control-label form-group"  >
+                                    <span style="color:red">*</span>
+                                    <label class="control-label" >驾驶证:</label>
+                                    <#uploadImg id="driverLicense" fileImg="${item.driverLicense}"/>
+                                </div>
+                            </div>
+                        </div>
+                    </div>
+                </div>
+
+                <div class="row btn-group-m-t">
+                    <div class="col-sm-10" style="text-align: center">
+                        <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" clickFun="TDriverInfoDlg.close()"/>
+                        <#button btnCss="info" name="提交" id="ensure" icon="fa-check" clickFun="TDriverInfoDlg.editSubmit()"/>
+                    </div>
+                </div>
+            </div>
+        </div>
+    </div>
+</div>
+<!--<div class="ibox float-e-margins">
     <div class="ibox-content">
         <div class="form-horizontal">
 
@@ -48,6 +164,27 @@
         </div>
 
     </div>
-</div>
+</div>-->
 <script src="${ctxPath}/static/modular/system/tDriver/tDriver_info.js"></script>
+<script src="${ctxPath}/static/modular/system/tDriver/tDriver.js"></script>
+<script type="text/javascript">
+    $(function () {
+        if('' == $("#inviterName").val()){
+            $("#inviterName").val('')
+        }
+        if('' == $("#inviterPhone").val()){
+            $("#inviterPhone").val('')
+        }
+
+        var idCardPositive = new $WebUpload("idcardFront");
+        idCardPositive.setUploadBarId("progressBar");
+        idCardPositive.init();
+        var idCardPositive = new $WebUpload("idcardBack");
+        idCardPositive.setUploadBarId("progressBar");
+        idCardPositive.init();
+        var idCardPositive = new $WebUpload("driverLicense");
+        idCardPositive.setUploadBarId("progressBar");
+        idCardPositive.init();
+    });
+</script>
 @}
diff --git a/management/guns-admin/src/main/webapp/static/modular/system/tAppUser/tAppUser.js b/management/guns-admin/src/main/webapp/static/modular/system/tAppUser/tAppUser.js
index 5722d7d..2c50279 100644
--- a/management/guns-admin/src/main/webapp/static/modular/system/tAppUser/tAppUser.js
+++ b/management/guns-admin/src/main/webapp/static/modular/system/tAppUser/tAppUser.js
@@ -28,7 +28,11 @@
                     }
                 }
             },
-            {title: '头像', field: 'avatar', visible: true, align: 'center', valign: 'middle'},
+            {title: '头像', field: 'avatar', visible: true, align: 'center', valign: 'middle',
+                formatter: function (value, row) {
+                        return '<img src="'+row.avatar+'" style="height: 60px;width: 60px"/>'
+                }
+            },
             {title: '微信openid', field: 'openid', visible: true, align: 'center', valign: 'middle'},
             {title: '微信unionid', field: 'unionid', visible: true, align: 'center', valign: 'middle'},
             {title: '紧急联系人', field: 'emergencyContact', visible: true, align: 'center', valign: 'middle'},
diff --git a/management/guns-admin/src/main/webapp/static/modular/system/tAppUser/tAppUserException.js b/management/guns-admin/src/main/webapp/static/modular/system/tAppUser/tAppUserException.js
index 6676c27..f607262 100644
--- a/management/guns-admin/src/main/webapp/static/modular/system/tAppUser/tAppUserException.js
+++ b/management/guns-admin/src/main/webapp/static/modular/system/tAppUser/tAppUserException.js
@@ -18,10 +18,10 @@
             {title: '用户ID', field: 'id', visible: true, align: 'center', valign: 'middle'},
             {title: '用户昵称', field: 'nickname', visible: true, align: 'center', valign: 'middle'},
             {title: '手机号', field: 'phone', visible: true, align: 'center', valign: 'middle'},
-            {title: '剩余优惠券', field: 'sex', visible: true, align: 'center', valign: 'middle'},
-            {title: '优惠券总数', field: 'avatar', visible: true, align: 'center', valign: 'middle'},
-            {title: '消费次数', field: 'openid', visible: true, align: 'center', valign: 'middle'},
-            {title: '历史消费', field: 'unionid', visible: true, align: 'center', valign: 'middle'},
+            {title: '剩余优惠券', field: 'notUsedCount', visible: true, align: 'center', valign: 'middle'},
+            {title: '优惠券总数', field: 'couponSum', visible: true, align: 'center', valign: 'middle'},
+            {title: '消费次数', field: 'consumeSum', visible: true, align: 'center', valign: 'middle'},
+            {title: '历史消费', field: 'consumePrice', visible: true, align: 'center', valign: 'middle'},
             {title: '最后一次消费时间', field: 'emergencyContact', visible: true, align: 'center', valign: 'middle'},
             {title: '状态', field: 'status', visible: true, align: 'center', valign: 'middle'},
             {title: '操作', visible: true, align: 'center', valign: 'middle',width:150,
diff --git a/management/guns-admin/src/main/webapp/static/modular/system/tDriver/tDriver.js b/management/guns-admin/src/main/webapp/static/modular/system/tDriver/tDriver.js
index 4a3d3a5..6be84db 100644
--- a/management/guns-admin/src/main/webapp/static/modular/system/tDriver/tDriver.js
+++ b/management/guns-admin/src/main/webapp/static/modular/system/tDriver/tDriver.js
@@ -102,7 +102,7 @@
     var index = layer.open({
         type: 2,
         title: '添加',
-        area: ['800px', '420px'], //宽高
+        area: ['100%', '100%'], //宽高
         fix: false, //不固定
         maxmin: true,
         content: Feng.ctxPath + '/tDriver/tDriver_add'
@@ -118,7 +118,7 @@
         var index = layer.open({
             type: 2,
             title: '详情',
-            area: ['800px', '420px'], //宽高
+            area: ['100%', '100%'], //宽高
             fix: false, //不固定
             maxmin: true,
             content: Feng.ctxPath + '/tDriver/tDriver_update/' + TDriver.seItem.id
@@ -302,6 +302,102 @@
 };
 
 /**
+ * 打开区域选择页面
+ */
+TDriver.area = function () {
+    var index = layer.open({
+        type: 2,
+        title: '区域选择',
+        area: ['1000px', '270px'], //宽高
+        fix: false, //不固定
+        maxmin: true,
+        content: Feng.ctxPath + '/tDriver/areaPage'
+    });
+    this.layerIndex = index;
+}
+
+/**
+ * 查询市
+ */
+TDriver.areaCity = function () {
+    var province = document.getElementById('province');
+    var index= province.selectedIndex ;
+    var id = province.options[index].id;
+    var ajax = new $ax(Feng.ctxPath + "/tDriver/areaCity?parentId="+id, function (data) {
+        var opts=document.getElementById('city').options;
+        opts.length=0;// 这一句是清空原有列表项
+        for(var i=0,n=data.length;i<n;i++){
+            var data1=data[i];
+            var opt=new Option(data1.name,data1.id,true,true);
+            opts.add(opt);
+        }
+    }, function (data) {
+        Feng.error("查询失败!" + data.responseJSON.message + "!");
+    });
+    ajax.start();
+}
+
+/**
+ * 查询区
+ */
+TDriver.areaDistrict = function () {
+    var city = document.getElementById('city');
+    var cityIndex= city.selectedIndex ;
+    var id = city.options[cityIndex].value;
+    var ajax = new $ax(Feng.ctxPath + "/tDriver/areaCity?parentId="+id, function (data) {
+        var opts=document.getElementById('district').options;
+        opts.length=0;// 这一句是清空原有列表项
+        for(var i=0,n=data.length;i<n;i++){
+            var data1=data[i];
+            var opt=new Option(data1.name,data1.id,true,true);
+            opts.add(opt);
+        }
+    }, function (data) {
+        Feng.error("查询失败!" + data.responseJSON.message + "!");
+    });
+    ajax.start();
+}
+
+/**
+ * 选择省市
+ */
+TDriver.submitArea = function () {
+    var province = document.getElementById('province');
+    var provinceIndex= province.selectedIndex ;
+    var provinceName = province.options[provinceIndex].value;
+    var provinceId = province.options[provinceIndex].id;
+
+    var city = document.getElementById('city');
+    var cityIndex= city.selectedIndex ;
+    var cityId = city.options[cityIndex].value;
+    var cityName = city.options[cityIndex].innerText;
+
+    var district = document.getElementById('district');
+    var districtIndex= district.selectedIndex ;
+    var districtId = district.options[districtIndex].value;
+    var districtName = district.options[districtIndex].innerText;
+
+    parent.$("#area").val(provinceName+'/'+cityName+'/'+districtName)
+    parent.$("#areaId").val(provinceId+'/'+cityId+'/'+districtId)
+    TDriverInfoDlg.close();
+}
+
+/**
+ * 打开编辑页面
+ */
+TDriver.updateInfo = function (id) {
+    var index = layer.open({
+        type: 2,
+        title: '编辑',
+        area: ['100%', '100%'], //宽高
+        fix: false, //不固定
+        maxmin: true,
+        content: Feng.ctxPath + '/tDriver/tDriver_update?tDriverId='+id
+    });
+    this.layerIndex = index;
+}
+
+/**
  * 查询列表
  */
 TDriver.search = function () {
diff --git a/management/guns-admin/src/main/webapp/static/modular/system/tDriver/tDriver_info.js b/management/guns-admin/src/main/webapp/static/modular/system/tDriver/tDriver_info.js
index f7c9bf5..00f7f6c 100644
--- a/management/guns-admin/src/main/webapp/static/modular/system/tDriver/tDriver_info.js
+++ b/management/guns-admin/src/main/webapp/static/modular/system/tDriver/tDriver_info.js
@@ -76,6 +76,8 @@
     .set('serverStatus')
     .set('integral')
     .set('status')
+        .set('area')
+        .set('areaId')
     .set('createTime');
 }
 
diff --git a/management/guns-admin/src/main/webapp/static/modular/system/tDriver/tOrderRefusal.js b/management/guns-admin/src/main/webapp/static/modular/system/tDriver/tOrderRefusal.js
new file mode 100644
index 0000000..aaff1ae
--- /dev/null
+++ b/management/guns-admin/src/main/webapp/static/modular/system/tDriver/tOrderRefusal.js
@@ -0,0 +1,101 @@
+/**
+ * 管理初始化
+ */
+var TOrderRefusal = {
+    id: "TOrderRefusalTable",	//表格id
+    seItem: null,		//选中的条目
+    table: null,
+    layerIndex: -1
+};
+
+/**
+ * 初始化表格的列
+ */
+TOrderRefusal.initColumn = function () {
+    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: 'code', visible: true, align: 'center', valign: 'middle'},
+        {title: '起点地址', field: 'startAddress', visible: true, align: 'center', valign: 'middle'},
+        {title: '终点地址', field: 'endAddress', visible: true, align: 'center', valign: 'middle'}
+    ];
+};
+
+/**
+ * 检查是否选中
+ */
+TOrderRefusal.check = function () {
+    var selected = $('#' + this.id).bootstrapTable('getSelections');
+    if(selected.length == 0){
+        Feng.info("请先选中表格中的某一记录!");
+        return false;
+    }else{
+        TOrderRefusal.seItem = selected[0];
+        return true;
+    }
+};
+
+/**
+ * 点击添加
+ */
+TOrderRefusal.openAddTOrderRefusal = function () {
+    var index = layer.open({
+        type: 2,
+        title: '添加',
+        area: ['800px', '420px'], //宽高
+        fix: false, //不固定
+        maxmin: true,
+        content: Feng.ctxPath + '/tOrderRefusal/tOrderRefusal_add'
+    });
+    this.layerIndex = index;
+};
+
+/**
+ * 打开查看详情
+ */
+TOrderRefusal.openTOrderRefusalDetail = function () {
+    if (this.check()) {
+        var index = layer.open({
+            type: 2,
+            title: '详情',
+            area: ['800px', '420px'], //宽高
+            fix: false, //不固定
+            maxmin: true,
+            content: Feng.ctxPath + '/tOrderRefusal/tOrderRefusal_update/' + TOrderRefusal.seItem.id
+        });
+        this.layerIndex = index;
+    }
+};
+
+/**
+ * 删除
+ */
+TOrderRefusal.delete = function () {
+    if (this.check()) {
+        var ajax = new $ax(Feng.ctxPath + "/tOrderRefusal/delete", function (data) {
+            Feng.success("删除成功!");
+            TOrderRefusal.table.refresh();
+        }, function (data) {
+            Feng.error("删除失败!" + data.responseJSON.message + "!");
+        });
+        ajax.set("tOrderRefusalId",this.seItem.id);
+        ajax.start();
+    }
+};
+
+/**
+ * 查询列表
+ */
+// TOrderRefusal.search = function () {
+//     var queryData = {};
+//     queryData['condition'] = $("#condition").val();
+//     TOrderRefusal.table.refresh({query: queryData});
+// };
+
+$(function () {
+    var defaultColunms = TOrderRefusal.initColumn();
+    var table = new BSTable(TOrderRefusal.id, "/tOrderRefusal/list", defaultColunms);
+    table.setPaginationType("client");
+    TOrderRefusal.table = table.init();
+});

--
Gitblit v1.7.1