80个文件已修改
6个文件已删除
40个文件已添加
| | |
| | | package com.supersavedriving.driver.modular.system.api; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | |
| | | import com.supersavedriving.driver.modular.system.util.PayMoneyUtil; |
| | | import com.supersavedriving.driver.modular.system.util.huawei.OBSUtil; |
| | | import com.supersavedriving.driver.modular.system.util.huawei.SMSUtil; |
| | | import com.supersavedriving.driver.modular.system.util.juhe.OCRUtil; |
| | | import com.supersavedriving.driver.modular.system.warpper.*; |
| | | import com.supersavedriving.driver.core.util.ToolUtil; |
| | | import com.supersavedriving.driver.modular.system.util.RedisUtil; |
| | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.InputStream; |
| | | import java.io.PrintWriter; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | |
| | | try { |
| | | ResultUtil resultUtil = driverService.driverRegister(driverRegisterWarpper); |
| | | return ResponseWarpper.success(resultUtil); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return new ResponseWarpper(500, e.getMessage()); |
| | | } |
| | | } |
| | | @ResponseBody |
| | | @PostMapping("/base/driver/orcPhoto") |
| | | // @ServiceLog(name = "司机注册申请", url = "/base/driver/driverRegister") |
| | | @ApiOperation(value = "图片识别--获取驾龄", tags = {"司机端-图片识别"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | }) |
| | | public ResponseWarpper orcPhoto(MultipartFile file){ |
| | | try { |
| | | JSONObject certificate = OCRUtil.certificate(5, file); |
| | | return ResponseWarpper.success(certificate); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return new ResponseWarpper(500, e.getMessage()); |
| | |
| | | @ApiOperation(value = "获取5公里范围内的司机", tags = {"司机端-首页"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | |
| | | }) |
| | | public ResponseWarpper<List<String>> queryDriverPosition(){ |
| | | public ResponseWarpper< HashMap<String, Object> > queryDriverPosition(){ |
| | | try { |
| | | Integer uid = driverService.getUserByRequest(); |
| | | if(null == uid){ |
| | | return ResponseWarpper.tokenErr(); |
| | | } |
| | | ResultUtil<List<String>> listResultUtil = driverService.queryDriverPosition(uid); |
| | | ResultUtil<HashMap<String, Object>> listResultUtil = driverService.queryDriverPosition(uid); |
| | | |
| | | |
| | | return ResponseWarpper.success(listResultUtil); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return new ResponseWarpper(500, e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/api/driver/queryDriverOrderNum") |
| | | // @ServiceLog(name = "获取5公里范围内的司机", url = "/api/driver/queryDriverPosition") |
| | | @ApiOperation(value = "司机个人信息 接单量", tags = {"司机端-首页"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."), |
| | | @ApiImplicitParam(value = "时间 2022-11-11 - 2222-00-00", name = "time", required = false, dataType = "string"), |
| | | }) |
| | | public ResponseWarpper< HashMap<String, Object> > queryDriverOrderNum(String time){ |
| | | try { |
| | | Integer uid = driverService.getUserByRequest(); |
| | | if(null == uid){ |
| | | return ResponseWarpper.tokenErr(); |
| | | } |
| | | ResultUtil<HashMap<String, Object>> listResultUtil = driverService.queryDriverOrderNum(time,uid); |
| | | |
| | | |
| | | return ResponseWarpper.success(listResultUtil); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | |
| | | @ApiImplicitParam(value = "日期", name = "time", required = true, dataType = "string"), |
| | | @ApiImplicitParam(value = "页码,首页1", name = "pageNum", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "页条数", name = "pageSize", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "类型 1订单收入 4提现 5=佣金收入,7=优惠券收入", name = "type", required = false, dataType = "int"), |
| | | @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResponseWarpper<List<CommissionListWarpper>> queryCommissionList(String time, Integer pageNum, Integer pageSize){ |
| | | public ResponseWarpper<List<CommissionListWarpper>> queryCommissionList(String time, Integer pageNum, Integer pageSize,Integer type){ |
| | | if(null == pageNum){ |
| | | return ResponseWarpper.success(ResultUtil.paranErr("pageNum")); |
| | | } |
| | |
| | | if(null == uid){ |
| | | return ResponseWarpper.tokenErr(); |
| | | } |
| | | List<CommissionListWarpper> list = revenueService.queryCommissionList(uid, time, pageNum, pageSize); |
| | | List<CommissionListWarpper> list = revenueService.queryCommissionList(uid, time, pageNum, pageSize,type); |
| | | return ResponseWarpper.success(list); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | |
| | | import com.supersavedriving.driver.modular.system.warpper.OrderInfoWarpper; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "long"), |
| | | @ApiImplicitParam(value = "原因", name = "cause", required = true, dataType = "string"), |
| | | @ApiImplicitParam(value = "phone", name = "phone", required = false, dataType = "string"), |
| | | @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResponseWarpper transferOrder(Long orderId, String cause){ |
| | | public ResponseWarpper transferOrder(Long orderId, String cause,String phone){ |
| | | if(ToolUtil.isEmpty(orderId)){ |
| | | return ResponseWarpper.success(ResultUtil.paranErr("orderId")); |
| | | } |
| | |
| | | if(null == uid){ |
| | | return ResponseWarpper.tokenErr(); |
| | | } |
| | | ResultUtil resultUtil = orderService.transferOrder(uid, orderId, cause); |
| | | ResultUtil resultUtil = orderService.transferOrder(uid, orderId, cause,phone); |
| | | return ResponseWarpper.success(resultUtil); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | |
| | | return new ResponseWarpper(500, e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/base/config/getIndexTimeConfig") |
| | | // @ServiceLog(name = "获取转单提醒时间配置", url = "/base/config/queryTransferOrderConfig") |
| | | @ApiOperation(value = "获取首页有效时间配置", tags = {"司机端-服务中"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResponseWarpper<String> getIndexTimeConfig(){ |
| | | try { |
| | | SystemConfig systemConfig = systemConfigService.selectOne(new EntityWrapper<SystemConfig>().eq("type", 4)); |
| | | JSONObject jsonObject = JSON.parseObject(systemConfig.getContent()); |
| | | String num1 = jsonObject.getString("num1"); |
| | | String num2 = jsonObject.getString("num2"); |
| | | return ResponseWarpper.success(num1+"-"+num2); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return new ResponseWarpper(500, e.getMessage()); |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.supersavedriving.driver.modular.system.dao; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.supersavedriving.driver.modular.system.model.CompanyFundFlow; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2023/7/30 3:05 |
| | | */ |
| | | public interface CompanyFundFlowMapper extends BaseMapper<CompanyFundFlow> { |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.supersavedriving.driver.modular.system.model.Driver; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | public interface DriverMapper extends BaseMapper<Driver> { |
| | | int getTime(@Param("sTime") String sTime, @Param("eTime") String eTime, @Param("uid") Integer uid); |
| | | |
| | | } |
New file |
| | |
| | | package com.supersavedriving.driver.modular.system.dao; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.supersavedriving.driver.modular.system.model.DriverOnlineTime; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2023/7/30 2:23 |
| | | */ |
| | | public interface DriverOnlineTimeMapper extends BaseMapper<DriverOnlineTime> { |
| | | } |
| | |
| | | */ |
| | | List<PerformanceRankingWarpper> queryDriverRank(@Param("type") Integer type, @Param("time") String time, |
| | | @Param("dayType") Integer dayType); |
| | | |
| | | |
| | | /** |
| | | * 获取代理商账户余额 |
| | | * @param companyId |
| | | * @return |
| | | */ |
| | | Double queryAgentBalance(@Param("companyId") Integer companyId); |
| | | |
| | | |
| | | /** |
| | | * 获取平台账户余额 |
| | | * @return |
| | | */ |
| | | Double queryCompanyBalance(); |
| | | } |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.supersavedriving.driver.modular.system.dao.CompanyFundFlowMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.supersavedriving.driver.modular.system.model.CompanyFundFlow"> |
| | | <id column="id" property="id"/> |
| | | <result column="type" property="type"/> |
| | | <result column="objectType" property="objectType"/> |
| | | <result column="objectId" property="objectId"/> |
| | | <result column="balance" property="balance"/> |
| | | <result column="money" property="money"/> |
| | | <result column="createTime" property="createTime"/> |
| | | </resultMap> |
| | | </mapper> |
| | |
| | | <result column="merchantPhone" property="merchantPhone"/> |
| | | <result column="merchantIDCode" property="merchantIDCode"/> |
| | | </resultMap> |
| | | <select id="getTime" resultType="java.lang.Integer"> |
| | | select sum(onlineTime) from t_driver_online_time where driverId =#{uid} |
| | | <if test="sTime !=null"> |
| | | and day between #{sTime} and #{eTime} |
| | | </if> |
| | | </select> |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.supersavedriving.driver.modular.system.dao.DriverOnlineTimeMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.supersavedriving.driver.modular.system.model.DriverOnlineTime"> |
| | | <id column="id" property="id"/> |
| | | <result column="driverId" property="driverId"/> |
| | | <result column="day" property="day"/> |
| | | <result column="onlineTime" property="onlineTime"/> |
| | | </resultMap> |
| | | </mapper> |
| | |
| | | |
| | | |
| | | <select id="queryTotalAmount" resultType="double"> |
| | | select sum(amount) as amount from t_revenue where userType = 2 and userId = #{driverId} |
| | | select sum(amount) as amount from t_revenue where userType = 2 and userId = #{driverId} and type in (1,2) |
| | | </select> |
| | | |
| | | |
| | |
| | | group by a.userId,b.`name` |
| | | ) as aa,( SELECT @ROW := 0 ) AS itable order by aa.number desc |
| | | </select> |
| | | |
| | | |
| | | <select id="queryAgentBalance" resultType="double"> |
| | | select |
| | | sum(aa.income) - sum(aa.disburse) as balance |
| | | from ( |
| | | select sum(amount) as income, 0 as disburse from t_revenue where userType = 3 and userId = #{companyId} |
| | | union all |
| | | select 0 as ncome, sum(amount) as disburse from t_settlement_record where type = 2 and objectId = #{companyId} |
| | | ) as aa |
| | | </select> |
| | | |
| | | |
| | | |
| | | <select id="queryCompanyBalance" resultType="double"> |
| | | select |
| | | sum(aa.income) - sum(aa.disburse) + sum(aa.recharge) as balance |
| | | from ( |
| | | select sum(amount) as income, 0 as disburse, 0 as recharge from t_revenue where userType = 4 |
| | | union all |
| | | select 0 as ncome, sum(amount) as disburse, 0 as recharge from t_settlement_record where type = 1 |
| | | union all |
| | | select 0 as ncome, 0 as disburse, sum(surplusDividedAmount) as recharge from t_recharge_record where type = 4 and payStatus = 2 |
| | | ) as aa |
| | | </select> |
| | | </mapper> |
New file |
| | |
| | | package com.supersavedriving.driver.modular.system.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2023/7/30 3:02 |
| | | */ |
| | | @Data |
| | | @TableName("t_company_fund_flow") |
| | | public class CompanyFundFlow { |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | /** |
| | | * 变动类型(1=充值,2=提现,3=佣金收入,4=保险收入) |
| | | */ |
| | | @TableField("type") |
| | | private Integer type; |
| | | /** |
| | | * 对象类型(1=平台,2=代理商) |
| | | */ |
| | | @TableField("objectType") |
| | | private Integer objectType; |
| | | /** |
| | | * 代理商id |
| | | */ |
| | | @TableField("objectId") |
| | | private Integer objectId; |
| | | /** |
| | | * 历史账户余额 |
| | | */ |
| | | @TableField("balance") |
| | | private BigDecimal balance; |
| | | /** |
| | | * 变动金额 |
| | | */ |
| | | @TableField("money") |
| | | private BigDecimal money; |
| | | /** |
| | | * 变动时间 |
| | | */ |
| | | @TableField("createTime") |
| | | private Date createTime; |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigInteger; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | |
| | | */ |
| | | @TableField("backgroundBalance") |
| | | private Double backgroundBalance; |
| | | /** |
| | | * 司机在线时长 |
| | | */ |
| | | @TableField("onlineTime") |
| | | private BigInteger onlineTime; |
| | | /** |
| | | * 优惠券余额(订单优惠券支付的金额) |
| | | */ |
| | |
| | | @TableField("merchantIDCode") |
| | | private String merchantIDCode; |
| | | /** |
| | | * 驾龄 |
| | | */ |
| | | @TableField("carAge") |
| | | private Integer carAge; |
| | | /** |
| | | * 司机推荐二维码 |
| | | */ |
| | | @TableField("referralCode") |
New file |
| | |
| | | package com.supersavedriving.driver.modular.system.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigInteger; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2023/7/30 1:31 |
| | | */ |
| | | @Data |
| | | @TableName("t_driver_online_time") |
| | | public class DriverOnlineTime { |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | /** |
| | | * 司机id |
| | | */ |
| | | @TableField("driverId") |
| | | private Integer driverId; |
| | | /** |
| | | * 统计日期 |
| | | */ |
| | | @TableField("day") |
| | | private Date day; |
| | | /** |
| | | * 在线时长(秒) |
| | | */ |
| | | @TableField("onlineTime") |
| | | private BigInteger onlineTime; |
| | | } |
New file |
| | |
| | | package com.supersavedriving.driver.modular.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.supersavedriving.driver.modular.system.model.CompanyFundFlow; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2023/7/30 3:09 |
| | | */ |
| | | public interface ICompanyFundFlowService extends IService<CompanyFundFlow> { |
| | | } |
New file |
| | |
| | | package com.supersavedriving.driver.modular.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.supersavedriving.driver.modular.system.model.DriverOnlineTime; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2023/7/30 2:24 |
| | | */ |
| | | public interface IDriverOnlineTimeService extends IService<DriverOnlineTime> { |
| | | } |
| | |
| | | import com.supersavedriving.driver.modular.system.util.ResultUtil; |
| | | import com.supersavedriving.driver.modular.system.warpper.*; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | ResultUtil<List<String>> queryDriverPosition(Integer uid) throws Exception; |
| | | ResultUtil<HashMap<String, Object>> queryDriverPosition(Integer uid) throws Exception; |
| | | |
| | | |
| | | /** |
| | |
| | | ResultUtil closeOrderQRCode(Integer uid) throws Exception; |
| | | |
| | | |
| | | /** |
| | | * 开通小微商户 |
| | | * @param name |
| | | * @param number |
| | | * @param phone |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | |
| | | ResultUtil<HashMap<String, Object>> queryDriverOrderNum(String time,Integer uid); |
| | | |
| | | ResultUtil microenterprise(Integer uid, String name, String number, String phone, String notifyUrl) throws Exception; |
| | | } |
| | |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | ResultUtil transferOrder(Integer uid, Long orderId, String cause) throws Exception; |
| | | ResultUtil transferOrder(Integer uid, Long orderId, String cause,String phone) throws Exception; |
| | | |
| | | |
| | | /** |
| | |
| | | void completeCollection(); |
| | | |
| | | |
| | | |
| | | ResultUtil fengzhang(Integer userType, Integer id, String merchantNumber, Long orderId, Integer rechargeRecordId, String merOrderId, Double amount, Integer sourceType); |
| | | |
| | | |
| | |
| | | * @param pageSize |
| | | * @return |
| | | */ |
| | | List<CommissionListWarpper> queryCommissionList(Integer driverId, String time, Integer pageNum, Integer pageSize) throws Exception; |
| | | List<CommissionListWarpper> queryCommissionList(Integer driverId, String time, Integer pageNum, Integer pageSize,Integer type) throws Exception; |
| | | |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | List<PerformanceRankingWarpper> queryDriverRank(Integer type, String time, Integer dayType); |
| | | |
| | | |
| | | /** |
| | | * 获取代理商账户余额 |
| | | * @param companyId |
| | | * @return |
| | | */ |
| | | Double queryAgentBalance(Integer companyId); |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取平台账户余额 |
| | | * @return |
| | | */ |
| | | Double queryCompanyBalance(); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.supersavedriving.driver.modular.system.dao.AccountChangeDetailMapper; |
| | | import com.supersavedriving.driver.modular.system.model.AccountChangeDetail; |
| | | import com.supersavedriving.driver.modular.system.model.Driver; |
| | | import com.supersavedriving.driver.modular.system.model.RechargeRecord; |
| | | import com.supersavedriving.driver.modular.system.model.SystemConfig; |
| | | import com.supersavedriving.driver.modular.system.model.*; |
| | | import com.supersavedriving.driver.modular.system.service.*; |
| | | import com.supersavedriving.driver.modular.system.util.ResultUtil; |
| | | import com.supersavedriving.driver.modular.system.util.UUIDUtil; |
| | |
| | | |
| | | @Autowired |
| | | private IOrderService orderService; |
| | | |
| | | @Autowired |
| | | private IRevenueService revenueService; |
| | | |
| | | @Autowired |
| | | private ICompanyFundFlowService companyFundFlowService; |
| | | |
| | | |
| | | |
| | |
| | | Double num1 = jsonObject.getDouble("num1"); |
| | | List<Driver> drivers = driverService.selectList(new EntityWrapper<Driver>().eq("approvalStatus", 2).eq("status", 1)); |
| | | for (Driver driver : drivers) { |
| | | Double balance1 = revenueService.queryCompanyBalance(); |
| | | Double backgroundBalance = driver.getBackgroundBalance(); |
| | | Double balance = driver.getBalance(); |
| | | double all = backgroundBalance + balance; |
| | |
| | | accountChangeDetail.setCreateTime(new Date()); |
| | | this.insert(accountChangeDetail); |
| | | |
| | | Revenue revenue = new Revenue(); |
| | | revenue.setType(3); |
| | | revenue.setUserType(4); |
| | | revenue.setAmount(d); |
| | | revenue.setCreateTime(new Date()); |
| | | revenueService.insert(revenue); |
| | | |
| | | List<RechargeRecord> rechargeRecords = rechargeRecordService.selectList(new EntityWrapper<RechargeRecord>().eq("type", 2).eq("userId", driver.getId()).eq("payStatus", 2).gt("surplusDividedAmount", 0).orderBy("createTime")); |
| | | for (RechargeRecord rechargeRecord : rechargeRecords) { |
| | | Double surplusDividedAmount = rechargeRecord.getSurplusDividedAmount(); |
| | |
| | | |
| | | } |
| | | } |
| | | |
| | | driverService.updateById(driver); |
| | | |
| | | CompanyFundFlow companyFundFlow = new CompanyFundFlow(); |
| | | companyFundFlow.setType(4); |
| | | companyFundFlow.setObjectType(1); |
| | | companyFundFlow.setBalance(new BigDecimal(balance1)); |
| | | companyFundFlow.setMoney(new BigDecimal(num1)); |
| | | companyFundFlow.setCreateTime(new Date()); |
| | | companyFundFlowService.insert(companyFundFlow); |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.supersavedriving.driver.modular.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.supersavedriving.driver.modular.system.dao.CompanyFundFlowMapper; |
| | | import com.supersavedriving.driver.modular.system.model.CompanyFundFlow; |
| | | import com.supersavedriving.driver.modular.system.service.ICompanyFundFlowService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2023/7/30 3:10 |
| | | */ |
| | | @Service |
| | | public class CompanyFundFlowServiceImpl extends ServiceImpl<CompanyFundFlowMapper, CompanyFundFlow> implements ICompanyFundFlowService { |
| | | } |
New file |
| | |
| | | package com.supersavedriving.driver.modular.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.supersavedriving.driver.modular.system.dao.DriverOnlineTimeMapper; |
| | | import com.supersavedriving.driver.modular.system.model.DriverOnlineTime; |
| | | import com.supersavedriving.driver.modular.system.service.IDriverOnlineTimeService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2023/7/30 2:25 |
| | | */ |
| | | @Service |
| | | public class DriverOnlineTimeServiceImpl extends ServiceImpl<DriverOnlineTimeMapper, DriverOnlineTime> implements IDriverOnlineTimeService { |
| | | } |
| | |
| | | import com.supersavedriving.driver.core.shiro.ShiroUser; |
| | | import com.supersavedriving.driver.core.util.JwtTokenUtil; |
| | | import com.supersavedriving.driver.core.util.ToolUtil; |
| | | import com.supersavedriving.driver.modular.system.dao.DriverMapper; |
| | | import com.supersavedriving.driver.modular.system.model.*; |
| | | import com.supersavedriving.driver.modular.system.service.*; |
| | | import com.supersavedriving.driver.modular.system.dao.DriverMapper; |
| | | import com.supersavedriving.driver.modular.system.util.*; |
| | | import com.supersavedriving.driver.modular.system.util.MallBook.model.*; |
| | | import com.supersavedriving.driver.modular.system.util.MallBook.util.TrhRequest; |
| | | import com.supersavedriving.driver.modular.system.util.*; |
| | | import com.supersavedriving.driver.modular.system.util.huawei.OBSUtil; |
| | | import com.supersavedriving.driver.modular.system.util.mongodb.model.Location; |
| | | import com.supersavedriving.driver.modular.system.util.rongyun.RongYunUtil; |
| | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.io.InputStream; |
| | | import java.math.BigDecimal; |
| | | import java.math.BigInteger; |
| | | import java.math.RoundingMode; |
| | | import java.net.InetAddress; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * 司机 |
| | |
| | | |
| | | @Autowired |
| | | private WeChatUtil weChatUtil; |
| | | |
| | | @Autowired |
| | | private IDriverOnlineTimeService driverOnlineTimeService; |
| | | |
| | | @Value("${callbackPath}") |
| | | private String callbackPath; |
| | |
| | | driver.setApprovalUserId(null); |
| | | driver.setStatus(1); |
| | | driver.setSource(driverRegisterWarpper.getSource()); |
| | | driver.setName(driverRegisterWarpper.getName()); |
| | | driver.setIdcard(driverRegisterWarpper.getIdcard()); |
| | | driver.setCarAge(driverRegisterWarpper.getCarAge()); |
| | | return driver; |
| | | } |
| | | |
| | |
| | | |
| | | |
| | | @Override |
| | | public ResultUtil<List<String>> queryDriverPosition(Integer uid) throws Exception { |
| | | public ResultUtil< HashMap<String, Object> > queryDriverPosition(Integer uid) throws Exception { |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | DriverWork driverWork = driverWorkService.selectOne(new EntityWrapper<DriverWork>().eq("driverId", uid).eq("status", 1)); |
| | | if(null == driverWork){ |
| | | return ResultUtil.error("请先上班"); |
| | |
| | | // 构造query对象 |
| | | Query query = Query.query(Criteria.where("location").withinSphere(circle)); |
| | | List<Location> locations = mongoTemplate.find(query, Location.class); |
| | | List<Integer> collect = locations.stream().map(Location::getDriverId).collect(Collectors.toList()); |
| | | List<Driver> drivers = this.selectBatchIds(collect); |
| | | for (Driver driver : drivers) { |
| | | String value1 = redisUtil.getValue("DRIVER" + driver.getId()); |
| | | if(ToolUtil.isEmpty(value1)){ |
| | | continue; |
| | | locations.forEach(s -> { |
| | | int i=0; |
| | | Driver driver = this.baseMapper.selectById(s.getDriverId()); |
| | | i = driver.getServerStatus(); |
| | | if(driver.getServerStatus()==2){ |
| | | List<Order> orders = orderService.selectList(new EntityWrapper<Order>().eq("driverId", s.getDriverId()).eq("state", 102)); |
| | | if(orders.size()>0){ |
| | | i = 3; |
| | | } |
| | | } |
| | | if(driver.getId().compareTo(uid) == 0){ |
| | | continue; |
| | | String value1 = redisUtil.getValue("DRIVER" + s.getDriverId()); |
| | | if(s.getDriverId().compareTo(uid) != 0 && ToolUtil.isNotEmpty(value1)){ |
| | | list.add(s.getLocation().getX() + "," + s.getLocation().getY()+","+i); |
| | | } |
| | | list.add(value1 + "," + driver.getServerStatus()); |
| | | } |
| | | }); |
| | | } |
| | | return ResultUtil.success(list); |
| | | |
| | | List<Order> orders = orderService.selectList(new EntityWrapper<Order>().eq("hallOrder",1).eq("state",101)); |
| | | |
| | | map.put("driver",list); |
| | | ArrayList<String> blue = new ArrayList<>(); |
| | | orders.forEach(e-> blue.add(e.getStartLng()+","+e.getStartLat())); |
| | | |
| | | map.put("orderList",blue); |
| | | List<Order> ordersOne = orderService.selectList(new EntityWrapper<Order>().eq("state",301)); |
| | | |
| | | ArrayList<String> red = new ArrayList<>(); |
| | | ordersOne.forEach(e-> red.add(e.getStartLng()+","+e.getStartLat())); |
| | | |
| | | map.put("cancelOrder",red); |
| | | return ResultUtil.success(map); |
| | | } |
| | | |
| | | |
| | |
| | | */ |
| | | public void addDurationCredits(Integer driverId) throws Exception { |
| | | SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd"); |
| | | String value = redisUtil.getValue("ONLINE" + driverId); |
| | | if(ToolUtil.isEmpty(value)){ |
| | | redisUtil.setStrValue("ONLINE" + driverId, "0_" + sdf1.format(new Date()) + "_0", 25 * 60 * 60); |
| | | return; |
| | | } |
| | | String today = sdf1.format(new Date()); |
| | | String[] s = value.split("_"); |
| | | if(!today.equals(s[1])){ |
| | | redisUtil.setStrValue("ONLINE" + driverId, "0_" + sdf1.format(new Date()) + "_0", 25 * 60 * 60); |
| | | return; |
| | | } |
| | | Integer second = Integer.valueOf(s[0]) + 5; |
| | | Integer time = Integer.valueOf(s[2]); |
| | | |
| | | SystemConfig systemConfig = systemConfigService.selectOne(new EntityWrapper<SystemConfig>().eq("type", 4)); |
| | | if(null == systemConfig){ |
| | | return; |
| | |
| | | long end = sdf.parse(sdf1.format(new Date()) + " " + num2 + ":00").getTime(); |
| | | long l = System.currentTimeMillis(); |
| | | if(start <= l && end > l){ |
| | | Driver driver = this.selectById(driverId); |
| | | String value = redisUtil.getValue("ONLINE" + driverId); |
| | | if(ToolUtil.isEmpty(value)){ |
| | | redisUtil.setStrValue("ONLINE" + driverId, "0_" + sdf1.format(new Date()) + "_0", 25 * 60 * 60); |
| | | return; |
| | | } |
| | | String today = sdf1.format(new Date()); |
| | | String[] s = value.split("_"); |
| | | if(!today.equals(s[1])){ |
| | | //修改在线时长记录 |
| | | DriverOnlineTime driverOnlineTime = driverOnlineTimeService.selectOne(new EntityWrapper<DriverOnlineTime>().eq("driverId", driverId).eq("DATE_FORMAT(`day`, '%Y-%m-%d')", s[1])); |
| | | if(null != driverOnlineTime){ |
| | | driverOnlineTime.setOnlineTime(new BigInteger(s[0])); |
| | | driverOnlineTimeService.updateById(driverOnlineTime); |
| | | }else{ |
| | | driverOnlineTime = new DriverOnlineTime(); |
| | | driverOnlineTime.setDriverId(driverId); |
| | | driverOnlineTime.setDay(sdf1.parse(s[1])); |
| | | driverOnlineTime.setOnlineTime(new BigInteger(s[0])); |
| | | driverOnlineTimeService.insert(driverOnlineTime); |
| | | } |
| | | driver.setOnlineTime(new BigInteger(s[0])); |
| | | this.updateById(driver); |
| | | redisUtil.setStrValue("ONLINE" + driverId, "0_" + sdf1.format(new Date()) + "_0", 25 * 60 * 60); |
| | | return; |
| | | } |
| | | Integer second = Integer.valueOf(s[0]) + 5; |
| | | Integer time = Integer.valueOf(s[2]); |
| | | |
| | | int h = Double.valueOf(second / 3600).intValue(); |
| | | if(h > 0 && h > time){ |
| | | Driver driver = this.selectById(driverId); |
| | | AccountChangeDetail accountChangeDetail = new AccountChangeDetail(); |
| | | accountChangeDetail.setCode(System.currentTimeMillis() + UUIDUtil.getNumberRandom(5)); |
| | | accountChangeDetail.setUserType(2); |
| | |
| | | accountChangeDetail.setNewData(driver.getIntegral().doubleValue()); |
| | | accountChangeDetail.setExplain("在线时长奖励"); |
| | | accountChangeDetailService.saveData(accountChangeDetail); |
| | | driver.setOnlineTime(new BigInteger(s[0])); |
| | | this.updateById(driver); |
| | | time++; |
| | | |
| | | //修改在线时长记录 |
| | | DriverOnlineTime driverOnlineTime = driverOnlineTimeService.selectOne(new EntityWrapper<DriverOnlineTime>().eq("driverId", driverId).eq("DATE_FORMAT(`day`, '%Y-%m-%d')", s[1])); |
| | | if(null != driverOnlineTime){ |
| | | driverOnlineTime.setOnlineTime(new BigInteger(s[0])); |
| | | driverOnlineTimeService.updateById(driverOnlineTime); |
| | | }else{ |
| | | driverOnlineTime = new DriverOnlineTime(); |
| | | driverOnlineTime.setDriverId(driverId); |
| | | driverOnlineTime.setDay(sdf1.parse(s[1])); |
| | | driverOnlineTime.setOnlineTime(new BigInteger(s[0])); |
| | | driverOnlineTimeService.insert(driverOnlineTime); |
| | | } |
| | | } |
| | | redisUtil.setStrValue("ONLINE" + driverId, second + "_" + s[1] + "_" + time); |
| | | } |
| | | redisUtil.setStrValue("ONLINE" + driverId, second + "_" + s[1] + "_" + time); |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | this.updateById(driver); |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | | @Override |
| | | public ResultUtil<HashMap<String, Object>> queryDriverOrderNum(String time,Integer uid) { |
| | | String sTime = null; |
| | | String eTime =null; |
| | | EntityWrapper<Order> wrapper = new EntityWrapper<>(); |
| | | EntityWrapper<AppUser> wrapperOne = new EntityWrapper<>(); |
| | | if(ToolUtil.isNotEmpty(time)){ |
| | | sTime = time.split(" - ")[0]+" 00:00:00"; |
| | | eTime = time.split(" - ")[1]+" 23:59:59"; |
| | | wrapper.between("orderTakingTime",sTime,eTime); |
| | | wrapperOne.between("createTime",sTime,eTime); |
| | | } |
| | | ArrayList<Integer> objects = new ArrayList<>(); |
| | | objects.add(101); |
| | | objects.add(201); |
| | | objects.add(301); |
| | | objects.add(401); |
| | | wrapper.eq("driverId",uid); |
| | | wrapper.notIn("state",objects); |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | int orderNum = orderService.selectCount(wrapper); |
| | | map.put("orderNum",orderNum); |
| | | // 有效时长 |
| | | int okTime = this.baseMapper.getTime(sTime,eTime,uid); |
| | | map.put("okTime",okTime); |
| | | wrapperOne.eq("inviterType",2); |
| | | wrapperOne.eq("inviterId",uid); |
| | | int userNum = appUserService.selectCount(wrapperOne); |
| | | |
| | | |
| | | map.put("userNum",userNum); |
| | | |
| | | |
| | | return ResultUtil.success(map); |
| | | } |
| | | } |
| | |
| | | @Autowired |
| | | private IOrderPositionService orderPositionService; |
| | | |
| | | @Autowired |
| | | private ICompanyFundFlowService companyFundFlowService; |
| | | |
| | | @Value("${callbackPath}") |
| | | private String callbackPath;//支付回调网关地址 |
| | | |
| | |
| | | * @param city 查询天气的城市 |
| | | * @return |
| | | */ |
| | | public Order getOrderPrice(Integer type, Double distance, Integer waitTime, Order order, String city) throws Exception{ |
| | | public Order getOrderPrice(Integer type, Double distance, Integer waitTime, Order order, String city) { |
| | | order = getOrderInitialPrice(order); |
| | | SystemConfig systemConfig = systemConfigService.selectOne(new EntityWrapper<SystemConfig>().eq("type", 5)); |
| | | if(null == systemConfig){ |
| | | if(type == 1){//预估金额 |
| | | if (null == systemConfig) { |
| | | if (type == 1) {//预估金额 |
| | | order.setEstimatedPrice(0D); |
| | | } |
| | | if(type == 2){//订单金额 |
| | | if (type == 2) {//订单金额 |
| | | order.setOrderMoney(0D); |
| | | } |
| | | return order; |
| | |
| | | s.setTime(date); |
| | | s.set(Calendar.HOUR_OF_DAY, hour1); |
| | | s.set(Calendar.MINUTE, Integer.valueOf(split[1])); |
| | | s.set(Calendar.SECOND, 59); |
| | | s.set(Calendar.SECOND, 0); |
| | | |
| | | Calendar e = Calendar.getInstance(); |
| | | e.setTime(date); |
| | |
| | | e.set(Calendar.MINUTE, Integer.valueOf(split1[1])); |
| | | e.set(Calendar.SECOND, 0); |
| | | |
| | | if(hour1 > hour2){ |
| | | if(s.getTimeInMillis() > date.getTime()){ |
| | | if (hour1 > hour2) { |
| | | if (s.getTimeInMillis() > date.getTime()) { |
| | | s.set(Calendar.DAY_OF_YEAR, s.get(Calendar.DAY_OF_YEAR) - 1); |
| | | }else{ |
| | | } else { |
| | | e.set(Calendar.DAY_OF_YEAR, e.get(Calendar.DAY_OF_YEAR) + 1); |
| | | } |
| | | } |
| | | |
| | | if(date.getTime() >= s.getTimeInMillis() && date.getTime() < e.getTimeInMillis()){ |
| | | if(num3.compareTo(distance) >= 0){//起步里程内 |
| | | if (date.getTime() >= s.getTimeInMillis() && date.getTime() < e.getTimeInMillis()) { |
| | | if (num3.compareTo(distance) >= 0) {//起步里程内 |
| | | order.setStartDistance(distance);//起步里程 |
| | | order.setStartPrice(num4);//起步价 |
| | | }else{ |
| | | } else { |
| | | Double distance1 = distance;//原始里程 |
| | | order.setStartDistance(num3);//起步里程 |
| | | order.setStartPrice(num4);//起步价 |
| | |
| | | order.setOverDrivePrice(multiply.doubleValue());//超出起步里程费 |
| | | |
| | | //计算长途费(超出长途起始公里,费用开始按照长途规则计算。) |
| | | if(distance.compareTo(num7) > 0){ |
| | | if (distance.compareTo(num7) > 0) { |
| | | order.setStartDistance(0D);//起步里程 |
| | | order.setStartPrice(0D);//起步价 |
| | | order.setOverDriveDistance(0D);//超出起步里程 |
| | |
| | | order.setLongDistancePrice(num9);//长途费 |
| | | } |
| | | //计算长途里程超出的部分 |
| | | if(distance.compareTo(num8) > 0){ |
| | | if (distance.compareTo(num8) > 0) { |
| | | order.setOverLongDistance(new BigDecimal(distance1 - num8).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());//超出长途里程 |
| | | |
| | | BigDecimal divide1 = new BigDecimal(distance - num8).divide(new BigDecimal(num10), 2, BigDecimal.ROUND_HALF_EVEN); |
| | |
| | | Double num9 = extraCost.getDouble("num9");//恶劣天气最高收取金额 |
| | | |
| | | //等待费用 |
| | | if(waitTime.compareTo(num1 * 60) >= 0){ |
| | | if (waitTime.compareTo(num1 * 60) >= 0) { |
| | | order.setWaitTime(num1 * 60);//等待时长 |
| | | order.setWaitTimePrice(num2);//等待费用 |
| | | |
| | |
| | | |
| | | //恶劣天气 |
| | | systemConfig = systemConfigService.selectOne(new EntityWrapper<SystemConfig>().eq("type", 8)); |
| | | if(null != systemConfig) { |
| | | if (null != systemConfig) { |
| | | JSONObject jsonObject1 = JSON.parseObject(systemConfig.getContent()); |
| | | Integer num11 = jsonObject1.getInteger("num1");//开启恶劣天气计价 |
| | | if(1 == num11){ |
| | | if (1 == num11) { |
| | | boolean badWeather = WeatherUtil.isBadWeather(city); |
| | | if(badWeather){ |
| | | if (badWeather) { |
| | | order.setBadWeatherDistance(num5);//恶劣天气公里 |
| | | order.setBadWeatherPrice(num6);//恶劣天气费 |
| | | if(distance.compareTo(num7) > 0){ |
| | | if (distance.compareTo(num7) > 0) { |
| | | BigDecimal subtract = new BigDecimal(distance).subtract(new BigDecimal(num7)); |
| | | BigDecimal multiply = subtract.multiply(new BigDecimal(num8)); |
| | | order.setOverBadWeatherDistance(subtract.doubleValue());//恶劣天气超出公里 |
| | |
| | | } |
| | | |
| | | double add = new BigDecimal(order.getOverBadWeatherPrice()).add(new BigDecimal(order.getBadWeatherPrice())).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue(); |
| | | if(num9.compareTo(add) < 0){//超出最高金额(重新调整金额) |
| | | if(num9.compareTo(num6) < 0){//如果恶劣天气费大于最高金额 |
| | | if (num9.compareTo(add) < 0) {//超出最高金额(重新调整金额) |
| | | if (num9.compareTo(num6) < 0) {//如果恶劣天气费大于最高金额 |
| | | order.setBadWeatherPrice(num9);//恶劣天气费 |
| | | order.setOverBadWeatherPrice(0D);//恶劣天气超出公里费 |
| | | }else{ |
| | | } else { |
| | | BigDecimal subtract = new BigDecimal(num9).subtract(new BigDecimal(add)); |
| | | order.setOverBadWeatherPrice(subtract.doubleValue());//恶劣天气超出公里费 |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | //计算折扣 |
| | | if(null != order.getUserId()){ |
| | | //计算折扣 |
| | | if (null != order.getUserId()) { |
| | | |
| | | } |
| | | } |
| | | |
| | | //计算总金额 |
| | | BigDecimal bigDecimal = new BigDecimal(order.getStartPrice() + order.getOverDrivePrice() + order.getLongDistancePrice() + order.getOverLongDistancePrice() + |
| | | order.getWaitTimePrice() + order.getOutWaitTimePrice() + order.getBadWeatherPrice() + order.getOverBadWeatherPrice() - order.getDiscountAmount()).setScale(2, BigDecimal.ROUND_HALF_EVEN); |
| | | //计算总金额 |
| | | BigDecimal bigDecimal = new BigDecimal(order.getStartPrice() + order.getOverDrivePrice() + order.getLongDistancePrice() + order.getOverLongDistancePrice() + |
| | | order.getWaitTimePrice() + order.getOutWaitTimePrice() + order.getBadWeatherPrice() + order.getOverBadWeatherPrice() - order.getDiscountAmount()).setScale(2, BigDecimal.ROUND_HALF_EVEN); |
| | | |
| | | if(type == 1){//预估价 |
| | | order.setEstimatedPrice(bigDecimal.doubleValue()); |
| | | } |
| | | if(type == 2){//订单金额 |
| | | order.setOrderMoney(bigDecimal.doubleValue()); |
| | | if (type == 1) {//预估价 |
| | | order.setEstimatedPrice(bigDecimal.doubleValue()); |
| | | } |
| | | if (type == 2) {//订单金额 |
| | | order.setOrderMoney(bigDecimal.doubleValue()); |
| | | } |
| | | return order; |
| | | } |
| | | return order; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public ResultUtil transferOrder(Integer uid, Long orderId, String cause) throws Exception { |
| | | public ResultUtil transferOrder(Integer uid, Long orderId, String cause, String phone) throws Exception { |
| | | // 7.13改动 |
| | | OrderTransfer orderTransfer = new OrderTransfer(); |
| | | Order order = this.selectById(orderId); |
| | | if(phone!=null && !"".equals(phone)) { |
| | | List<Driver> drivers = driverService.selectList(new EntityWrapper<Driver>().eq("phone", phone)); |
| | | if (drivers.size() == 0) { |
| | | return ResultUtil.error("暂无该司机,无法转单"); |
| | | } else { |
| | | Driver driver = drivers.get(0); |
| | | if (driver.getServerStatus() != 1) { |
| | | return ResultUtil.error("司机正在服务中,无法转单。"); |
| | | } |
| | | if (driver.getStatus() != 1) { |
| | | return ResultUtil.error("该司机已被冻结,无法转单。"); |
| | | } |
| | | order.setDriverId(driver.getId()); |
| | | orderTransfer.setNewDriverId(driver.getId()); |
| | | } |
| | | } |
| | | if(order.getDriverId().compareTo(uid) != 0){ |
| | | return ResultUtil.error("无权操作"); |
| | | } |
| | |
| | | order.setState(201); |
| | | this.updateById(order); |
| | | |
| | | OrderTransfer orderTransfer = new OrderTransfer(); |
| | | |
| | | orderTransfer.setOrderId(orderId); |
| | | orderTransfer.setOldDriverId(order.getDriverId()); |
| | | orderTransfer.setCause(cause); |
| | | orderTransfer.setStatus(1); |
| | | orderTransfer.setCreateTime(new Date()); |
| | | orderTransferService.insert(orderTransfer); |
| | | if(phone==null ||"".equals(phone)){ |
| | | //开始派单 |
| | | Order finalOrder = order; |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | pushOrder(finalOrder.getId()); |
| | | } |
| | | }).start(); |
| | | } |
| | | |
| | | //开始派单 |
| | | Order finalOrder = order; |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | pushOrder(finalOrder.getId()); |
| | | } |
| | | }).start(); |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | |
| | | accountChangeDetailService.insert(accountChangeDetail); |
| | | |
| | | //补贴中分账 |
| | | Double balance = revenueService.queryCompanyBalance();//平台账户余额 |
| | | |
| | | Double discountedPrice = order.getDiscountedPrice(); |
| | | List<RechargeRecord> rechargeRecords = rechargeRecordService.selectList(new EntityWrapper<RechargeRecord>().eq("type", 4).eq("payStatus", 2).gt("surplusDividedAmount", 0).orderBy("createTime")); |
| | | for (RechargeRecord rechargeRecord : rechargeRecords) { |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | CompanyFundFlow companyFundFlow = new CompanyFundFlow(); |
| | | companyFundFlow.setType(5); |
| | | companyFundFlow.setObjectType(1); |
| | | companyFundFlow.setBalance(new BigDecimal(balance)); |
| | | companyFundFlow.setMoney(new BigDecimal(order.getDiscountedPrice())); |
| | | companyFundFlow.setCreateTime(new Date()); |
| | | companyFundFlowService.insert(companyFundFlow); |
| | | } |
| | | } |
| | | this.updateById(order); |
| | |
| | | } |
| | | //处理代理商抽佣 |
| | | if(num3 > 0){ |
| | | Double balance = revenueService.queryAgentBalance(driver.getAgentId()); |
| | | Revenue revenue = new Revenue(); |
| | | revenue.setType(1); |
| | | revenue.setUserType(3); |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | CompanyFundFlow companyFundFlow = new CompanyFundFlow(); |
| | | companyFundFlow.setType(3); |
| | | companyFundFlow.setObjectType(2); |
| | | companyFundFlow.setObjectId(driver.getAgentId()); |
| | | companyFundFlow.setBalance(new BigDecimal(balance)); |
| | | companyFundFlow.setMoney(new BigDecimal(num3)); |
| | | companyFundFlow.setCreateTime(new Date()); |
| | | companyFundFlowService.insert(companyFundFlow); |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | if(type == 3){//收入 |
| | | performanceRankingWarppers = revenueService.queryDriverRank(1, time, dayType); |
| | | |
| | | // 通过司机id 去差订单的优惠金额 |
| | | for (PerformanceRankingWarpper performanceRankingWarpper : performanceRankingWarppers) { |
| | | List<Order> orders = this.baseMapper.selectList(new EntityWrapper<Order>().eq("driverId", performanceRankingWarpper.getDriverId()).isNotNull("payMoney")); |
| | | double sum = orders.stream().mapToDouble(Order::getDiscountedPrice).sum(); |
| | | double sum1 = orders.stream().mapToDouble(Order::getDiscountAmount).sum(); |
| | | performanceRankingWarpper.setAmountOfData(new BigDecimal(performanceRankingWarpper.getAmountOfData()+sum+sum1).setScale(2,RoundingMode.HALF_UP).doubleValue()); |
| | | } |
| | | } |
| | | for (int i = 0; i < performanceRankingWarppers.size(); i++) { |
| | | PerformanceRankingWarpper performanceRankingWarpper = performanceRankingWarppers.get(i); |
| | |
| | | if(performanceRankingWarpper.getDriverId().compareTo(driverId) == 0){ |
| | | break; |
| | | } |
| | | if(i == performanceRankingWarppers.size() - 1){ |
| | | position = 0; |
| | | d = 0D; |
| | | } |
| | | } |
| | | MyAchievementWarpper myAchievementWarpper = new MyAchievementWarpper(); |
| | | myAchievementWarpper.setType("订单"); |
| | |
| | | if(performanceRankingWarpper.getDriverId().compareTo(driverId) == 0){ |
| | | break; |
| | | } |
| | | if(i == performanceRankingWarppers.size() - 1){ |
| | | position = 0; |
| | | d = 0D; |
| | | } |
| | | } |
| | | myAchievementWarpper = new MyAchievementWarpper(); |
| | | myAchievementWarpper.setType("收入"); |
| | |
| | | } |
| | | if(performanceRankingWarpper.getDriverId().compareTo(driverId) == 0){ |
| | | break; |
| | | } |
| | | if(i == performanceRankingWarppers.size() - 1){ |
| | | position = 0; |
| | | d = 0D; |
| | | } |
| | | } |
| | | myAchievementWarpper = new MyAchievementWarpper(); |
| | |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.supersavedriving.driver.core.util.ToolUtil; |
| | | import com.supersavedriving.driver.modular.system.dao.AccountChangeDetailMapper; |
| | | import com.supersavedriving.driver.modular.system.dao.RevenueMapper; |
| | | import com.supersavedriving.driver.modular.system.model.AppUser; |
| | | import com.supersavedriving.driver.modular.system.model.Driver; |
| | | import com.supersavedriving.driver.modular.system.model.Order; |
| | | import com.supersavedriving.driver.modular.system.model.Revenue; |
| | | import com.supersavedriving.driver.modular.system.model.*; |
| | | import com.supersavedriving.driver.modular.system.service.IAppUserService; |
| | | import com.supersavedriving.driver.modular.system.service.IDriverService; |
| | | import com.supersavedriving.driver.modular.system.service.IOrderService; |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | |
| | | @Autowired |
| | | private IDriverService driverService; |
| | | |
| | | @Resource |
| | | private AccountChangeDetailMapper accountChangeDetailMapper; |
| | | |
| | | |
| | | |
| | | |
| | |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public List<CommissionListWarpper> queryCommissionList(Integer driverId, String time, Integer pageNum, Integer pageSize) throws Exception { |
| | | public List<CommissionListWarpper> queryCommissionList(Integer driverId, String time, Integer pageNum, Integer pageSize,Integer type) throws Exception { |
| | | pageNum = (pageNum - 1) * pageSize; |
| | | Wrapper<Revenue> wrapper = new EntityWrapper<Revenue>().eq("userType", 2) |
| | | .eq("userId", driverId); |
| | | ArrayList<Integer> objects = new ArrayList<>(); |
| | | objects.add(1); |
| | | objects.add(4); |
| | | objects.add(5); |
| | | objects.add(7); |
| | | Wrapper<AccountChangeDetail> wrapper = new EntityWrapper<AccountChangeDetail>().eq("userType", 2) |
| | | .eq("userId", driverId).eq("type",1).in("changeType",objects); |
| | | if(ToolUtil.isNotEmpty(type)){ |
| | | wrapper.eq("changeType",type); |
| | | } |
| | | if(ToolUtil.isNotEmpty(time)){ |
| | | wrapper.eq("DATE_FORMAT(createTime, '%Y年%m月')", time); |
| | | } |
| | | List<Revenue> revenues = this.selectList(wrapper.last(" order by createTime desc limit " + pageNum + ", " + pageSize)); |
| | | List<AccountChangeDetail> revenues = accountChangeDetailMapper.selectList(wrapper.last(" order by createTime desc limit " + pageNum + ", " + pageSize)); |
| | | List<CommissionListWarpper> list = new ArrayList<>(); |
| | | for (Revenue revenue : revenues) { |
| | | for (AccountChangeDetail revenue : revenues) { |
| | | CommissionListWarpper commissionListWarpper = new CommissionListWarpper(); |
| | | commissionListWarpper.setCreateTime(revenue.getCreateTime().getTime()); |
| | | commissionListWarpper.setAmount(revenue.getAmount()); |
| | | commissionListWarpper.setUserType(revenue.getType()); |
| | | commissionListWarpper.setUserType(revenue.getChangeType()); |
| | | commissionListWarpper.setMoney(revenue.getOldData()); |
| | | if(revenue.getChangeType()==4){ |
| | | commissionListWarpper.setAmount(revenue.getNewData()-revenue.getOldData()); |
| | | }else { |
| | | commissionListWarpper.setAmount(revenue.getOldData()-revenue.getNewData()); |
| | | } |
| | | |
| | | list.add(commissionListWarpper); |
| | | } |
| | | return list; |
| | |
| | | public List<PerformanceRankingWarpper> queryDriverRank(Integer type, String time, Integer dayType) { |
| | | return this.baseMapper.queryDriverRank(type, time, dayType); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取代理商账户余额 |
| | | * @param companyId |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Double queryAgentBalance(Integer companyId) { |
| | | return this.baseMapper.queryAgentBalance(companyId); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取平台账户余额 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Double queryCompanyBalance() { |
| | | return this.baseMapper.queryCompanyBalance(); |
| | | } |
| | | } |
| | |
| | | public class CommissionListWarpper { |
| | | @ApiModelProperty("日期") |
| | | private Long createTime; |
| | | @ApiModelProperty("推广类型(1=线上收入,2=佣金,3=优惠券)") |
| | | @ApiModelProperty("推广类型(1=订单收入,4=提现,5=佣金收入,7优惠券收入)") |
| | | private Integer userType; |
| | | @ApiModelProperty("获取佣金") |
| | | private Double amount; |
| | | @ApiModelProperty("余额") |
| | | private Double money; |
| | | } |
| | |
| | | private String code; |
| | | @ApiModelProperty(value = "头像", required = false, dataType = "string") |
| | | private String avatar; |
| | | @ApiModelProperty(value = "姓名", required = false, dataType = "string") |
| | | private String name; |
| | | @ApiModelProperty(value = "手机号码", required = true, dataType = "string") |
| | | private String phone; |
| | | @ApiModelProperty(value = "紧急联系人", required = true, dataType = "string") |
| | | @ApiModelProperty(value = "紧急联系人", required = false, dataType = "string") |
| | | private String emergencyContact; |
| | | @ApiModelProperty(value = "紧急联系人电话", required = true, dataType = "string") |
| | | @ApiModelProperty(value = "紧急联系人电话", required = false, dataType = "string") |
| | | private String emergencyPhone; |
| | | @ApiModelProperty(value = "身份证正面照", required = true, dataType = "string") |
| | | private String idcardFront; |
| | |
| | | private Integer inviterId; |
| | | @ApiModelProperty(value = "注册来源(1=司机端注册,2=其他端注册)", required = true, dataType = "int") |
| | | private Integer source; |
| | | @ApiModelProperty(value = "姓名", required = true, dataType = "String") |
| | | private String name; |
| | | @ApiModelProperty(value = "身份证号码", required = true, dataType = "String") |
| | | private String idcard; |
| | | @ApiModelProperty(value = "驾龄", required = true, dataType = "int") |
| | | private Integer carAge; |
| | | } |
| | |
| | | application: |
| | | name: driver-server |
| | | profiles: |
| | | # active: dev |
| | | active: produce |
| | | active: dev |
| | | # active: produce |
| | | mvc: |
| | | static-path-pattern: /static/** |
| | | view: |
| | |
| | | |
| | | |
| | | spring: |
| | | # datasource: |
| | | # url: jdbc:mysql://127.0.0.1:3306/super_save_driving?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=Asia/Shanghai |
| | | # username: root |
| | | # password: f4OfRjqoN3jSiNGiUoiNsQdOBtCOKYRj |
| | | ## password: 123456 |
| | | # db-name: guns #用来搜集数据库的所有表 |
| | | # filters: wall,mergeStat |
| | | |
| | | datasource: |
| | | url: jdbc:mysql://127.0.0.1:3306/super_save_driving?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=Asia/Shanghai |
| | | url: jdbc:mysql://192.168.110.80:3306/super_save_driving?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=Asia/Shanghai |
| | | username: root |
| | | password: f4OfRjqoN3jSiNGiUoiNsQdOBtCOKYRj |
| | | # password: 123456 |
| | | password: 123456 |
| | | db-name: guns #用来搜集数据库的所有表 |
| | | filters: wall,mergeStat |
| | | |
| | |
| | | spring: |
| | | data: |
| | | mongodb: |
| | | uri: mongodb://root:CEtyLdKjPk0yeHNo@127.0.0.1:27017/admin |
| | | # uri: mongodb://127.0.0.1:27017/admin |
| | | # uri: mongodb://root:CEtyLdKjPk0yeHNo@127.0.0.1:27017/admin |
| | | uri: mongodb://127.0.0.1:27017/admin |
| | | |
| | | --- |
| | | |
| | |
| | | # Redis·þÎñÆ÷µØÖ· |
| | | spring.redis.host=127.0.0.1 |
| | | # Redis·þÎñÆ÷Á¬½Ó¶Ë¿Ú |
| | | spring.redis.port=16379 |
| | | #spring.redis.port=16379 |
| | | # Redis·þÎñÆ÷Á¬½ÓÃÜÂ루ĬÈÏΪ¿Õ£© |
| | | spring.redis.password=cKsEeyffDXG5PzNg8CIbrWxFluXrCprZ |
| | | #spring.redis.password=cKsEeyffDXG5PzNg8CIbrWxFluXrCprZ |
| | | |
| | | ## Redis·þÎñÆ÷µØÖ· |
| | | #spring.redis.host=127.0.0.1 |
| | | ## Redis·þÎñÆ÷Á¬½Ó¶Ë¿Ú |
| | | #spring.redis.port=6379 |
| | | spring.redis.port=6379 |
| | | ## Redis·þÎñÆ÷Á¬½ÓÃÜÂ루ĬÈÏΪ¿Õ£© |
| | | #spring.redis.password=123456 |
| | | spring.redis.password=123456 |
| | | |
| | | # Á¬½Ó³Ø×î´óÁ¬½ÓÊý£¨Ê¹ÓøºÖµ±íʾûÓÐÏÞÖÆ£© |
| | | spring.redis.jedis.pool.max-active=1024 |
| | |
| | | //package com.supersavedriving.driver; |
| | | // |
| | | // import com.alibaba.fastjson.JSON; |
| | | // import com.alibaba.fastjson.JSONObject; |
| | | // import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | // import com.supersavedriving.driver.core.util.ToolUtil; |
| | | // import com.supersavedriving.driver.modular.system.model.*; |
| | | // import com.supersavedriving.driver.modular.system.service.*; |
| | | // import com.supersavedriving.driver.modular.system.service.impl.CashWithdrawalServiceImpl; |
| | | // import com.supersavedriving.driver.modular.system.service.impl.OrderServiceImpl; |
| | | // import com.supersavedriving.driver.modular.system.util.MallBook.model.*; |
| | | // import com.supersavedriving.driver.modular.system.util.MallBook.util.TrhRequest; |
| | | // import com.supersavedriving.driver.modular.system.util.RedisUtil; |
| | | // import com.supersavedriving.driver.modular.system.util.ResultUtil; |
| | | // import com.supersavedriving.driver.modular.system.util.UUIDUtil; |
| | | // import com.supersavedriving.driver.modular.system.util.juhe.WeatherCityInfo; |
| | | // import com.supersavedriving.driver.modular.system.util.juhe.WeatherUtil; |
| | | // import com.supersavedriving.driver.modular.system.warpper.OrderPriceWarpper; |
| | | // import com.supersavedriving.driver.modular.system.warpper.PerformanceSummaryWarpper; |
| | | // import org.junit.Test; |
| | | // import org.junit.runner.RunWith; |
| | | // import org.springframework.beans.BeanUtils; |
| | | // import org.springframework.beans.factory.annotation.Autowired; |
| | | // import org.springframework.boot.test.context.SpringBootTest; |
| | | // import org.springframework.test.context.junit4.SpringRunner; |
| | | // |
| | | // import java.text.SimpleDateFormat; |
| | | // import java.util.*; |
| | | //import com.supersavedriving.driver.modular.system.model.WeatherCity; |
| | | //import com.supersavedriving.driver.modular.system.service.IAccountChangeDetailService; |
| | | //import com.supersavedriving.driver.modular.system.service.IOrderService; |
| | | //import com.supersavedriving.driver.modular.system.service.IWeatherCityService; |
| | | //import com.supersavedriving.driver.modular.system.util.ResultUtil; |
| | | //import com.supersavedriving.driver.modular.system.util.juhe.WeatherCityInfo; |
| | | //import com.supersavedriving.driver.modular.system.util.juhe.WeatherUtil; |
| | | //import com.supersavedriving.driver.modular.system.warpper.PerformanceSummaryWarpper; |
| | | //import org.junit.Test; |
| | | //import org.junit.runner.RunWith; |
| | | //import org.springframework.beans.BeanUtils; |
| | | //import org.springframework.beans.factory.annotation.Autowired; |
| | | //import org.springframework.boot.test.context.SpringBootTest; |
| | | //import org.springframework.test.context.junit4.SpringRunner; |
| | | // |
| | | // |
| | | //@RunWith(SpringRunner.class) |
| | |
| | | // @Autowired |
| | | // private IOrderService orderService; |
| | | // |
| | | // @Autowired |
| | | // private IDriverService driverService; |
| | | // |
| | | // @Autowired |
| | | // private IDriverBankService driverBankService; |
| | | // |
| | | // @Autowired |
| | | // private IAppUserService appUserService; |
| | | // |
| | | // @Autowired |
| | | // private ISystemConfigService systemConfigService; |
| | | // |
| | | // @Autowired |
| | | // private IAccountChangeDetailService accountChangeDetailService; |
| | | // |
| | | // @Autowired |
| | | // private IRevenueService revenueService; |
| | | // |
| | | // @Autowired |
| | | // private IRechargeRecordService rechargeRecordService; |
| | | // |
| | | // @Autowired |
| | | // private IAgentService agentService; |
| | | // |
| | | // @Autowired |
| | | // private IDivisionRecordService divisionRecordService; |
| | | // |
| | | // @Autowired |
| | | // private ICashWithdrawalService cashWithdrawalService; |
| | | // |
| | | // @Autowired |
| | | // private RedisUtil redisUtil; |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // @Test |
| | | // public void test() throws Exception { |
| | | //// Withdraw withdraw = new Withdraw(); |
| | | //// withdraw.setUserId("79796121680"); |
| | | //// withdraw.setAmount(String.valueOf(Double.valueOf(54.48 * 100).intValue())); |
| | | //// withdraw.setOrderName("账户余额提现"); |
| | | //// withdraw.setRemark("账户余额提现"); |
| | | //// withdraw.setNotifyUrl("https://chaoshengdaijia.com:443/driver/base/driver/withdrawCashCallback"); |
| | | //// withdraw.setParameter1("1"); |
| | | //// TrhRequest<Withdraw> request1 = new TrhRequest(); |
| | | //// InterfaceResponse execute = request1.execute(withdraw, Withdraw.SERVICE_CODE);//结算(提现) |
| | | //// if("0000".equals(execute.getCode())){ |
| | | //// JSONObject jsonObject1 = JSON.parseObject(execute.getResult()); |
| | | //// String merOrderId1 = jsonObject1.getString("merOrderId"); |
| | | //// Integer status = jsonObject1.getInteger("status");//0:待处理;1:成功;2:失败 |
| | | //// if(1 == status){ |
| | | //// } |
| | | //// if(2 == status){ |
| | | //// System.err.println("结算接口异常【提现】:" + jsonObject1.getString("statusMsg")); |
| | | //// } |
| | | //// }else{ |
| | | //// System.err.println("结算接口异常【提现】:" + execute.getMsg()); |
| | | //// } |
| | | // |
| | | // |
| | | // |
| | | //// QueryUser queryUser = new QueryUser(); |
| | | //// /** |
| | | //// * 业务系统会员ID(必填) 字段长度最长:32位 |
| | | //// */ |
| | | //// queryUser.setMerUserId("driver_13"); |
| | | //// TrhRequest<QueryUser> request = new TrhRequest(); |
| | | //// InterfaceResponse execute = request.execute(queryUser, QueryUser.SERVICE_CODE); |
| | | //// if("0000".equals(execute.getCode())){ |
| | | //// JSONObject jsonObject1 = JSON.parseObject(execute.getResult()); |
| | | //// String merOrderId1 = jsonObject1.getString("merOrderId"); |
| | | //// Integer status = jsonObject1.getInteger("status");//0:待处理;1:成功;2:失败 |
| | | //// if(1 == status){ |
| | | //// } |
| | | //// if(2 == status){ |
| | | //// System.err.println("结算接口异常【提现】:" + jsonObject1.getString("statusMsg")); |
| | | //// } |
| | | //// }else{ |
| | | //// System.err.println("结算接口异常【提现】:" + execute.getMsg()); |
| | | //// } |
| | | // |
| | | // |
| | | // for (int i = 0; i < 2; i++) { |
| | | // String value = redisUtil.getValue("repeat_" + 10); |
| | | // if(ToolUtil.isEmpty(value)){ |
| | | // redisUtil.setStrValue("repeat_" + 10, System.currentTimeMillis() + "", 600);//10分钟 |
| | | // }else{ |
| | | // Long s = System.currentTimeMillis() - Long.valueOf(value); |
| | | // if(s.compareTo(60000L) < 0){//1分钟 |
| | | // System.err.println("数据处理中"); |
| | | // } |
| | | // } |
| | | // } |
| | | // PerformanceSummaryWarpper performanceSummaryWarpper = orderService.queryPerformanceSummary(1, 1, "2023年", 3); |
| | | // } |
| | | // |
| | | //} |
| | |
| | | <element id="module-output" name="guns-admin" /> |
| | | </element> |
| | | <element id="directory" name="lib"> |
| | | <element id="library" level="project" name="Maven: cn.hutool:hutool-core:5.3.8" /> |
| | | <element id="library" level="project" name="Maven: cn.hutool:hutool-crypto:5.3.8" /> |
| | | <element id="archive" name="guns-core-1.0.0.jar"> |
| | | <element id="module-output" name="guns-core" /> |
| | | </element> |
| | |
| | | <element id="library" level="project" name="Maven: io.netty:netty-resolver:4.1.23.Final" /> |
| | | <element id="library" level="project" name="Maven: io.netty:netty-handler:4.1.23.Final" /> |
| | | <element id="library" level="project" name="Maven: io.netty:netty-codec:4.1.23.Final" /> |
| | | <element id="library" level="project" name="Maven: com.github.wechatpay-apiv3:wechatpay-java-shangmi:0.2.1" /> |
| | | <element id="library" level="project" name="Maven: com.github.wechatpay-apiv3:wechatpay-java-core:0.2.1" /> |
| | | <element id="library" level="project" name="Maven: com.tencent.kona:kona-crypto:1.0.3" /> |
| | | <element id="library" level="project" name="Maven: org.bouncycastle:bcprov-jdk18on:1.72" /> |
| | | <element id="library" level="project" name="Maven: com.tencent.kona:kona-pkix:1.0.3" /> |
| | | <element id="library" level="project" name="Maven: com.tencent.kona:kona-provider:1.0.3" /> |
| | | <element id="library" level="project" name="Maven: cn.hutool:hutool-all:5.7.7" /> |
| | | </element> |
| | | </element> |
| | | <element id="directory" name="META-INF"> |
| | |
| | | <project version="4"> |
| | | <component name="CompilerConfiguration"> |
| | | <annotationProcessing> |
| | | <profile default="true" name="Default" enabled="true" /> |
| | | <profile name="Maven default annotation processors profile" enabled="true"> |
| | | <sourceOutputDir name="target/generated-sources/annotations" /> |
| | | <sourceTestOutputDir name="target/generated-test-sources/test-annotations" /> |
New file |
| | |
| | | <component name="libraryTable"> |
| | | <library name="Maven: cn.hutool:hutool-all:5.7.7"> |
| | | <CLASSES> |
| | | <root url="jar://$MAVEN_REPOSITORY$/cn/hutool/hutool-all/5.7.7/hutool-all-5.7.7.jar!/" /> |
| | | </CLASSES> |
| | | <JAVADOC> |
| | | <root url="jar://$MAVEN_REPOSITORY$/cn/hutool/hutool-all/5.7.7/hutool-all-5.7.7-javadoc.jar!/" /> |
| | | </JAVADOC> |
| | | <SOURCES> |
| | | <root url="jar://$MAVEN_REPOSITORY$/cn/hutool/hutool-all/5.7.7/hutool-all-5.7.7-sources.jar!/" /> |
| | | </SOURCES> |
| | | </library> |
| | | </component> |
New file |
| | |
| | | <component name="libraryTable"> |
| | | <library name="Maven: com.github.wechatpay-apiv3:wechatpay-java-core:0.2.1"> |
| | | <CLASSES> |
| | | <root url="jar://$MAVEN_REPOSITORY$/com/github/wechatpay-apiv3/wechatpay-java-core/0.2.1/wechatpay-java-core-0.2.1.jar!/" /> |
| | | </CLASSES> |
| | | <JAVADOC> |
| | | <root url="jar://$MAVEN_REPOSITORY$/com/github/wechatpay-apiv3/wechatpay-java-core/0.2.1/wechatpay-java-core-0.2.1-javadoc.jar!/" /> |
| | | </JAVADOC> |
| | | <SOURCES> |
| | | <root url="jar://$MAVEN_REPOSITORY$/com/github/wechatpay-apiv3/wechatpay-java-core/0.2.1/wechatpay-java-core-0.2.1-sources.jar!/" /> |
| | | </SOURCES> |
| | | </library> |
| | | </component> |
New file |
| | |
| | | <component name="libraryTable"> |
| | | <library name="Maven: com.github.wechatpay-apiv3:wechatpay-java-shangmi:0.2.1"> |
| | | <CLASSES> |
| | | <root url="jar://$MAVEN_REPOSITORY$/com/github/wechatpay-apiv3/wechatpay-java-shangmi/0.2.1/wechatpay-java-shangmi-0.2.1.jar!/" /> |
| | | </CLASSES> |
| | | <JAVADOC> |
| | | <root url="jar://$MAVEN_REPOSITORY$/com/github/wechatpay-apiv3/wechatpay-java-shangmi/0.2.1/wechatpay-java-shangmi-0.2.1-javadoc.jar!/" /> |
| | | </JAVADOC> |
| | | <SOURCES> |
| | | <root url="jar://$MAVEN_REPOSITORY$/com/github/wechatpay-apiv3/wechatpay-java-shangmi/0.2.1/wechatpay-java-shangmi-0.2.1-sources.jar!/" /> |
| | | </SOURCES> |
| | | </library> |
| | | </component> |
New file |
| | |
| | | <component name="libraryTable"> |
| | | <library name="Maven: com.tencent.kona:kona-crypto:1.0.3"> |
| | | <CLASSES> |
| | | <root url="jar://$MAVEN_REPOSITORY$/com/tencent/kona/kona-crypto/1.0.3/kona-crypto-1.0.3.jar!/" /> |
| | | </CLASSES> |
| | | <JAVADOC> |
| | | <root url="jar://$MAVEN_REPOSITORY$/com/tencent/kona/kona-crypto/1.0.3/kona-crypto-1.0.3-javadoc.jar!/" /> |
| | | </JAVADOC> |
| | | <SOURCES> |
| | | <root url="jar://$MAVEN_REPOSITORY$/com/tencent/kona/kona-crypto/1.0.3/kona-crypto-1.0.3-sources.jar!/" /> |
| | | </SOURCES> |
| | | </library> |
| | | </component> |
New file |
| | |
| | | <component name="libraryTable"> |
| | | <library name="Maven: com.tencent.kona:kona-pkix:1.0.3"> |
| | | <CLASSES> |
| | | <root url="jar://$MAVEN_REPOSITORY$/com/tencent/kona/kona-pkix/1.0.3/kona-pkix-1.0.3.jar!/" /> |
| | | </CLASSES> |
| | | <JAVADOC> |
| | | <root url="jar://$MAVEN_REPOSITORY$/com/tencent/kona/kona-pkix/1.0.3/kona-pkix-1.0.3-javadoc.jar!/" /> |
| | | </JAVADOC> |
| | | <SOURCES> |
| | | <root url="jar://$MAVEN_REPOSITORY$/com/tencent/kona/kona-pkix/1.0.3/kona-pkix-1.0.3-sources.jar!/" /> |
| | | </SOURCES> |
| | | </library> |
| | | </component> |
New file |
| | |
| | | <component name="libraryTable"> |
| | | <library name="Maven: com.tencent.kona:kona-provider:1.0.3"> |
| | | <CLASSES> |
| | | <root url="jar://$MAVEN_REPOSITORY$/com/tencent/kona/kona-provider/1.0.3/kona-provider-1.0.3.jar!/" /> |
| | | </CLASSES> |
| | | <JAVADOC> |
| | | <root url="jar://$MAVEN_REPOSITORY$/com/tencent/kona/kona-provider/1.0.3/kona-provider-1.0.3-javadoc.jar!/" /> |
| | | </JAVADOC> |
| | | <SOURCES> |
| | | <root url="jar://$MAVEN_REPOSITORY$/com/tencent/kona/kona-provider/1.0.3/kona-provider-1.0.3-sources.jar!/" /> |
| | | </SOURCES> |
| | | </library> |
| | | </component> |
New file |
| | |
| | | <component name="libraryTable"> |
| | | <library name="Maven: org.bouncycastle:bcprov-jdk18on:1.72"> |
| | | <CLASSES> |
| | | <root url="jar://$MAVEN_REPOSITORY$/org/bouncycastle/bcprov-jdk18on/1.72/bcprov-jdk18on-1.72.jar!/" /> |
| | | </CLASSES> |
| | | <JAVADOC> |
| | | <root url="jar://$MAVEN_REPOSITORY$/org/bouncycastle/bcprov-jdk18on/1.72/bcprov-jdk18on-1.72-javadoc.jar!/" /> |
| | | </JAVADOC> |
| | | <SOURCES> |
| | | <root url="jar://$MAVEN_REPOSITORY$/org/bouncycastle/bcprov-jdk18on/1.72/bcprov-jdk18on-1.72-sources.jar!/" /> |
| | | </SOURCES> |
| | | </library> |
| | | </component> |
New file |
| | |
| | | <component name="libraryTable"> |
| | | <library name="Maven: org.projectlombok:lombok:1.18.20"> |
| | | <CLASSES> |
| | | <root url="jar://$MAVEN_REPOSITORY$/org/projectlombok/lombok/1.18.20/lombok-1.18.20.jar!/" /> |
| | | </CLASSES> |
| | | <JAVADOC> |
| | | <root url="jar://$MAVEN_REPOSITORY$/org/projectlombok/lombok/1.18.20/lombok-1.18.20-javadoc.jar!/" /> |
| | | </JAVADOC> |
| | | <SOURCES> |
| | | <root url="jar://$MAVEN_REPOSITORY$/org/projectlombok/lombok/1.18.20/lombok-1.18.20-sources.jar!/" /> |
| | | </SOURCES> |
| | | </library> |
| | | </component> |
| | |
| | | </list> |
| | | </option> |
| | | </component> |
| | | <component name="ProjectRootManager" version="2" project-jdk-name="1.8" project-jdk-type="JavaSDK" /> |
| | | <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="false" project-jdk-name="1.8" project-jdk-type="JavaSDK" /> |
| | | </project> |
| | |
| | | </content> |
| | | <orderEntry type="inheritedJdk" /> |
| | | <orderEntry type="sourceFolder" forTests="false" /> |
| | | <orderEntry type="library" scope="PROVIDED" name="Maven: org.projectlombok:lombok:1.18.20" level="project" /> |
| | | <orderEntry type="library" name="Maven: com.github.wechatpay-apiv3:wechatpay-java-shangmi:0.2.1" level="project" /> |
| | | <orderEntry type="library" name="Maven: com.github.wechatpay-apiv3:wechatpay-java-core:0.2.1" level="project" /> |
| | | <orderEntry type="library" scope="RUNTIME" name="Maven: com.tencent.kona:kona-crypto:1.0.3" level="project" /> |
| | | <orderEntry type="library" scope="RUNTIME" name="Maven: org.bouncycastle:bcprov-jdk18on:1.72" level="project" /> |
| | | <orderEntry type="library" scope="RUNTIME" name="Maven: com.tencent.kona:kona-pkix:1.0.3" level="project" /> |
| | | <orderEntry type="library" scope="RUNTIME" name="Maven: com.tencent.kona:kona-provider:1.0.3" level="project" /> |
| | | <orderEntry type="library" name="Maven: cn.hutool:hutool-all:5.7.7" level="project" /> |
| | | <orderEntry type="library" name="Maven: cn.hutool:hutool-core:5.3.8" level="project" /> |
| | | <orderEntry type="library" name="Maven: cn.hutool:hutool-crypto:5.3.8" level="project" /> |
| | | <orderEntry type="module" module-name="guns-core" /> |
| | | <orderEntry type="library" name="Maven: com.baomidou:mybatisplus-spring-boot-starter:1.0.5" level="project" /> |
| | | <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-configuration-processor:2.0.4.RELEASE" level="project" /> |
| | |
| | | <orderEntry type="library" name="Maven: io.netty:netty-resolver:4.1.23.Final" level="project" /> |
| | | <orderEntry type="library" name="Maven: io.netty:netty-handler:4.1.23.Final" level="project" /> |
| | | <orderEntry type="library" name="Maven: io.netty:netty-codec:4.1.23.Final" level="project" /> |
| | | <orderEntry type="library" scope="PROVIDED" name="Maven: org.projectlombok:lombok:1.18.20" level="project" /> |
| | | <orderEntry type="library" name="Maven: com.github.wechatpay-apiv3:wechatpay-java-shangmi:0.2.1" level="project" /> |
| | | <orderEntry type="library" name="Maven: com.github.wechatpay-apiv3:wechatpay-java-core:0.2.1" level="project" /> |
| | | <orderEntry type="library" scope="RUNTIME" name="Maven: com.tencent.kona:kona-crypto:1.0.3" level="project" /> |
| | | <orderEntry type="library" scope="RUNTIME" name="Maven: org.bouncycastle:bcprov-jdk18on:1.72" level="project" /> |
| | | <orderEntry type="library" scope="RUNTIME" name="Maven: com.tencent.kona:kona-pkix:1.0.3" level="project" /> |
| | | <orderEntry type="library" scope="RUNTIME" name="Maven: com.tencent.kona:kona-provider:1.0.3" level="project" /> |
| | | <orderEntry type="library" name="Maven: cn.hutool:hutool-all:5.7.7" level="project" /> |
| | | </component> |
| | | </module> |
| | |
| | | |
| | | import cn.hutool.core.codec.Base64; |
| | | import cn.hutool.core.util.ZipUtil; |
| | | import cn.hutool.crypto.SecureUtil; |
| | | import cn.hutool.http.server.HttpServerResponse; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.stylefeng.guns.core.base.controller.BaseController; |
| | | import com.stylefeng.guns.core.base.tips.SuccessTip; |
| | | import com.stylefeng.guns.core.common.constant.factory.PageFactory; |
| | | import com.stylefeng.guns.core.common.constant.state.ManagerStatus; |
| | | import com.stylefeng.guns.core.exception.GunsException; |
| | | import com.stylefeng.guns.core.exception.ServiceExceptionEnum; |
| | | import com.stylefeng.guns.core.shiro.ShiroKit; |
| | | import com.stylefeng.guns.core.shiro.ShiroUser; |
| | | import com.stylefeng.guns.core.util.DateUtil; |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | import com.stylefeng.guns.modular.system.controller.resp.TAgentResp; |
| | | import com.stylefeng.guns.modular.system.controller.util.ExcelUtil; |
| | | import com.stylefeng.guns.modular.system.controller.util.UUIDUtil; |
| | | import com.stylefeng.guns.modular.system.enums.OrderStateEnum; |
| | | import com.stylefeng.guns.modular.system.enums.PayStatusEnum; |
| | | import com.stylefeng.guns.modular.system.enums.UserTypeEnum; |
| | | import com.stylefeng.guns.modular.system.model.*; |
| | | import com.stylefeng.guns.modular.system.service.*; |
| | | import com.stylefeng.guns.modular.system.util.MallBook.model.*; |
| | | import com.stylefeng.guns.modular.system.util.MallBook.util.TrhRequest; |
| | | import com.stylefeng.guns.modular.system.util.RedisUtil; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.poi.hdf.extractor.TC; |
| | | import org.apache.poi.hssf.usermodel.HSSFWorkbook; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.transaction.annotation.Propagation; |
| | |
| | | import java.text.DateFormat; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * 控制器 |
| | |
| | | @Autowired |
| | | private ITSystemConfigService systemConfigService; |
| | | |
| | | @Autowired |
| | | private ICompanyFundFlowService companyFundFlowService; |
| | | |
| | | @Value("${callbackPath}") |
| | | private String callbackPath; |
| | | |
| | |
| | | TAgent tAgent = tAgentService.selectById(tAgentId); |
| | | model.addAttribute("item",tAgent); |
| | | LogObjectHolder.me().set(tAgent); |
| | | User user = userService.selectOne(new EntityWrapper<User>().eq("role_type", 3).eq("object_id", tAgentId)); |
| | | model.addAttribute("user", user); |
| | | return PREFIX + "tAgent_edit.html"; |
| | | } |
| | | |
| | |
| | | */ |
| | | @RequestMapping("/tAgent/areaDetail") |
| | | public String areaDetail(String area,String areaId,Model model) { |
| | | // String[] split1 = areaId.split("/"); |
| | | // 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()); |
| | | //// // 查询市 |
| | | //// List<TRegion> tRegions1 = tRegionService.selectList(new EntityWrapper<TRegion>().eq("parent_id", split1[0])); |
| | | //// model.addAttribute("cityList",tRegions1); |
| | | //// |
| | | //// // 查询区 |
| | | //// List<Integer> cityIds = tRegions1.stream().map(TRegion::getId).collect(Collectors.toList()); |
| | | //// List<TRegion> tRegions2 = tRegionService.selectList(new EntityWrapper<TRegion>().in("parent_id", cityIds)); |
| | | //// model.addAttribute("districtList",tRegions2); |
| | | // |
| | | // if(StringUtils.hasLength(area) && StringUtils.hasLength(areaId)){ |
| | | // String[] split = area.split("/"); |
| | | // model.addAttribute("provinceName",split[0]); |
| | | // model.addAttribute("cityName",split[1]); |
| | | // if(split.length>2){ |
| | | // model.addAttribute("districtName",split[2]); |
| | | // }else { |
| | | // model.addAttribute("districtName",""); |
| | | // } |
| | | // |
| | | // model.addAttribute("provinceId",split1[0]); |
| | | // model.addAttribute("cityId",split1[1]); |
| | | // if(split1.length>2) { |
| | | // model.addAttribute("districtId", split1[2]); |
| | | // }else { |
| | | // model.addAttribute("districtId", ""); |
| | | // } |
| | | // |
| | | // List<TRegion> tRegions1 = tRegionService.selectList(new EntityWrapper<TRegion>().eq("parent_id", split1[0])); |
| | | // model.addAttribute("cityList",tRegions1); |
| | | // |
| | | // // 查询区 |
| | | // List<TRegion> tRegions2 = tRegionService.selectList(new EntityWrapper<TRegion>().in("parent_id", split1[1])); |
| | | // model.addAttribute("districtList",tRegions2); |
| | | // }else { |
| | | // model.addAttribute("cityList",new ArrayList<>()); |
| | | // model.addAttribute("districtList",new ArrayList<>()); |
| | | // |
| | | // model.addAttribute("provinceName",""); |
| | | // model.addAttribute("cityName",""); |
| | | // model.addAttribute("districtName",""); |
| | | // |
| | | // model.addAttribute("provinceId",""); |
| | | // model.addAttribute("cityId",""); |
| | | // model.addAttribute("districtId", ""); |
| | | // } |
| | | String[] split1 = areaId.split("/"); |
| | | List<TRegion> tRegions = tRegionService.selectList(new EntityWrapper<TRegion>().eq("parent_id", 0)); |
| | | model.addAttribute("provinceList",tRegions); |
| | |
| | | @RequestMapping(value = "/tAgent/update") |
| | | @ResponseBody |
| | | public Object update(TAgent tAgent) { |
| | | TAgent tAgent1 = tAgentService.selectOne(new EntityWrapper<TAgent>() |
| | | .eq("merchantName", tAgent.getMerchantName())); |
| | | if(null != tAgent1 && tAgent1.getId().compareTo(tAgent.getId()) != 0){ |
| | | return new SuccessTip(500,"该代理商已存在!"); |
| | | } |
| | | User user = userService.selectOne(new EntityWrapper<User>().eq("account", tAgent.getAccount())); |
| | | User user1 = userService.selectOne(new EntityWrapper<User>().eq("role_type", 3).eq("object_id", tAgent.getId())); |
| | | if (null != user && user.getId().compareTo(user1.getId()) != 0){ |
| | | return new SuccessTip(500,"该账号已存在!"); |
| | | } |
| | | tAgent.setPrincipal(tAgent.getPrincipal().replace(" ","")); |
| | | String[] split = tAgent.getAreaId().split("/"); |
| | | // 查询省市 |
| | | // 黑龙江省/大兴安岭地区 |
| | | // 702/852 |
| | | TRegion province = tRegionService.selectById(split[0]); |
| | | tAgent.setProvinceName(province.getName()); |
| | | tAgent.setProvinceCode(province.getCode()); |
| | | TRegion city = tRegionService.selectById(split[1]); |
| | | if(Objects.isNull(city)){ |
| | | city = tRegionService.selectOne(new EntityWrapper<TRegion>() |
| | | .eq("name",split[1]) |
| | | .last("LIMIT 1")); |
| | | } |
| | | tAgent.setCityName(city.getName()); |
| | | tAgent.setCityCode(city.getCode()); |
| | | tAgentService.updateById(tAgent); |
| | | user1.setAccount(tAgent.getAccount()); |
| | | if(ToolUtil.isNotEmpty(tAgent.getPassword())){ |
| | | user1.setPassword(ShiroKit.md5(tAgent.getPassword(), user.getSalt())); |
| | | } |
| | | userService.updateById(user1); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | |
| | | if(0 == settledAmount){ |
| | | return ResultUtil.error("余额不足"); |
| | | } |
| | | |
| | | Double balance = 0D; |
| | | if(roleType == 1){ |
| | | balance = rechargeRecordService.queryCompanyBalance(); |
| | | }else{ |
| | | balance = rechargeRecordService.queryAgentBalance(tAgent.getId()); |
| | | } |
| | | |
| | | SettlementRecord settlementRecord = new SettlementRecord(); |
| | | settlementRecord.setType(roleType == 1 ? 1 : 2); |
| | | if(roleType == 3){ |
| | |
| | | settlementRecord.setOrderNumber(merOrderId1); |
| | | settlementRecord.setArrivalTime(new Date()); |
| | | settlementRecordService.updateById(settlementRecord); |
| | | |
| | | CompanyFundFlow companyFundFlow = new CompanyFundFlow(); |
| | | companyFundFlow.setType(2); |
| | | companyFundFlow.setObjectType(roleType == 1 ? 1 : 2); |
| | | if(roleType == 3){ |
| | | companyFundFlow.setObjectId(tAgent.getId()); |
| | | } |
| | | companyFundFlow.setBalance(new BigDecimal(balance)); |
| | | companyFundFlow.setMoney(new BigDecimal(settlementRecord.getAmount())); |
| | | companyFundFlow.setCreateTime(new Date()); |
| | | companyFundFlowService.insert(companyFundFlow); |
| | | return ResultUtil.success(); |
| | | } |
| | | if(2 == status){ |
| | |
| | | settlementRecord.setOrderNumber(merOrderId1); |
| | | settlementRecord.setArrivalTime(new Date()); |
| | | settlementRecordService.updateById(settlementRecord); |
| | | Integer type = settlementRecord.getType(); |
| | | Double balance = 0D; |
| | | if(type == 1){ |
| | | balance = rechargeRecordService.queryCompanyBalance(); |
| | | }else{ |
| | | balance = rechargeRecordService.queryAgentBalance(settlementRecord.getObjectId()); |
| | | } |
| | | BigDecimal bigDecimal = new BigDecimal(balance).add(new BigDecimal(settlementRecord.getAmount())); |
| | | CompanyFundFlow companyFundFlow = new CompanyFundFlow(); |
| | | companyFundFlow.setType(2); |
| | | companyFundFlow.setObjectType(type); |
| | | if(type == 2){ |
| | | companyFundFlow.setObjectId(settlementRecord.getObjectId()); |
| | | } |
| | | companyFundFlow.setBalance(bigDecimal); |
| | | companyFundFlow.setMoney(new BigDecimal(settlementRecord.getAmount())); |
| | | companyFundFlow.setCreateTime(new Date()); |
| | | companyFundFlowService.insert(companyFundFlow); |
| | | |
| | | response.setStatus(200); |
| | | PrintWriter out = response.getWriter(); |
| | | out.print("OK"); |
| | |
| | | try { |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS"); |
| | | String out_trade_no = sdf.format(new Date()) + UUIDUtil.getNumberRandom(3); |
| | | |
| | | RechargeRecord rechargeRecord = new RechargeRecord(); |
| | | rechargeRecord.setCode(out_trade_no); |
| | | rechargeRecord.setType(4); |
| | |
| | | num++; |
| | | } |
| | | if("1".equals(status1)){//成功 |
| | | Double balance = rechargeRecordService.queryCompanyBalance();//平台余额 |
| | | |
| | | String merOrderId = jsonObject1.getString("merOrderId"); |
| | | rechargeRecord1.setPayTime(new Date()); |
| | | rechargeRecord1.setPayStatus(2); |
| | | rechargeRecord1.setOrderNumber(merOrderId); |
| | | rechargeRecord1.setSurplusDividedAmount(rechargeRecord1.getAmount()); |
| | | rechargeRecordService.updateById(rechargeRecord1); |
| | | |
| | | CompanyFundFlow companyFundFlow = new CompanyFundFlow(); |
| | | companyFundFlow.setType(1); |
| | | companyFundFlow.setObjectType(1); |
| | | companyFundFlow.setBalance(new BigDecimal(balance)); |
| | | companyFundFlow.setMoney(new BigDecimal(rechargeRecord1.getAmount())); |
| | | companyFundFlow.setCreateTime(new Date()); |
| | | companyFundFlowService.insert(companyFundFlow); |
| | | break; |
| | | } |
| | | if("2".equals(status1) || 10 == num){//失败 |
| | |
| | | return; |
| | | } |
| | | if(1 == status){ |
| | | Double balance = rechargeRecordService.queryCompanyBalance();//平台余额 |
| | | String parameter1 = jsonObject.getString("parameter1"); |
| | | RechargeRecord rechargeRecord = rechargeRecordService.selectById(parameter1); |
| | | rechargeRecord.setPayStatus(2); |
| | |
| | | rechargeRecord.setOrderNumber(jsonObject.getString("merOrderId")); |
| | | rechargeRecord.setSurplusDividedAmount(rechargeRecord.getAmount()); |
| | | rechargeRecordService.updateById(rechargeRecord); |
| | | CompanyFundFlow companyFundFlow = new CompanyFundFlow(); |
| | | companyFundFlow.setType(1); |
| | | companyFundFlow.setObjectType(1); |
| | | companyFundFlow.setBalance(new BigDecimal(balance)); |
| | | companyFundFlow.setMoney(new BigDecimal(rechargeRecord.getAmount())); |
| | | companyFundFlow.setCreateTime(new Date()); |
| | | companyFundFlowService.insert(companyFundFlow); |
| | | |
| | | response.setStatus(200); |
| | | PrintWriter out = response.getWriter(); |
| | | out.print("OK"); |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取企业流水 |
| | | * @param type |
| | | * @param time |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/tAgent/queryCompanyFundFlow") |
| | | public Object queryCompanyFundFlow(Integer type, String time){ |
| | | Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); |
| | | List<Map<String, Object>> list = companyFundFlowService.queryCompanyFundFlow(page, type, time); |
| | | page.setRecords(list); |
| | | return super.packForBT(page); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取代理商汇总数据 |
| | | * @param id |
| | | * @param time |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/tAgent/queryAgentSummaryData") |
| | | public Map<String, Object> queryAgentSummaryData(Integer id, String time){ |
| | | return tAgentService.queryAgentSummaryData(id, time); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取代理商明细列表 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/tAgent/queryAgentCompanyFundFlow") |
| | | public Object queryAgentCompanyFundFlow(Integer id){ |
| | | Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); |
| | | List<Map<String, Object>> list = companyFundFlowService.queryAgentCompanyFundFlow(page, id); |
| | | page.setRecords(list); |
| | | return super.packForBT(page); |
| | | } |
| | | } |
| | |
| | | package com.stylefeng.guns.modular.system.controller.general; |
| | | |
| | | import cn.hutool.crypto.SecureUtil; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.stylefeng.guns.core.base.controller.BaseController; |
| | |
| | | |
| | | model.addAttribute("item",tBranchOfficeResp); |
| | | LogObjectHolder.me().set(tBranchOffice); |
| | | |
| | | TSystemConfig tSystemConfig = tSystemConfigService.selectOne(new EntityWrapper<TSystemConfig>().eq("type", 5) |
| | | .eq("companyId", tBranchOfficeId).last("LIMIT 1")); |
| | | if(null != tSystemConfig){ |
| | | JSONObject jsonObject = JSONObject.parseObject(tSystemConfig.getContent()); |
| | | JSONArray array = jsonObject.getJSONArray("ChargeStandard"); |
| | | JSONArray objects = new JSONArray(); |
| | | for (int i = 0; i < array.size(); i++) { |
| | | JSONObject jsonObject1 = JSONObject.parseObject(JSONObject.toJSONString(array.get(i))); |
| | | if(i == 0){ |
| | | jsonObject1.put("key",0); |
| | | }else { |
| | | jsonObject1.put("key",1); |
| | | } |
| | | objects.add(jsonObject1); |
| | | } |
| | | TSystemConfig config = tSystemConfigService.selectOne(new EntityWrapper<TSystemConfig>().eq("type", 8) |
| | | .eq("companyId", tBranchOfficeId).last("LIMIT 1")); |
| | | JSONObject jsonObj = JSONObject.parseObject(config.getContent()); |
| | | Integer zcOne = jsonObj.getInteger("num1"); |
| | | String serviceTel = jsonObj.getString("num2"); |
| | | Integer zcTwo = jsonObj.getInteger("num3"); |
| | | model.addAttribute("zcOne", zcOne); |
| | | model.addAttribute("serviceTel", serviceTel); |
| | | model.addAttribute("zcTwo", zcTwo); |
| | | model.addAttribute("array",objects); |
| | | JSONObject extraCost = JSONObject.parseObject(jsonObject.getString("ExtraCost")); |
| | | model.addAttribute("ExtraCost",extraCost); |
| | | }else{ |
| | | model.addAttribute("zcOne",1); |
| | | model.addAttribute("serviceTel", ""); |
| | | model.addAttribute("zcTwo", 1); |
| | | model.addAttribute("array",null); |
| | | model.addAttribute("ExtraCost",null); |
| | | } |
| | | return PREFIX + "tBranchOffice_edit.html"; |
| | | } |
| | | |
| | |
| | | JSONObject jsonObject = JSONObject.parseObject(tSystemConfig.getContent()); |
| | | model.addAttribute("num2",jsonObject.getInteger("num2")); |
| | | model.addAttribute("num3",jsonObject.getInteger("num3")); |
| | | TSystemConfig tSystemConfig1 = tSystemConfigService.selectOne(new EntityWrapper<TSystemConfig>().eq("type", 5) |
| | | .eq("companyId", tBranchOfficeId).last("LIMIT 1")); |
| | | if(null != tSystemConfig1){ |
| | | JSONObject jsonObject2 = JSONObject.parseObject(tSystemConfig1.getContent()); |
| | | JSONArray array = jsonObject2.getJSONArray("ChargeStandard"); |
| | | JSONArray objects = new JSONArray(); |
| | | for (int i = 0; i < array.size(); i++) { |
| | | JSONObject jsonObject1 = JSONObject.parseObject(JSONObject.toJSONString(array.get(i))); |
| | | if(i == 0){ |
| | | jsonObject1.put("key",0); |
| | | }else { |
| | | jsonObject1.put("key",1); |
| | | } |
| | | objects.add(jsonObject1); |
| | | } |
| | | TSystemConfig config = tSystemConfigService.selectOne(new EntityWrapper<TSystemConfig>().eq("type", 8) |
| | | .eq("companyId", tBranchOfficeId).last("LIMIT 1")); |
| | | JSONObject jsonObj = JSONObject.parseObject(config.getContent()); |
| | | Integer zcOne = jsonObj.getInteger("num1"); |
| | | String serviceTel = jsonObj.getString("num2"); |
| | | Integer zcTwo = jsonObj.getInteger("num3"); |
| | | model.addAttribute("zcOne", zcOne); |
| | | model.addAttribute("serviceTel", serviceTel); |
| | | model.addAttribute("zcTwo", zcTwo); |
| | | model.addAttribute("array",objects); |
| | | JSONObject extraCost = JSONObject.parseObject(jsonObject2.getString("ExtraCost")); |
| | | model.addAttribute("ExtraCost",extraCost); |
| | | }else{ |
| | | model.addAttribute("zcOne",1); |
| | | model.addAttribute("serviceTel", ""); |
| | | model.addAttribute("zcTwo", 1); |
| | | model.addAttribute("array",null); |
| | | model.addAttribute("ExtraCost",null); |
| | | } |
| | | return PREFIX + "tBranchOfficeDetail.html"; |
| | | } |
| | | |
| | |
| | | @RequestMapping(value = "/add") |
| | | @ResponseBody |
| | | @Transactional(rollbackFor = Exception.class,propagation = Propagation.REQUIRES_NEW) |
| | | public Object add(TBranchOffice tBranchOffice) { |
| | | int count = tBranchOfficeService.selectCount(new EntityWrapper<TBranchOffice>().eq("branchOfficeName", tBranchOffice.getBranchOfficeName())); |
| | | public Object add(TBranchOffice tBranchOffice, Integer systemPriceType, String systemPriceContent, Integer isTaxiCar, Integer holiday, String serviceTel) { |
| | | int count = tBranchOfficeService.selectCount(new EntityWrapper<TBranchOffice>().eq("branchOfficeName", tBranchOffice.getBranchOfficeName()).ne("status", 3)); |
| | | if(count>0){ |
| | | return new SuccessTip(500,"该分公司名称已存在!"); |
| | | } |
| | | int count1 = userService.selectCount(new EntityWrapper<User>().eq("account", tBranchOffice.getAccount())); |
| | | int count1 = userService.selectCount(new EntityWrapper<User>().eq("account", tBranchOffice.getAccount()).ne("status", 3)); |
| | | if (count1 > 0){ |
| | | return new SuccessTip(500,"该账号已存在!"); |
| | | } |
| | | |
| | | Object o = tBranchOfficeService.addOrUpdate(tBranchOffice); |
| | | if(Objects.nonNull(o)){ |
| | | return o; |
| | |
| | | user.setName(tBranchOffice.getPrincipal()); |
| | | user.setSex(1); |
| | | userService.insert(user); |
| | | |
| | | //添加价格规则 |
| | | TSystemConfig tSystemConfig = new TSystemConfig(); |
| | | tSystemConfig.setCompanyId(tBranchOffice.getId()); |
| | | tSystemConfig.setType(systemPriceType); |
| | | tSystemConfig.setContent(systemPriceContent); |
| | | tSystemConfigService.insert(tSystemConfig); |
| | | tSystemConfig = new TSystemConfig(); |
| | | tSystemConfig.setType(8); |
| | | tSystemConfig.setCompanyId(tBranchOffice.getId()); |
| | | tSystemConfig.setContent("{\"num1\":" + isTaxiCar + ",\"num2\":\"" + serviceTel + "\",\"num3\":" + holiday + "}"); |
| | | tSystemConfigService.insert(tSystemConfig); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | |
| | | TBranchOffice tBranchOffice = tBranchOfficeService.selectById(tBranchOfficeId); |
| | | tBranchOffice.setStatus(StatusEnum.DELETE.getCode()); |
| | | tBranchOfficeService.updateById(tBranchOffice); |
| | | List<User> users = userService.selectList(new EntityWrapper<User>().eq("role_type", 2).eq("object_id", tBranchOfficeId)); |
| | | for (User user : users) { |
| | | user.setStatus(3); |
| | | userService.updateById(user); |
| | | } |
| | | tSystemConfigService.delete(new EntityWrapper<TSystemConfig>().eq("type", 5).eq("companyId", tBranchOfficeId)); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | |
| | | @RequestMapping(value = "/update") |
| | | @ResponseBody |
| | | @Transactional(rollbackFor = Exception.class,propagation = Propagation.REQUIRES_NEW) |
| | | public Object update(TBranchOffice tBranchOffice) { |
| | | TBranchOffice branchOffice = tBranchOfficeService.selectById(tBranchOffice.getId()); |
| | | public Object update(TBranchOffice tBranchOffice, Integer systemPriceType, String systemPriceContent, Integer holiday, Integer isTaxiCar, String serviceTel) { TBranchOffice branchOffice = tBranchOfficeService.selectById(tBranchOffice.getId()); |
| | | User user = userService.selectOne(new EntityWrapper<User>() |
| | | .eq("role_type", 2) |
| | | .eq("object_id", branchOffice.getId()) |
| | |
| | | }else { |
| | | if (!tBranchOffice.getAccount().equals(user.getAccount())){ |
| | | //判断账号是否已存在 |
| | | int count = userService.selectCount(new EntityWrapper<User>().eq("account", tBranchOffice.getAccount())); |
| | | int count = userService.selectCount(new EntityWrapper<User>().eq("account", tBranchOffice.getAccount()).ne("status", 3)); |
| | | if (count > 0){ |
| | | return new SuccessTip(500,"该账号已存在!"); |
| | | } |
| | |
| | | } |
| | | |
| | | TBranchOffice office = tBranchOfficeService.selectOne(new EntityWrapper<TBranchOffice>().eq("branchOfficeName", tBranchOffice.getBranchOfficeName()) |
| | | .last("LIMIT 1")); |
| | | .ne("status", 3).last("LIMIT 1")); |
| | | if(Objects.nonNull(office) && !tBranchOffice.getId().equals(office.getId())){ |
| | | return new SuccessTip(500,"该分公司名称已存在!"); |
| | | } |
| | |
| | | } |
| | | tBranchOffice.setPrincipal(tBranchOffice.getPrincipal().replace(" ","")); |
| | | tBranchOfficeService.updateById(tBranchOffice); |
| | | |
| | | TSystemConfig tSystemConfig = tSystemConfigService.selectOne(new EntityWrapper<TSystemConfig>().eq("type", 5).eq("companyId", tBranchOffice.getId())); |
| | | if(null == tSystemConfig){ |
| | | tSystemConfig = new TSystemConfig(); |
| | | tSystemConfig.setType(systemPriceType); |
| | | tSystemConfig.setCompanyId(tBranchOffice.getId()); |
| | | tSystemConfig.setContent(systemPriceContent); |
| | | tSystemConfigService.insert(tSystemConfig); |
| | | }else{ |
| | | tSystemConfig.setContent(systemPriceContent); |
| | | tSystemConfigService.updateById(tSystemConfig); |
| | | } |
| | | tSystemConfig = tSystemConfigService.selectOne(new EntityWrapper<TSystemConfig>().eq("type", 8).eq("companyId", tBranchOffice.getId())); |
| | | if(null == tSystemConfig){ |
| | | tSystemConfig = new TSystemConfig(); |
| | | tSystemConfig.setType(8); |
| | | tSystemConfig.setCompanyId(tBranchOffice.getId()); |
| | | tSystemConfig.setContent("{\"num1\":" + isTaxiCar + ",\"num2\":\"" + serviceTel + "\",\"num3\":" + holiday + "}"); |
| | | tSystemConfigService.insert(tSystemConfig); |
| | | }else{ |
| | | tSystemConfig.setContent("{\"num1\":" + isTaxiCar + ",\"num2\":\"" + serviceTel + "\",\"num3\":" + holiday + "}"); |
| | | tSystemConfigService.updateById(tSystemConfig); |
| | | } |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.controller.general; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.stylefeng.guns.core.base.controller.BaseController; |
| | | import com.stylefeng.guns.core.base.tips.ErrorTip; |
| | | import com.stylefeng.guns.core.common.constant.factory.PageFactory; |
| | | import com.stylefeng.guns.core.log.LogObjectHolder; |
| | | import com.stylefeng.guns.core.shiro.ShiroKit; |
| | | import com.stylefeng.guns.core.util.*; |
| | | import com.stylefeng.guns.modular.system.dao.DriverPunishMapper; |
| | | import com.stylefeng.guns.modular.system.dao.DriverTrainMapper; |
| | | import com.stylefeng.guns.modular.system.model.*; |
| | | import com.stylefeng.guns.modular.system.service.*; |
| | | import com.stylefeng.guns.modular.system.util.HttpRequestUtil; |
| | | import com.stylefeng.guns.modular.system.util.PushURL; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | | import org.apache.poi.ss.usermodel.Cell; |
| | | import org.apache.poi.ss.usermodel.Row; |
| | | import org.apache.poi.ss.usermodel.Sheet; |
| | | import org.apache.poi.ss.usermodel.Workbook; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.ui.Model; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | import org.springframework.web.multipart.MultipartHttpServletRequest; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * 控制器 |
| | | * |
| | | * @author fengshuonan |
| | | * @Date 2023-02-20 09:07:06 |
| | | */ |
| | | @Controller |
| | | @RequestMapping("/back-tDriver") |
| | | public class TDriverBackController extends BaseController { |
| | | |
| | | /*private String PREFIX = "/system/tDriver/"; |
| | | |
| | | @Autowired |
| | | private ITDriverService tDriverService; |
| | | |
| | | @Autowired |
| | | private ITCompanyService tCompanyService; |
| | | |
| | | @Autowired |
| | | private ITDriverServiceService tDriverServiceService; |
| | | |
| | | @Autowired |
| | | private ITDriverLineService tDriverLineService; |
| | | |
| | | @Autowired |
| | | private ITLineService itLineService; |
| | | |
| | | @Autowired |
| | | private PushMinistryOfTransportUtil pushMinistryOfTransportUtil; |
| | | |
| | | @Resource |
| | | private DriverTrainMapper driverTrainMapper; |
| | | |
| | | @Resource |
| | | private DriverPunishMapper driverPunishMapper; |
| | | |
| | | @Value("${pushMinistryOfTransport}") |
| | | private boolean pushMinistryOfTransport; |
| | | |
| | | |
| | | |
| | | *//** |
| | | * 跳转到司机审核列表首页 |
| | | *//* |
| | | @RequestMapping("") |
| | | public String index() { |
| | | return PREFIX + "tDriver.html"; |
| | | } |
| | | |
| | | *//** |
| | | * 跳转到审核通过司机首页 |
| | | *//* |
| | | @RequestMapping("/yesDriver") |
| | | public String yesDriver() { |
| | | return PREFIX + "yesDriver.html"; |
| | | } |
| | | |
| | | *//** |
| | | * 跳转到添加司机 |
| | | *//* |
| | | @RequestMapping("/tDriver_add") |
| | | public String tDriverAdd(Model model) { |
| | | List<TCompany> companyList = tCompanyService.selectList(new EntityWrapper<TCompany>().eq("type", 2)); |
| | | model.addAttribute("companyList",companyList); |
| | | |
| | | Integer roleType = ShiroKit.getUser().getRoleType(); |
| | | model.addAttribute("roleType",roleType); |
| | | if (2 == roleType){ |
| | | List<TCompany> franchiseeList = tCompanyService.selectList(new EntityWrapper<TCompany>() |
| | | .eq("type", 3) |
| | | .eq("superiorId",ShiroKit.getUser().getObjectId()) |
| | | .notIn("state",1) |
| | | .notIn("flag",3)); |
| | | model.addAttribute("franchiseeList",franchiseeList); |
| | | }else{ |
| | | model.addAttribute("franchiseeList",null); |
| | | } |
| | | //查询当前用户所属分公司/加盟商 |
| | | model.addAttribute("objectName",tCompanyService.selectById(ShiroKit.getUser().getObjectId()).getName()); |
| | | |
| | | //查询线路列表 |
| | | List<TLine> lineList = itLineService.selectList(new EntityWrapper<TLine>().eq("state", 1)); |
| | | model.addAttribute("lineList",lineList); |
| | | return PREFIX + "tDriver_add.html"; |
| | | } |
| | | |
| | | *//** |
| | | * 跳转到修改审核司机 |
| | | *//* |
| | | @RequestMapping("/tDriver_immediately/{tDriverId}") |
| | | public String tDriver_immediately(@PathVariable Integer tDriverId, Model model) { |
| | | Map<String, Object> tDriver = tDriverService.getDriverById(tDriverId); |
| | | model.addAttribute("item",tDriver); |
| | | LogObjectHolder.me().set(tDriver); |
| | | return PREFIX + "tDriver_immediately.html"; |
| | | } |
| | | |
| | | *//** |
| | | * 跳转到选择车辆页面 |
| | | *//* |
| | | @RequestMapping("/tDriver_changeCar/{tDriverId}") |
| | | public String tDriver_changeCar(@PathVariable Integer tDriverId, Model model) { |
| | | model.addAttribute("tDriverId",tDriverId); |
| | | return PREFIX + "tDriver_changeCar.html"; |
| | | } |
| | | |
| | | *//** |
| | | * 跳转到冻结/解冻司机页面 |
| | | *//* |
| | | @RequestMapping("/tDriver_optDriver/{tDriverId}/{optType}") |
| | | public String tDriver_optDriver(@PathVariable Integer tDriverId,@PathVariable Integer optType, Model model) { |
| | | model.addAttribute("tDriverId",tDriverId); |
| | | model.addAttribute("optType",optType); |
| | | return PREFIX + "tDriver_optDriver.html"; |
| | | } |
| | | |
| | | *//** |
| | | * 跳转到查看司机详情 |
| | | *//* |
| | | @RequestMapping("/tDriver_look/{tDriverId}") |
| | | public String tDriver_look(@PathVariable Integer tDriverId, Model model) { |
| | | Map<String, Object> tDriver = tDriverService.getDriverById(tDriverId); |
| | | model.addAttribute("item",tDriver); |
| | | LogObjectHolder.me().set(tDriver); |
| | | return PREFIX + "tDriver_look.html"; |
| | | } |
| | | |
| | | *//** |
| | | * 跳转到修改司机 |
| | | *//* |
| | | @RequestMapping("/tDriver_update/{tDriverId}") |
| | | public String tDriverUpdate(@PathVariable Integer tDriverId, Model model) { |
| | | TDriver tDriver = tDriverService.selectById(tDriverId); |
| | | model.addAttribute("item",tDriver); |
| | | LogObjectHolder.me().set(tDriver); |
| | | |
| | | Integer roleType = ShiroKit.getUser().getRoleType(); |
| | | model.addAttribute("roleType",roleType); |
| | | model.addAttribute("objectName",tCompanyService.selectById(ShiroKit.getUser().getObjectId()).getName()); |
| | | |
| | | if (1 == roleType){ |
| | | List<TCompany> companyList = tCompanyService.selectList(new EntityWrapper<TCompany>().eq("type", 2)); |
| | | model.addAttribute("companyList",companyList); |
| | | List<TCompany> franchiseeList = tCompanyService.selectList(new EntityWrapper<TCompany>().eq("type", 3).eq("superiorId",tDriver.getCompanyId())); |
| | | model.addAttribute("franchiseeList",franchiseeList); |
| | | }else if (2 == roleType){ |
| | | List<TCompany> franchiseeList = tCompanyService.selectList(new EntityWrapper<TCompany>().eq("type", 3).eq("superiorId",ShiroKit.getUser().getObjectId())); |
| | | model.addAttribute("franchiseeList",franchiseeList); |
| | | } |
| | | |
| | | //查询平台ID |
| | | TCompany company = tCompanyService.selectOne(new EntityWrapper<TCompany>().eq("type", 1)); |
| | | //判断是平台司机还是加盟司机 |
| | | if ((SinataUtil.isEmpty(tDriver.getCompanyId()) || tDriver.getCompanyId() == 0 || tDriver.getCompanyId() == company.getId()) && (SinataUtil.isEmpty(tDriver.getFranchiseeId()) || tDriver.getFranchiseeId() == 0)){ |
| | | model.addAttribute("companyType",1); |
| | | }else{ |
| | | model.addAttribute("companyType",2); |
| | | } |
| | | |
| | | //获取经营业务 |
| | | List<TDriverService> serviceList = tDriverServiceService.selectList(new EntityWrapper<TDriverService>().eq("driverId", tDriverId)); |
| | | Integer one = 1; |
| | | Integer two = 1; |
| | | Integer three = 1; |
| | | Integer four = 1; |
| | | Integer five = 1; |
| | | Integer six = 1; |
| | | for (TDriverService obj : serviceList){ |
| | | if (obj.getType() == 1){ |
| | | one = 2; |
| | | } |
| | | if (obj.getType() == 2){ |
| | | two = 2; |
| | | } |
| | | if (obj.getType() == 3){ |
| | | three = 2; |
| | | } |
| | | if (obj.getType() == 4){ |
| | | four = 2; |
| | | } |
| | | if (obj.getType() == 5){ |
| | | five = 2; |
| | | } |
| | | if (obj.getType() == 6){ |
| | | six = 2; |
| | | } |
| | | } |
| | | model.addAttribute("one",one); |
| | | model.addAttribute("two",two); |
| | | model.addAttribute("three",three); |
| | | model.addAttribute("four",four); |
| | | model.addAttribute("five",five); |
| | | model.addAttribute("six",six); |
| | | |
| | | //查询线路列表 |
| | | List<TLine> lineList = itLineService.selectList(new EntityWrapper<TLine>().eq("state", 1)); |
| | | model.addAttribute("lineList",lineList); |
| | | //查询驾驶员已添加的线路列表 |
| | | List<Map<String, Object>> driverLineList = tDriverLineService.getDriverLineListByDriverId(tDriverId); |
| | | model.addAttribute("driverLineList",driverLineList); |
| | | return PREFIX + "tDriver_edit.html"; |
| | | } |
| | | |
| | | *//** |
| | | * 跳转到添加培训页 |
| | | * @param id |
| | | * @param model |
| | | * @return |
| | | *//* |
| | | @RequestMapping("/showTraining") |
| | | public String showTraining(Integer id, Model model){ |
| | | model.addAttribute("id", id); |
| | | return PREFIX + "training.html"; |
| | | } |
| | | |
| | | |
| | | *//** |
| | | * 保存培训数据 |
| | | * @param train |
| | | * @param driverId |
| | | * @return |
| | | *//* |
| | | @ResponseBody |
| | | @RequestMapping(value = "/saveTrain", method = RequestMethod.POST) |
| | | public ResultUtil saveTrain(String train, Integer driverId){ |
| | | if(ToolUtil.isEmpty(train)){ |
| | | return ResultUtil.error("请添加有效的培训记录"); |
| | | } |
| | | String[] split = train.split(","); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| | | try { |
| | | List<DriverTrain> update = new ArrayList<>(); |
| | | List<DriverTrain> add = new ArrayList<>(); |
| | | for(String s : split){ |
| | | String[] s1 = s.split("_"); |
| | | if(ToolUtil.isNotEmpty(s1[0])){//修改 |
| | | DriverTrain driverTrain = driverTrainMapper.selectById(s1[0]); |
| | | driverTrain.setDriverId(driverId); |
| | | driverTrain.setCourseName(s1[1]); |
| | | driverTrain.setCourseDate(sdf.parse(s1[2])); |
| | | driverTrain.setStartTime(s1[3]); |
| | | driverTrain.setStopTime(s1[4]); |
| | | driverTrain.setDuration(Integer.valueOf(s1[5])); |
| | | update.add(driverTrain); |
| | | }else{//添加 |
| | | DriverTrain driverTrain = new DriverTrain(); |
| | | driverTrain.setDriverId(driverId); |
| | | driverTrain.setCourseName(s1[1]); |
| | | driverTrain.setCourseDate(sdf.parse(s1[2])); |
| | | driverTrain.setStartTime(s1[3]); |
| | | driverTrain.setStopTime(s1[4]); |
| | | driverTrain.setDuration(Integer.valueOf(s1[5])); |
| | | add.add(driverTrain); |
| | | } |
| | | } |
| | | List<DriverTrain> driverTrains = driverTrainMapper.queryAllTrain(driverId); |
| | | for(DriverTrain driverTrain : driverTrains){ |
| | | boolean b = true; |
| | | for(String s : split){ |
| | | String[] s1 = s.split("_"); |
| | | if(ToolUtil.isNotEmpty(s1[0]) && driverTrain.getId() == Integer.valueOf(s1[0])){ |
| | | b = false; |
| | | break; |
| | | } |
| | | } |
| | | if(b){ |
| | | driverTrainMapper.deleteById(driverTrain.getId()); |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | if(pushMinistryOfTransport){//上传数据 |
| | | pushMinistryOfTransportUtil.baseInfoDriverEducate(driverTrain.getId(), 3); |
| | | } |
| | | } |
| | | }).start(); |
| | | } |
| | | } |
| | | if(update.size() > 0){ |
| | | for(DriverTrain driverTrain : update){ |
| | | driverTrainMapper.updateById(driverTrain); |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | if(pushMinistryOfTransport){//上传数据 |
| | | pushMinistryOfTransportUtil.baseInfoDriverEducate(driverTrain.getId(), 2); |
| | | } |
| | | } |
| | | }).start(); |
| | | } |
| | | } |
| | | if(add.size() > 0){ |
| | | for(DriverTrain driverTrain : add){ |
| | | driverTrainMapper.insert(driverTrain); |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | if(pushMinistryOfTransport){//上传数据 |
| | | pushMinistryOfTransportUtil.baseInfoDriverEducate(driverTrain.getId(), 1); |
| | | } |
| | | } |
| | | }).start(); |
| | | } |
| | | } |
| | | |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | | *//** |
| | | * 获取司机的所有培训数据 |
| | | * @param driverId |
| | | * @return |
| | | *//* |
| | | @ResponseBody |
| | | @RequestMapping(value = "/queryAllTrain", method = RequestMethod.POST) |
| | | public ResultUtil queryAllTrain(Integer driverId){ |
| | | List<DriverTrain> driverTrains = driverTrainMapper.queryAllTrain(driverId); |
| | | return ResultUtil.success(driverTrains); |
| | | } |
| | | |
| | | |
| | | *//** |
| | | * 跳转到处罚页 |
| | | * @param id |
| | | * @param model |
| | | * @return |
| | | *//* |
| | | @RequestMapping("/showPunish") |
| | | public String showPunish(Integer id, Model model){ |
| | | model.addAttribute("id", id); |
| | | return PREFIX + "punish.html"; |
| | | } |
| | | |
| | | |
| | | *//** |
| | | * 保存处罚数据 |
| | | * @param punish |
| | | * @param driverId |
| | | * @return |
| | | *//* |
| | | @ResponseBody |
| | | @RequestMapping(value = "/savePunish", method = RequestMethod.POST) |
| | | public ResultUtil savePunish(String punish, Integer driverId){ |
| | | if(ToolUtil.isEmpty(punish)){ |
| | | return ResultUtil.error("请添加有效的培训记录"); |
| | | } |
| | | String[] split = punish.split(","); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| | | try { |
| | | List<DriverPunish> update = new ArrayList<>(); |
| | | List<DriverPunish> add = new ArrayList<>(); |
| | | for(String s : split){ |
| | | String[] s1 = s.split("_"); |
| | | if(ToolUtil.isNotEmpty(s1[0])){//修改 |
| | | DriverPunish driverPunish = driverPunishMapper.selectById(s1[0]); |
| | | driverPunish.setDriverId(driverId); |
| | | driverPunish.setPunishTime(sdf.parse(s1[1])); |
| | | driverPunish.setPunishReason(s1[2]); |
| | | driverPunish.setPunishReault(s1[3]); |
| | | update.add(driverPunish); |
| | | }else{//添加 |
| | | DriverPunish driverPunish = new DriverPunish(); |
| | | driverPunish.setDriverId(driverId); |
| | | driverPunish.setPunishTime(sdf.parse(s1[1])); |
| | | driverPunish.setPunishReason(s1[2]); |
| | | driverPunish.setPunishReault(s1[3]); |
| | | add.add(driverPunish); |
| | | } |
| | | } |
| | | List<DriverPunish> driverPunishes = driverPunishMapper.queryAllPunish(driverId); |
| | | for(DriverPunish driverTrain : driverPunishes){ |
| | | boolean b = true; |
| | | for(String s : split){ |
| | | String[] s1 = s.split("_"); |
| | | if(ToolUtil.isNotEmpty(s1[0]) && driverTrain.getId() == Integer.valueOf(s1[0])){ |
| | | b = false; |
| | | break; |
| | | } |
| | | } |
| | | if(b){ |
| | | driverTrainMapper.deleteById(driverTrain.getId()); |
| | | } |
| | | } |
| | | if(update.size() > 0){ |
| | | for(DriverPunish driverTrain : update){ |
| | | driverPunishMapper.updateById(driverTrain); |
| | | } |
| | | } |
| | | if(add.size() > 0){ |
| | | for(DriverPunish driverTrain : add){ |
| | | driverPunishMapper.insert(driverTrain); |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | if(pushMinistryOfTransport){//上传数据 |
| | | pushMinistryOfTransportUtil.ratedDriverPunish(driverTrain.getId()); |
| | | } |
| | | } |
| | | }).start(); |
| | | } |
| | | } |
| | | |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | | |
| | | *//** |
| | | * 获取所有处罚数据 |
| | | * @param driverId |
| | | * @return |
| | | *//* |
| | | @ResponseBody |
| | | @RequestMapping(value = "/queryAllPunish", method = RequestMethod.POST) |
| | | public ResultUtil queryAllPunish(Integer driverId){ |
| | | List<DriverPunish> driverPunishes = driverPunishMapper.queryAllPunish(driverId); |
| | | return ResultUtil.success(driverPunishes); |
| | | } |
| | | |
| | | |
| | | *//** |
| | | * 根据分公司ID获取加盟商 |
| | | * @param oneId |
| | | * @return |
| | | *//* |
| | | @RequestMapping(value = "/oneChange") |
| | | @ResponseBody |
| | | public Object oneChange(@RequestParam Integer oneId) { |
| | | List<TCompany> list = new ArrayList<>(); |
| | | if (SinataUtil.isNotEmpty(oneId)){ |
| | | list = tCompanyService.selectList(new EntityWrapper<TCompany>() |
| | | .eq("type", 3) |
| | | .eq("superiorId", oneId) |
| | | .notIn("flag",3) |
| | | .notIn("state",1)); |
| | | } |
| | | return list; |
| | | } |
| | | |
| | | *//** |
| | | * 获取司机审核列表列表 |
| | | *//* |
| | | @RequestMapping(value = "/list") |
| | | @ResponseBody |
| | | public Object list(String insertTime, |
| | | String companyName, |
| | | String phone, |
| | | String account, |
| | | Integer addType, |
| | | Integer authState) { |
| | | String beginTime = null; |
| | | String endTime = null; |
| | | if (SinataUtil.isNotEmpty(insertTime)){ |
| | | String[] timeArray = insertTime.split(" - "); |
| | | beginTime = timeArray[0]; |
| | | endTime = timeArray[1]; |
| | | } |
| | | Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); |
| | | if (ShiroKit.getUser().getRoleType() != 1){ |
| | | page.setRecords(null); |
| | | }else{ |
| | | page.setRecords(tDriverService.getAuthDriverList(page,beginTime,endTime,companyName,phone,account,addType,authState)); |
| | | } |
| | | return super.packForBT(page); |
| | | } |
| | | |
| | | *//** |
| | | * 获取审核通过的司机列表 |
| | | *//* |
| | | @RequestMapping(value = "/listYesDriver") |
| | | @ResponseBody |
| | | public Object listYesDriver(String insertTime, |
| | | String companyName, |
| | | String phone, |
| | | String name, |
| | | Integer addType, |
| | | Integer authState) { |
| | | String beginTime = null; |
| | | String endTime = null; |
| | | if (SinataUtil.isNotEmpty(insertTime)){ |
| | | String[] timeArray = insertTime.split(" - "); |
| | | beginTime = timeArray[0]; |
| | | endTime = timeArray[1]; |
| | | } |
| | | Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); |
| | | page.setRecords(tDriverService.getDriverList(page,ShiroKit.getUser().getRoleType(),ShiroKit.getUser().getObjectId(),beginTime,endTime,companyName,phone,name,addType,authState)); |
| | | return super.packForBT(page); |
| | | } |
| | | |
| | | *//** |
| | | * 获取可被选择的车辆列表 |
| | | *//* |
| | | @RequestMapping(value = "/selectCarList/{tDriverId}") |
| | | @ResponseBody |
| | | public Object selectCarList(@PathVariable Integer tDriverId, |
| | | String carLicensePlate, |
| | | String brandName, |
| | | String modelName, |
| | | String color, |
| | | String serverStr) { |
| | | TDriver driver = tDriverService.selectById(tDriverId); |
| | | *//*String useCarIdStr = null; |
| | | //查询已被使用的车辆ID |
| | | if (SinataUtil.isNotEmpty(driver.getCarId())){ |
| | | useCarIdStr = tDriverService.getUseCarIdStr(driver.getCarId()); |
| | | }else{ |
| | | useCarIdStr = tDriverService.getUseCarIdStr(null); |
| | | }*//* |
| | | //2020-08-21:新需求,已被绑定的车辆可以被继续绑定 |
| | | Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); |
| | | page.setRecords(tDriverService.getCanSelectCarList(page,ShiroKit.getUser().getRoleType(),ShiroKit.getUser().getObjectId(),null,carLicensePlate,brandName,modelName,color,serverStr)); |
| | | return super.packForBT(page); |
| | | |
| | | } |
| | | |
| | | *//** |
| | | * 审核操作 1=通过 2=不通过 |
| | | *//* |
| | | @RequestMapping(value = "/authOpt") |
| | | @ResponseBody |
| | | public Object authOpt(Integer id,Integer authState) { |
| | | if (SinataUtil.isNotEmpty(id) && SinataUtil.isNotEmpty(authState)){ |
| | | TDriver tDriver = tDriverService.selectById(id); |
| | | Integer type = 0; |
| | | if (1 == authState){ |
| | | type = 5; |
| | | tDriver.setAuthState(2); |
| | | |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | if(pushMinistryOfTransport){//上传数据 |
| | | pushMinistryOfTransportUtil.baseInfoCompanyStat(); |
| | | pushMinistryOfTransportUtil.baseInfoDriver(id); |
| | | pushMinistryOfTransportUtil.baseInfoDriverApp(id); |
| | | } |
| | | } |
| | | }).start(); |
| | | }else{ |
| | | type = 6; |
| | | tDriver.setAuthState(4); |
| | | } |
| | | |
| | | Map<String,String> map = new HashMap<>(); |
| | | map.put("uid", String.valueOf(tDriver.getId())); |
| | | map.put("type", String.valueOf(type)); |
| | | String result = HttpRequestUtil.postRequest(PushURL.driver_auth_url, map); |
| | | System.out.println("司机注册审核发送短信 :【driverId="+tDriver.getId().toString()+"】,调用接口:"+result); |
| | | |
| | | tDriverService.updateById(tDriver); |
| | | } |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | *//** |
| | | * 更换车辆操作 |
| | | *//* |
| | | @RequestMapping(value = "/selectCarOpt") |
| | | @ResponseBody |
| | | public Object selectCarOpt(Integer tDriverId,Integer carId) { |
| | | if (SinataUtil.isNotEmpty(tDriverId) && SinataUtil.isNotEmpty(carId)){ |
| | | TDriver tDriver = tDriverService.selectById(tDriverId); |
| | | tDriver.setCarId(carId); |
| | | tDriverService.updateById(tDriver); |
| | | } |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | *//** |
| | | * 新增司机审核列表 |
| | | *//* |
| | | @RequestMapping(value = "/add") |
| | | @ResponseBody |
| | | public Object add(TDriver tDriver,@RequestParam String serverBox,@RequestParam String lineStr,Integer roleType,Integer companyType,Integer oneId,Integer twoId,Integer franchiseeId) { |
| | | //判断登录账户是否重复 |
| | | int count = tDriverService.selectCount(new EntityWrapper<TDriver>().eq("phone", tDriver.getPhone()).in("authState", "1,2,3").ne("flag", 3)); |
| | | if (count > 0){ |
| | | return "error"; |
| | | } |
| | | if (1 == roleType){ //平台 |
| | | if (2 == companyType.intValue()){ |
| | | if (SinataUtil.isNotEmpty(oneId)){ |
| | | tDriver.setCompanyId(oneId); |
| | | } |
| | | if (SinataUtil.isNotEmpty(twoId)){ |
| | | tDriver.setFranchiseeId(twoId); |
| | | } |
| | | }else if (1 == companyType.intValue()){ |
| | | TCompany company = tCompanyService.selectOne(new EntityWrapper<TCompany>().eq("type", 1)); |
| | | tDriver.setCompanyId(company.getId()); |
| | | tDriver.setFranchiseeId(franchiseeId); |
| | | } |
| | | tDriver.setAddType(2); |
| | | tDriver.setIsPlatCar(1); |
| | | tDriver.setAuthState(2); |
| | | }else if (2 == roleType){ //分公司 |
| | | if (SinataUtil.isNotEmpty(ShiroKit.getUser().getObjectId())){ |
| | | tDriver.setCompanyId(ShiroKit.getUser().getObjectId()); |
| | | } |
| | | if (SinataUtil.isNotEmpty(franchiseeId)){ |
| | | tDriver.setFranchiseeId(franchiseeId); |
| | | } |
| | | tDriver.setAddType(3); |
| | | tDriver.setIsPlatCar(2); |
| | | tDriver.setAuthState(1); |
| | | tDriver.setAddObjectId(ShiroKit.getUser().getObjectId()); |
| | | }else if (3 == roleType){ //加盟商 |
| | | TCompany tCompany = tCompanyService.selectById(ShiroKit.getUser().getObjectId()); |
| | | if (SinataUtil.isNotEmpty(tCompany)){ |
| | | tDriver.setCompanyId(tCompany.getSuperiorId()); |
| | | } |
| | | if (SinataUtil.isNotEmpty(ShiroKit.getUser().getObjectId())){ |
| | | tDriver.setFranchiseeId(ShiroKit.getUser().getObjectId()); |
| | | } |
| | | tDriver.setAddType(4); |
| | | tDriver.setIsPlatCar(2); |
| | | tDriver.setAuthState(1); |
| | | tDriver.setAddObjectId(ShiroKit.getUser().getObjectId()); |
| | | } |
| | | tDriver.setInsertTime(new Date()); |
| | | tDriver.setInsertUser(ShiroKit.getUser().getId()); |
| | | // tDriver.setPassword(MD5Util.encrypt(tDriver.getPassword())); |
| | | |
| | | tDriver.setPassword(ShiroKit.md5(tDriver.getPassword(), "SA;d5#")); |
| | | |
| | | tDriverService.insert(tDriver); |
| | | |
| | | //添加经营业务 |
| | | String[] serverArray = serverBox.split(","); |
| | | for (int i=0;i<serverArray.length;i++){ |
| | | TDriverService service = new TDriverService(); |
| | | service.setDriverId(tDriver.getId()); |
| | | service.setType(Integer.valueOf(serverArray[i])); |
| | | tDriverServiceService.insert(service); |
| | | |
| | | if (3 == Integer.valueOf(serverArray[i])){ |
| | | //添加线路 |
| | | if (SinataUtil.isNotEmpty(lineStr)){ |
| | | addLine(lineStr,tDriver.getId()); |
| | | } |
| | | } |
| | | } |
| | | |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | *//** |
| | | * 添加线路 |
| | | * @param subArr |
| | | * @param id |
| | | *//* |
| | | public void addLine(String subArr,Integer id){ |
| | | JSONArray jsonArray = JSON.parseArray(subArr); |
| | | int size = jsonArray.size(); |
| | | for (int i = 0; i < size; i++){ |
| | | JSONObject jsonObject = jsonArray.getJSONObject(i); |
| | | TDriverLine line = new TDriverLine(); |
| | | line.setCreateTime(new Date()); |
| | | line.setAddTime(jsonObject.getString("time")); |
| | | line.setLineId(jsonObject.getInteger("lineId")); |
| | | line.setDriverId(id); |
| | | tDriverLineService.insert(line); |
| | | } |
| | | } |
| | | |
| | | |
| | | *//** |
| | | * 删除司机审核列表 |
| | | *//* |
| | | @RequestMapping(value = "/delete") |
| | | @ResponseBody |
| | | public Object delete(@RequestParam Integer tDriverId) { |
| | | TDriver driver = tDriverService.selectById(tDriverId); |
| | | driver.setFlag("3"); |
| | | tDriverService.updateById(driver); |
| | | return SUCCESS_TIP; |
| | | } |
| | | *//** |
| | | * 操作司机状态 |
| | | *//* |
| | | @RequestMapping(value = "/optDriver") |
| | | @ResponseBody |
| | | public Object optDriver(@RequestParam Integer driverId,@RequestParam String remark,@RequestParam Integer optType) { |
| | | if (SinataUtil.isNotEmpty(driverId) && SinataUtil.isNotEmpty(optType)){ |
| | | TDriver tDriver = tDriverService.selectById(driverId); |
| | | if (1 == optType){ //解冻 |
| | | tDriver.setAuthState(2); |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | if(pushMinistryOfTransport){//上传数据 |
| | | pushMinistryOfTransportUtil.baseInfoCompanyStat(); |
| | | pushMinistryOfTransportUtil.baseInfoDriver(driverId); |
| | | } |
| | | } |
| | | }).start(); |
| | | }else if (2 == optType){ //冻结 |
| | | tDriver.setAuthState(3); |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | if(pushMinistryOfTransport){//上传数据 |
| | | pushMinistryOfTransportUtil.baseInfoCompanyStat(); |
| | | pushMinistryOfTransportUtil.baseInfoDriver(driverId); |
| | | } |
| | | } |
| | | }).start(); |
| | | } |
| | | tDriver.setRemark(remark); |
| | | tDriverService.updateById(tDriver); |
| | | } |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | *//** |
| | | * 修改司机审核列表 |
| | | *//* |
| | | @RequestMapping(value = "/update") |
| | | @ResponseBody |
| | | public Object update(TDriver tDriver,@RequestParam String serverBox,@RequestParam String lineStr,Integer roleType,Integer companyType,Integer oneId,Integer twoId,Integer franchiseeId) { |
| | | TDriver obj = tDriverService.selectById(tDriver.getId()); |
| | | if (!obj.getPhone().equals(tDriver.getPhone())){ |
| | | //判断登录账户是否重复 |
| | | int count = tDriverService.selectCount(new EntityWrapper<TDriver>().eq("phone", tDriver.getPhone()).in("authState", "1,2,3")); |
| | | if (count > 0){ |
| | | return "error"; |
| | | } |
| | | } |
| | | if (1 == roleType){ //平台 |
| | | if (2 == companyType.intValue()){ |
| | | if (SinataUtil.isNotEmpty(oneId)){ |
| | | tDriver.setCompanyId(oneId); |
| | | } |
| | | if (SinataUtil.isNotEmpty(twoId)){ |
| | | tDriver.setFranchiseeId(twoId); |
| | | } |
| | | }else if (1 == companyType.intValue()){ |
| | | TCompany company = tCompanyService.selectOne(new EntityWrapper<TCompany>().eq("type", 1)); |
| | | tDriver.setCompanyId(company.getId()); |
| | | tDriver.setFranchiseeId(franchiseeId); |
| | | } |
| | | }else if (2 == roleType){ //分公司 |
| | | if (SinataUtil.isNotEmpty(ShiroKit.getUser().getObjectId())){ |
| | | tDriver.setCompanyId(ShiroKit.getUser().getObjectId()); |
| | | } |
| | | if (SinataUtil.isNotEmpty(franchiseeId)){ |
| | | tDriver.setFranchiseeId(franchiseeId); |
| | | } |
| | | }else if (3 == roleType){ //加盟商 |
| | | TCompany tCompany = tCompanyService.selectById(ShiroKit.getUser().getObjectId()); |
| | | if (SinataUtil.isNotEmpty(tCompany)){ |
| | | tDriver.setCompanyId(tCompany.getSuperiorId()); |
| | | } |
| | | if (SinataUtil.isNotEmpty(ShiroKit.getUser().getObjectId())){ |
| | | tDriver.setFranchiseeId(ShiroKit.getUser().getObjectId()); |
| | | } |
| | | } |
| | | tDriver.setUpdateTime(new Date()); |
| | | tDriver.setUpdateUser(ShiroKit.getUser().getId()); |
| | | // tDriver.setPassword(MD5Util.encrypt(tDriver.getPassword())); |
| | | tDriver.setPassword(ShiroKit.md5(tDriver.getPassword(), "SA;d5#")); |
| | | tDriverService.updateById(tDriver); |
| | | |
| | | //删除业务 |
| | | tDriverServiceService.delete(new EntityWrapper<TDriverService>().eq("driverId",tDriver.getId())); |
| | | |
| | | //删除线路 |
| | | tDriverLineService.delete(new EntityWrapper<TDriverLine>().eq("driverId",tDriver.getId())); |
| | | |
| | | //添加经营业务 |
| | | String[] serverArray = serverBox.split(","); |
| | | for (int i=0;i<serverArray.length;i++){ |
| | | TDriverService service = new TDriverService(); |
| | | service.setDriverId(tDriver.getId()); |
| | | service.setType(Integer.valueOf(serverArray[i])); |
| | | tDriverServiceService.insert(service); |
| | | |
| | | if (3 == Integer.valueOf(serverArray[i])){ |
| | | //添加线路 |
| | | if (SinataUtil.isNotEmpty(lineStr)){ |
| | | addLine(lineStr,tDriver.getId()); |
| | | } |
| | | } |
| | | } |
| | | |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | if(pushMinistryOfTransport){//上传数据 |
| | | pushMinistryOfTransportUtil.baseInfoDriver(tDriver.getId()); |
| | | } |
| | | } |
| | | }).start(); |
| | | |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | *//** |
| | | * 下载模板 |
| | | * @param request |
| | | * @param response |
| | | *//* |
| | | @RequestMapping(value = "/uploadDriverModel") |
| | | public void uploadDriverModel(HttpServletRequest request, HttpServletResponse response) { |
| | | // 表格数据【封装】 |
| | | List<List<String>> dataList = new ArrayList<List<String>>(); |
| | | |
| | | String title = ""; |
| | | |
| | | // 首行【封装】 |
| | | List<String> shellList = new ArrayList<String>(); |
| | | if (ShiroKit.getUser().getRoleType() == 1){ |
| | | title = "平台导入司机模板"; |
| | | |
| | | shellList.add("司机名称"); |
| | | shellList.add("所属机构[平台司机/加盟司机]"); |
| | | shellList.add("所属分公司[提示:加盟司机选填]"); |
| | | shellList.add("所属加盟商[提示:加盟司机选填]"); |
| | | shellList.add("性别[男/女]"); |
| | | shellList.add("驾驶证号码"); |
| | | shellList.add("驾龄"); |
| | | shellList.add("身份证号"); |
| | | shellList.add("居住地址"); |
| | | shellList.add("出租车资格证号"); |
| | | shellList.add("工号[选填]"); |
| | | shellList.add("经营业务:专车[是/否]"); |
| | | shellList.add("经营业务:出租车[是/否]"); |
| | | shellList.add("经营业务:跨城出行[是/否]"); |
| | | shellList.add("经营业务:小件同城物流[是/否]"); |
| | | shellList.add("经营业务:小件跨城物流[是/否]"); |
| | | shellList.add("经营业务:包车[是/否]"); |
| | | shellList.add("登录账号[手机号]"); |
| | | shellList.add("登录密码[密码长度为6-18]"); |
| | | }else if (ShiroKit.getUser().getRoleType() == 2){ |
| | | title = "分公司导入司机模板"; |
| | | |
| | | shellList.add("司机名称"); |
| | | shellList.add("所属加盟商[选填]"); |
| | | shellList.add("性别[男/女]"); |
| | | shellList.add("驾驶证号码"); |
| | | shellList.add("驾龄"); |
| | | shellList.add("身份证号"); |
| | | shellList.add("居住地址"); |
| | | shellList.add("出租车资格证号"); |
| | | shellList.add("工号[选填]"); |
| | | shellList.add("经营业务:专车[是/否]"); |
| | | shellList.add("经营业务:出租车[是/否]"); |
| | | shellList.add("经营业务:跨城出行[是/否]"); |
| | | shellList.add("经营业务:小件同城物流[是/否]"); |
| | | shellList.add("经营业务:小件跨城物流[是/否]"); |
| | | shellList.add("经营业务:包车[是/否]"); |
| | | shellList.add("登录账号[手机号]"); |
| | | shellList.add("登录密码[密码长度为6-18]"); |
| | | }else if (ShiroKit.getUser().getRoleType() == 3){ |
| | | title = "加盟商导入司机模板"; |
| | | |
| | | shellList.add("司机名称"); |
| | | shellList.add("性别[男/女]"); |
| | | shellList.add("驾驶证号码"); |
| | | shellList.add("驾龄"); |
| | | shellList.add("身份证号"); |
| | | shellList.add("居住地址"); |
| | | shellList.add("出租车资格证号"); |
| | | shellList.add("工号[选填]"); |
| | | shellList.add("经营业务:专车[是/否]"); |
| | | shellList.add("经营业务:出租车[是/否]"); |
| | | shellList.add("经营业务:跨城出行[是/否]"); |
| | | shellList.add("经营业务:小件同城物流[是/否]"); |
| | | shellList.add("经营业务:小件跨城物流[是/否]"); |
| | | shellList.add("经营业务:包车[是/否]"); |
| | | shellList.add("登录账号[手机号]"); |
| | | shellList.add("登录密码[密码长度为6-18]"); |
| | | } |
| | | dataList.add(shellList); |
| | | |
| | | try { |
| | | // 调用工具类进行导出 |
| | | ExcelExportUtil.easySheet(title+DateUtil.formatDate(new Date(), "YYYYMMddHHmmss"), title, dataList, request, response); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | *//** |
| | | * 导入操作 |
| | | * @param request |
| | | * @return |
| | | *//* |
| | | @RequestMapping(value="/exportDriver",method = RequestMethod.POST) |
| | | @ResponseBody |
| | | public Object exportDriver(HttpServletRequest request){ |
| | | MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request; |
| | | MultipartFile file = (MultipartFile) multipartRequest.getFile("myfile"); |
| | | try { |
| | | if (ShiroKit.getUser().getRoleType() == 1){ |
| | | Workbook book = WoUtil.ImportFile(file); |
| | | Sheet sh = book.getSheetAt(0); //获取到第一个表 |
| | | for (int i = 1; i <= sh.getLastRowNum(); i++) { |
| | | Row row = sh.getRow(i); |
| | | |
| | | Cell cell0 = row.getCell(0); //司机名称 |
| | | String zero = null; |
| | | if (SinataUtil.isNotEmpty(cell0)){ |
| | | zero = String.valueOf(cell0.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell1 = row.getCell(1); //所属机构[平台司机/加盟司机] |
| | | String one = null; |
| | | if (SinataUtil.isNotEmpty(cell1)){ |
| | | one = String.valueOf(cell1.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell2 = row.getCell(2); //所属分公司[提示:加盟司机选填] |
| | | String two = null; |
| | | if (SinataUtil.isNotEmpty(cell2)){ |
| | | two = String.valueOf(cell2.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell3 = row.getCell(3); //所属加盟商[提示:加盟司机选填] |
| | | String three = null; |
| | | if (SinataUtil.isNotEmpty(cell3)){ |
| | | three = String.valueOf(cell3.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell4 = row.getCell(4); //性别[男/女] |
| | | String four = null; |
| | | if (SinataUtil.isNotEmpty(cell4)){ |
| | | four = String.valueOf(cell4.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell5 = row.getCell(5); //驾驶证号码 |
| | | String five = null; |
| | | if (SinataUtil.isNotEmpty(cell5)){ |
| | | five = String.valueOf(cell5.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell6 = row.getCell(6); //驾龄 |
| | | String six = null; |
| | | if (SinataUtil.isNotEmpty(cell6)){ |
| | | six = String.valueOf(cell6.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell7 = row.getCell(7); //身份证号 |
| | | String seven = null; |
| | | if (SinataUtil.isNotEmpty(cell7)){ |
| | | seven = String.valueOf(cell7.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell8 = row.getCell(8); //居住地址 |
| | | String eight = null; |
| | | if (SinataUtil.isNotEmpty(cell8)){ |
| | | eight = String.valueOf(cell8.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell9 = row.getCell(9); //出租车资格证号 |
| | | String nine = null; |
| | | if (SinataUtil.isNotEmpty(cell9)){ |
| | | nine = String.valueOf(cell9.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell10 = row.getCell(10); //工号[选填] |
| | | String ten = null; |
| | | if (SinataUtil.isNotEmpty(cell10)){ |
| | | ten = String.valueOf(cell10.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell11 = row.getCell(11); //经营业务:专车[是/否] |
| | | String eleven = null; |
| | | if (SinataUtil.isNotEmpty(cell11)){ |
| | | eleven = String.valueOf(cell11.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell12 = row.getCell(12); //经营业务:专车[是/否] |
| | | String twelve = null; |
| | | if (SinataUtil.isNotEmpty(cell12)){ |
| | | twelve = String.valueOf(cell12.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell13 = row.getCell(13); //经营业务:跨城出行[是/否] |
| | | String thirteen = null; |
| | | if (SinataUtil.isNotEmpty(cell13)){ |
| | | thirteen = String.valueOf(cell13.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell14 = row.getCell(14); //经营业务:小件同城物流[是/否] |
| | | String fourteen = null; |
| | | if (SinataUtil.isNotEmpty(cell14)){ |
| | | fourteen = String.valueOf(cell14.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell15 = row.getCell(15); //经营业务:小件跨城物流[是/否] |
| | | String fifteen = null; |
| | | if (SinataUtil.isNotEmpty(cell15)){ |
| | | fifteen = String.valueOf(cell15.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell16 = row.getCell(16); //经营业务:包车[是/否] |
| | | String sixteen = null; |
| | | if (SinataUtil.isNotEmpty(cell16)){ |
| | | sixteen = String.valueOf(cell16.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell17 = row.getCell(17); //登录账号[手机号] |
| | | String seventeen = null; |
| | | if (SinataUtil.isNotEmpty(cell17)){ |
| | | seventeen = String.valueOf(cell17.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell18 = row.getCell(18); //登录密码[密码长度为6-18] |
| | | String eighteen = null; |
| | | if (SinataUtil.isNotEmpty(cell18)){ |
| | | eighteen = String.valueOf(cell18.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | if (SinataUtil.isEmpty(zero) || SinataUtil.isEmpty(one) || SinataUtil.isEmpty(four) |
| | | || SinataUtil.isEmpty(five) || SinataUtil.isEmpty(six) || SinataUtil.isEmpty(nine) |
| | | || SinataUtil.isEmpty(eleven) || SinataUtil.isEmpty(twelve) || SinataUtil.isEmpty(thirteen) |
| | | || SinataUtil.isEmpty(fourteen) || SinataUtil.isEmpty(fifteen) || SinataUtil.isEmpty(sixteen) |
| | | || SinataUtil.isEmpty(seventeen)|| SinataUtil.isEmpty(eighteen)){ |
| | | return new ErrorTip(500, "单元格不能为空"); |
| | | }else{ |
| | | //判断账号是否存在 |
| | | int count = tDriverService.selectCount(new EntityWrapper<TDriver>().eq("phone", seventeen).in("authState", "1,2,3").ne("flag", 3)); |
| | | if (count > 0){ |
| | | continue; |
| | | } |
| | | |
| | | //判断所属机构 |
| | | if (!one.equals("平台司机") && !one.equals("加盟司机")){ |
| | | return new ErrorTip(500, "所属机构内容不正确"); |
| | | } |
| | | //判断性别 |
| | | if (!four.equals("男") && !four.equals("女")){ |
| | | return new ErrorTip(500, "性别内容不正确"); |
| | | } |
| | | //判断经营业务【专车】 |
| | | if (!eleven.equals("是") && !eleven.equals("否")){ |
| | | return new ErrorTip(500, "经营业务【专车】内容不正确"); |
| | | } |
| | | //判断经营业务【出租车】 |
| | | if (!twelve.equals("是") && !twelve.equals("否")){ |
| | | return new ErrorTip(500, "经营业务【出租车】内容不正确"); |
| | | } |
| | | //判断经营业务【跨城出行】 |
| | | if (!thirteen.equals("是") && !thirteen.equals("否")){ |
| | | return new ErrorTip(500, "经营业务【跨城出行】内容不正确"); |
| | | } |
| | | //判断经营业务【小件同城物流】 |
| | | if (!fourteen.equals("是") && !fourteen.equals("否")){ |
| | | return new ErrorTip(500, "经营业务【小件同城物流】内容不正确"); |
| | | } |
| | | //判断经营业务【小件跨城物流】 |
| | | if (!fifteen.equals("是") && !fifteen.equals("否")){ |
| | | return new ErrorTip(500, "经营业务【小件跨城物流】内容不正确"); |
| | | } |
| | | //判断经营业务【包车】 |
| | | if (!sixteen.equals("是") && !sixteen.equals("否")){ |
| | | return new ErrorTip(500, "经营业务【包车】内容不正确"); |
| | | } |
| | | //判断驾龄 |
| | | if (!isInteger(six)){ |
| | | return new ErrorTip(500, "驾龄格式不正确"); |
| | | } |
| | | //判断手机号 |
| | | if (!isPhone(seventeen)){ |
| | | return new ErrorTip(500, "登录账号[手机号]格式不正确"); |
| | | } |
| | | //判断登录密码 |
| | | if (!isPassword(eighteen)){ |
| | | return new ErrorTip(500, "登录密码格式不正确"); |
| | | } |
| | | |
| | | //查找平台公司 |
| | | TCompany platCompany = itCompanyService.selectOne(new EntityWrapper<TCompany>().eq("type", 1).notIn("flag", "3").last(" limit 1")); |
| | | Integer companyId = platCompany.getId(); |
| | | Integer franchiseeId = 0; |
| | | if ("加盟司机".equals(one)){ |
| | | //判断所属分公司是否存在 |
| | | if (SinataUtil.isNotEmpty(two)){ |
| | | TCompany company = itCompanyService.selectOne(new EntityWrapper<TCompany>().eq("name", two).eq("type", 2).notIn("flag", "3").last(" limit 1")); |
| | | if (SinataUtil.isNotEmpty(company)){ |
| | | companyId = company.getId(); |
| | | //判断加盟商是否存在 |
| | | if (SinataUtil.isNotEmpty(three)){ |
| | | TCompany franchisee = itCompanyService.selectOne(new EntityWrapper<TCompany>().eq("superiorId",company.getId()).eq("name", three).eq("type", 3).notIn("flag", "3").last(" limit 1")); |
| | | if (SinataUtil.isNotEmpty(franchisee)){ |
| | | franchiseeId = franchisee.getId(); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | TDriver driver = new TDriver(); |
| | | driver.setAccount(seventeen); |
| | | driver.setJobNumber(ten); |
| | | driver.setPhone(seventeen); |
| | | driver.setPassword(ShiroKit.md5(eighteen, "SA;d5#")); |
| | | driver.setName(zero); |
| | | if ("男".equals(four)){ |
| | | driver.setSex(1); |
| | | }else if ("女".equals(four)){ |
| | | driver.setSex(2); |
| | | } |
| | | driver.setIdCard(seven); |
| | | driver.setDriverAge(Integer.valueOf(six)); |
| | | driver.setDriveCard(five); |
| | | driver.setTaxiAptitudeCard(nine); |
| | | if ("平台司机".equals(one)){ |
| | | driver.setIsPlatCar(1); |
| | | }else if ("加盟司机".equals(one)){ |
| | | driver.setIsPlatCar(2); |
| | | } |
| | | driver.setCompanyId(companyId); |
| | | driver.setFranchiseeId(franchiseeId); |
| | | driver.setState(2); |
| | | driver.setAuthState(2); |
| | | driver.setFlag("1"); |
| | | driver.setInsertUser(ShiroKit.getUser().getId()); |
| | | driver.setInsertTime(new Date()); |
| | | driver.setAddType(2); |
| | | driver.setAddObjectId(ShiroKit.getUser().getObjectId()); |
| | | if(SinataUtil.isNotEmpty(eight)){ |
| | | driver.setDriverAddress(eight); |
| | | } |
| | | tDriverService.insert(driver); |
| | | |
| | | |
| | | //添加专车服务模式 |
| | | if ("是".equals(eleven)){ |
| | | TDriverService service = new TDriverService(); |
| | | service.setDriverId(driver.getId()); |
| | | service.setType(1); |
| | | itDriverServiceService.insert(service); |
| | | } |
| | | //添加出租车服务模式 |
| | | if ("是".equals(twelve)){ |
| | | TDriverService service = new TDriverService(); |
| | | service.setDriverId(driver.getId()); |
| | | service.setType(2); |
| | | itDriverServiceService.insert(service); |
| | | } |
| | | //添加跨城出行服务模式 |
| | | if ("是".equals(thirteen)){ |
| | | TDriverService service = new TDriverService(); |
| | | service.setDriverId(driver.getId()); |
| | | service.setType(3); |
| | | itDriverServiceService.insert(service); |
| | | } |
| | | //添加小件同城物流服务模式 |
| | | if ("是".equals(fourteen)){ |
| | | TDriverService service = new TDriverService(); |
| | | service.setDriverId(driver.getId()); |
| | | service.setType(4); |
| | | itDriverServiceService.insert(service); |
| | | } |
| | | //添加小件跨城物流服务模式 |
| | | if ("是".equals(fifteen)){ |
| | | TDriverService service = new TDriverService(); |
| | | service.setDriverId(driver.getId()); |
| | | service.setType(5); |
| | | itDriverServiceService.insert(service); |
| | | } |
| | | //添加包车服务模式 |
| | | if ("是".equals(sixteen)){ |
| | | TDriverService service = new TDriverService(); |
| | | service.setDriverId(driver.getId()); |
| | | service.setType(6); |
| | | itDriverServiceService.insert(service); |
| | | } |
| | | } |
| | | } |
| | | }else if (ShiroKit.getUser().getRoleType() == 2){ |
| | | Workbook book = WoUtil.ImportFile(file); |
| | | Sheet sh = book.getSheetAt(0); //获取到第一个表 |
| | | for (int i = 1; i <= sh.getLastRowNum(); i++) { |
| | | Row row = sh.getRow(i); |
| | | |
| | | Cell cell0 = row.getCell(0); //司机名称 |
| | | String zero = null; |
| | | if (SinataUtil.isNotEmpty(cell0)){ |
| | | zero = String.valueOf(cell0.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell1 = row.getCell(1); //所属加盟商[选填] |
| | | String one = null; |
| | | if (SinataUtil.isNotEmpty(cell1)){ |
| | | one = String.valueOf(cell1.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell2 = row.getCell(2); //性别[男/女] |
| | | String two = null; |
| | | if (SinataUtil.isNotEmpty(cell2)){ |
| | | two = String.valueOf(cell2.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell3 = row.getCell(3); //驾驶证号码 |
| | | String three = null; |
| | | if (SinataUtil.isNotEmpty(cell3)){ |
| | | three = String.valueOf(cell3.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell4 = row.getCell(4); //驾龄 |
| | | String four = null; |
| | | if (SinataUtil.isNotEmpty(cell4)){ |
| | | four = String.valueOf(cell4.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell5 = row.getCell(5); //身份证号 |
| | | String five = null; |
| | | if (SinataUtil.isNotEmpty(cell5)){ |
| | | five = String.valueOf(cell5.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell6 = row.getCell(6); //居住地址 |
| | | String six = null; |
| | | if (SinataUtil.isNotEmpty(cell6)){ |
| | | six = String.valueOf(cell6.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell7 = row.getCell(7); //出租车资格证号 |
| | | String seven = null; |
| | | if (SinataUtil.isNotEmpty(cell7)){ |
| | | seven = String.valueOf(cell7.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell8 = row.getCell(8); //工号[选填] |
| | | String eight = null; |
| | | if (SinataUtil.isNotEmpty(cell8)){ |
| | | eight = String.valueOf(cell8.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell9 = row.getCell(9); //经营业务:专车[是/否] |
| | | String nine = null; |
| | | if (SinataUtil.isNotEmpty(cell9)){ |
| | | nine = String.valueOf(cell9.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell10 = row.getCell(10); //经营业务:出租车[是/否] |
| | | String ten = null; |
| | | if (SinataUtil.isNotEmpty(cell10)){ |
| | | ten = String.valueOf(cell10.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell11 = row.getCell(11); //经营业务:跨城出行[是/否] |
| | | String eleven = null; |
| | | if (SinataUtil.isNotEmpty(cell11)){ |
| | | eleven = String.valueOf(cell11.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell12 = row.getCell(12); //经营业务:小件同城物流[是/否] |
| | | String twelve = null; |
| | | if (SinataUtil.isNotEmpty(cell12)){ |
| | | twelve = String.valueOf(cell12.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell13 = row.getCell(13); //经营业务:小件跨城物流[是/否] |
| | | String thirteen = null; |
| | | if (SinataUtil.isNotEmpty(cell13)){ |
| | | thirteen = String.valueOf(cell13.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell14 = row.getCell(14); //经营业务:包车[是/否] |
| | | String fourteen = null; |
| | | if (SinataUtil.isNotEmpty(cell14)){ |
| | | fourteen = String.valueOf(cell14.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell15 = row.getCell(15); //登录账号[手机号] |
| | | String fifteen = null; |
| | | if (SinataUtil.isNotEmpty(cell15)){ |
| | | fifteen = String.valueOf(cell15.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell16 = row.getCell(16); //登录密码[密码长度为6-18] |
| | | String sixteen = null; |
| | | if (SinataUtil.isNotEmpty(cell16)){ |
| | | sixteen = String.valueOf(cell16.getStringCellValue()).trim(); |
| | | } |
| | | if (SinataUtil.isEmpty(zero) || SinataUtil.isEmpty(two) || SinataUtil.isEmpty(three) || SinataUtil.isEmpty(four) |
| | | || SinataUtil.isEmpty(five) || SinataUtil.isEmpty(seven) |
| | | || SinataUtil.isEmpty(nine) || SinataUtil.isEmpty(ten) |
| | | || SinataUtil.isEmpty(eleven) || SinataUtil.isEmpty(twelve) || SinataUtil.isEmpty(thirteen) |
| | | || SinataUtil.isEmpty(fourteen) || SinataUtil.isEmpty(fifteen) || SinataUtil.isEmpty(sixteen)){ |
| | | return new ErrorTip(500, "单元格不能为空"); |
| | | }else{ |
| | | //判断账号是否存在 |
| | | int count = tDriverService.selectCount(new EntityWrapper<TDriver>().eq("phone", fifteen).in("authState", "1,2,3").ne("flag", 3)); |
| | | if (count > 0){ |
| | | continue; |
| | | } |
| | | //判断性别 |
| | | if (!two.equals("男") && !two.equals("女")){ |
| | | return new ErrorTip(500, "性别内容不正确"); |
| | | } |
| | | //判断经营业务【专车】 |
| | | if (!nine.equals("是") && !nine.equals("否")){ |
| | | return new ErrorTip(500, "经营业务【专车】内容不正确"); |
| | | } |
| | | //判断经营业务【出租车】 |
| | | if (!ten.equals("是") && !ten.equals("否")){ |
| | | return new ErrorTip(500, "经营业务【出租车】内容不正确"); |
| | | } |
| | | //判断经营业务【跨城出行】 |
| | | if (!eleven.equals("是") && !eleven.equals("否")){ |
| | | return new ErrorTip(500, "经营业务【跨城出行】内容不正确"); |
| | | } |
| | | //判断经营业务【小件同城物流】 |
| | | if (!twelve.equals("是") && !twelve.equals("否")){ |
| | | return new ErrorTip(500, "经营业务【小件同城物流】内容不正确"); |
| | | } |
| | | //判断经营业务【小件跨城物流】 |
| | | if (!thirteen.equals("是") && !thirteen.equals("否")){ |
| | | return new ErrorTip(500, "经营业务【小件跨城物流】内容不正确"); |
| | | } |
| | | //判断经营业务【包车】 |
| | | if (!fourteen.equals("是") && !fourteen.equals("否")){ |
| | | return new ErrorTip(500, "经营业务【包车】内容不正确"); |
| | | } |
| | | //判断驾龄 |
| | | if (!isInteger(four)){ |
| | | return new ErrorTip(500, "驾龄格式不正确"); |
| | | } |
| | | //判断手机号 |
| | | if (!isPhone(fifteen)){ |
| | | return new ErrorTip(500, "登录账号[手机号]格式不正确"); |
| | | } |
| | | //判断登录密码 |
| | | if (!isPassword(sixteen)){ |
| | | return new ErrorTip(500, "登录密码格式不正确"); |
| | | } |
| | | //查找平台公司 |
| | | Integer companyId = ShiroKit.getUser().getObjectId(); |
| | | Integer franchiseeId = 0; |
| | | //判断所属分公司是否存在 |
| | | if (SinataUtil.isNotEmpty(one)){ |
| | | TCompany franchisee = itCompanyService.selectOne(new EntityWrapper<TCompany>().eq("superiorId",companyId).eq("name", one).eq("type", 3).notIn("flag", "3").last(" limit 1")); |
| | | if (SinataUtil.isNotEmpty(franchisee)){ |
| | | franchiseeId = franchisee.getId(); |
| | | } |
| | | } |
| | | |
| | | TDriver driver = new TDriver(); |
| | | driver.setAccount(fifteen); |
| | | driver.setJobNumber(eight); |
| | | driver.setPhone(fifteen); |
| | | driver.setPassword(ShiroKit.md5(sixteen, "SA;d5#")); |
| | | driver.setName(zero); |
| | | if ("男".equals(two)){ |
| | | driver.setSex(1); |
| | | }else if ("女".equals(two)){ |
| | | driver.setSex(2); |
| | | } |
| | | driver.setIdCard(five); |
| | | driver.setDriverAge(Integer.valueOf(four)); |
| | | driver.setDriveCard(three); |
| | | driver.setTaxiAptitudeCard(seven); |
| | | driver.setIsPlatCar(2); |
| | | driver.setCompanyId(companyId); |
| | | driver.setFranchiseeId(franchiseeId); |
| | | driver.setState(1); |
| | | driver.setAuthState(1); |
| | | driver.setFlag("1"); |
| | | driver.setInsertUser(ShiroKit.getUser().getId()); |
| | | driver.setInsertTime(new Date()); |
| | | driver.setAddType(3); |
| | | driver.setAddObjectId(ShiroKit.getUser().getObjectId()); |
| | | if (SinataUtil.isNotEmpty(six)){ |
| | | driver.setDriverAddress(six); |
| | | } |
| | | tDriverService.insert(driver); |
| | | |
| | | //添加专车服务模式 |
| | | if ("是".equals(nine)){ |
| | | TDriverService service = new TDriverService(); |
| | | service.setDriverId(driver.getId()); |
| | | service.setType(1); |
| | | itDriverServiceService.insert(service); |
| | | } |
| | | //添加出租车服务模式 |
| | | if ("是".equals(ten)){ |
| | | TDriverService service = new TDriverService(); |
| | | service.setDriverId(driver.getId()); |
| | | service.setType(2); |
| | | itDriverServiceService.insert(service); |
| | | } |
| | | //添加跨城出行服务模式 |
| | | if ("是".equals(eleven)){ |
| | | TDriverService service = new TDriverService(); |
| | | service.setDriverId(driver.getId()); |
| | | service.setType(3); |
| | | itDriverServiceService.insert(service); |
| | | } |
| | | //添加小件同城物流服务模式 |
| | | if ("是".equals(twelve)){ |
| | | TDriverService service = new TDriverService(); |
| | | service.setDriverId(driver.getId()); |
| | | service.setType(4); |
| | | itDriverServiceService.insert(service); |
| | | } |
| | | //添加小件跨城物流服务模式 |
| | | if ("是".equals(thirteen)){ |
| | | TDriverService service = new TDriverService(); |
| | | service.setDriverId(driver.getId()); |
| | | service.setType(5); |
| | | itDriverServiceService.insert(service); |
| | | } |
| | | //添加包车服务模式 |
| | | if ("是".equals(fourteen)){ |
| | | TDriverService service = new TDriverService(); |
| | | service.setDriverId(driver.getId()); |
| | | service.setType(6); |
| | | itDriverServiceService.insert(service); |
| | | } |
| | | |
| | | } |
| | | } |
| | | }else if (ShiroKit.getUser().getRoleType() == 3){ |
| | | Workbook book = WoUtil.ImportFile(file); |
| | | Sheet sh = book.getSheetAt(0); //获取到第一个表 |
| | | for (int i = 1; i <= sh.getLastRowNum(); i++) { |
| | | Row row = sh.getRow(i); |
| | | |
| | | Cell cell0 = row.getCell(0); //司机名称 |
| | | String zero = null; |
| | | if (SinataUtil.isNotEmpty(cell0)){ |
| | | zero = String.valueOf(cell0.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell2 = row.getCell(1); //性别[男/女] |
| | | String one = null; |
| | | if (SinataUtil.isNotEmpty(cell2)){ |
| | | one = String.valueOf(cell2.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell3 = row.getCell(2); //驾驶证号码 |
| | | String two = null; |
| | | if (SinataUtil.isNotEmpty(cell3)){ |
| | | two = String.valueOf(cell3.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell4 = row.getCell(3); //驾龄 |
| | | String three = null; |
| | | if (SinataUtil.isNotEmpty(cell4)){ |
| | | three = String.valueOf(cell4.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell5 = row.getCell(4); //身份证号 |
| | | String four = null; |
| | | if (SinataUtil.isNotEmpty(cell5)){ |
| | | four = String.valueOf(cell5.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell6 = row.getCell(5); //居住地址 |
| | | String five = null; |
| | | if (SinataUtil.isNotEmpty(cell6)){ |
| | | five = String.valueOf(cell6.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell7 = row.getCell(6); //出租车资格证号 |
| | | String six = null; |
| | | if (SinataUtil.isNotEmpty(cell7)){ |
| | | six = String.valueOf(cell7.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell8 = row.getCell(7); //工号[选填] |
| | | String seven = null; |
| | | if (SinataUtil.isNotEmpty(cell8)){ |
| | | seven = String.valueOf(cell8.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell9 = row.getCell(8); //经营业务:专车[是/否] |
| | | String eight = null; |
| | | if (SinataUtil.isNotEmpty(cell9)){ |
| | | eight = String.valueOf(cell9.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell10 = row.getCell(9); //经营业务:出租车[是/否] |
| | | String nine = null; |
| | | if (SinataUtil.isNotEmpty(cell10)){ |
| | | nine = String.valueOf(cell10.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell11 = row.getCell(10); //经营业务:跨城出行[是/否] |
| | | String ten = null; |
| | | if (SinataUtil.isNotEmpty(cell11)){ |
| | | ten = String.valueOf(cell11.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell12 = row.getCell(11); //经营业务:小件同城物流[是/否] |
| | | String eleven = null; |
| | | if (SinataUtil.isNotEmpty(cell12)){ |
| | | eleven = String.valueOf(cell12.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell13 = row.getCell(12); //经营业务:小件跨城物流[是/否] |
| | | String twelve = null; |
| | | if (SinataUtil.isNotEmpty(cell13)){ |
| | | twelve = String.valueOf(cell13.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell14 = row.getCell(13); //经营业务:包车[是/否] |
| | | String thirteen = null; |
| | | if (SinataUtil.isNotEmpty(cell14)){ |
| | | thirteen = String.valueOf(cell14.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell15 = row.getCell(14); //登录账号[手机号] |
| | | String fourteen = null; |
| | | if (SinataUtil.isNotEmpty(cell15)){ |
| | | fourteen = String.valueOf(cell15.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell16 = row.getCell(15); //登录密码[密码长度为6-18] |
| | | String fifteen = null; |
| | | if (SinataUtil.isNotEmpty(cell16)){ |
| | | fifteen = String.valueOf(cell16.getStringCellValue()).trim(); |
| | | } |
| | | if (SinataUtil.isEmpty(zero) || SinataUtil.isEmpty(one) || SinataUtil.isEmpty(two) || SinataUtil.isEmpty(three) || SinataUtil.isEmpty(four) |
| | | || SinataUtil.isEmpty(six) || SinataUtil.isEmpty(eight) |
| | | || SinataUtil.isEmpty(nine) || SinataUtil.isEmpty(ten) |
| | | || SinataUtil.isEmpty(eleven) || SinataUtil.isEmpty(twelve) || SinataUtil.isEmpty(thirteen) |
| | | || SinataUtil.isEmpty(fourteen) || SinataUtil.isEmpty(fifteen) ){ |
| | | return new ErrorTip(500, "单元格不能为空"); |
| | | }else{ |
| | | //判断账号是否存在 |
| | | int count = tDriverService.selectCount(new EntityWrapper<TDriver>().eq("phone", fourteen).in("authState", "1,2,3").ne("flag", 3)); |
| | | if (count > 0){ |
| | | continue; |
| | | } |
| | | //判断性别 |
| | | if (!one.equals("男") && !one.equals("女")){ |
| | | return new ErrorTip(500, "性别内容不正确"); |
| | | } |
| | | //判断经营业务【专车】 |
| | | if (!eight.equals("是") && !eight.equals("否")){ |
| | | return new ErrorTip(500, "经营业务【专车】内容不正确"); |
| | | } |
| | | //判断经营业务【出租车】 |
| | | if (!nine.equals("是") && !nine.equals("否")){ |
| | | return new ErrorTip(500, "经营业务【出租车】内容不正确"); |
| | | } |
| | | //判断经营业务【跨城出行】 |
| | | if (!ten.equals("是") && !ten.equals("否")){ |
| | | return new ErrorTip(500, "经营业务【跨城出行】内容不正确"); |
| | | } |
| | | //判断经营业务【小件同城物流】 |
| | | if (!eleven.equals("是") && !eleven.equals("否")){ |
| | | return new ErrorTip(500, "经营业务【小件同城物流】内容不正确"); |
| | | } |
| | | //判断经营业务【小件跨城物流】 |
| | | if (!twelve.equals("是") && !twelve.equals("否")){ |
| | | return new ErrorTip(500, "经营业务【小件跨城物流】内容不正确"); |
| | | } |
| | | //判断经营业务【包车】 |
| | | if (!thirteen.equals("是") && !thirteen.equals("否")){ |
| | | return new ErrorTip(500, "经营业务【包车】内容不正确"); |
| | | } |
| | | //判断驾龄 |
| | | if (!isInteger(three)){ |
| | | return new ErrorTip(500, "驾龄格式不正确"); |
| | | } |
| | | //判断手机号 |
| | | if (!isPhone(fourteen)){ |
| | | return new ErrorTip(500, "登录账号[手机号]格式不正确"); |
| | | } |
| | | //判断登录密码 |
| | | if (!isPassword(fifteen)){ |
| | | return new ErrorTip(500, "登录密码格式不正确"); |
| | | } |
| | | //查找平台公司 |
| | | Integer companyId = 0; |
| | | Integer franchiseeId = 0; |
| | | TCompany franchisee = itCompanyService.selectById(ShiroKit.getUser().getObjectId()); |
| | | if (SinataUtil.isNotEmpty(franchisee)){ |
| | | companyId = franchisee.getSuperiorId(); |
| | | franchiseeId = franchisee.getId(); |
| | | } |
| | | if (companyId == 0 && franchiseeId == 0){ |
| | | return new ErrorTip(500, "当前登录账户上级分公司不能为空"); |
| | | } |
| | | |
| | | TDriver driver = new TDriver(); |
| | | driver.setAccount(fourteen); |
| | | driver.setJobNumber(seven); |
| | | driver.setPhone(fourteen); |
| | | driver.setPassword(ShiroKit.md5(fifteen, "SA;d5#")); |
| | | driver.setName(zero); |
| | | if ("男".equals(one)){ |
| | | driver.setSex(1); |
| | | }else if ("女".equals(one)){ |
| | | driver.setSex(2); |
| | | } |
| | | driver.setIdCard(four); |
| | | driver.setDriverAge(Integer.valueOf(three)); |
| | | driver.setDriveCard(two); |
| | | driver.setTaxiAptitudeCard(six); |
| | | driver.setIsPlatCar(2); |
| | | driver.setCompanyId(companyId); |
| | | driver.setFranchiseeId(franchiseeId); |
| | | driver.setState(1); |
| | | driver.setAuthState(1); |
| | | driver.setFlag("1"); |
| | | driver.setInsertUser(ShiroKit.getUser().getId()); |
| | | driver.setInsertTime(new Date()); |
| | | driver.setAddType(4); |
| | | driver.setAddObjectId(ShiroKit.getUser().getObjectId()); |
| | | if (SinataUtil.isNotEmpty(five)){ |
| | | driver.setDriverAddress(five); |
| | | } |
| | | tDriverService.insert(driver); |
| | | |
| | | //添加专车服务模式 |
| | | if ("是".equals(eight)){ |
| | | TDriverService service = new TDriverService(); |
| | | service.setDriverId(driver.getId()); |
| | | service.setType(1); |
| | | itDriverServiceService.insert(service); |
| | | } |
| | | //添加出租车服务模式 |
| | | if ("是".equals(nine)){ |
| | | TDriverService service = new TDriverService(); |
| | | service.setDriverId(driver.getId()); |
| | | service.setType(2); |
| | | itDriverServiceService.insert(service); |
| | | } |
| | | //添加跨城出行服务模式 |
| | | if ("是".equals(ten)){ |
| | | TDriverService service = new TDriverService(); |
| | | service.setDriverId(driver.getId()); |
| | | service.setType(3); |
| | | itDriverServiceService.insert(service); |
| | | } |
| | | //添加小件同城物流服务模式 |
| | | if ("是".equals(eleven)){ |
| | | TDriverService service = new TDriverService(); |
| | | service.setDriverId(driver.getId()); |
| | | service.setType(4); |
| | | itDriverServiceService.insert(service); |
| | | } |
| | | //添加小件跨城物流服务模式 |
| | | if ("是".equals(twelve)){ |
| | | TDriverService service = new TDriverService(); |
| | | service.setDriverId(driver.getId()); |
| | | service.setType(5); |
| | | itDriverServiceService.insert(service); |
| | | } |
| | | //添加包车服务模式 |
| | | if ("是".equals(thirteen)){ |
| | | TDriverService service = new TDriverService(); |
| | | service.setDriverId(driver.getId()); |
| | | service.setType(6); |
| | | itDriverServiceService.insert(service); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @Autowired |
| | | private ITCompanyService itCompanyService; |
| | | |
| | | @Autowired |
| | | private ITDriverServiceService itDriverServiceService; |
| | | |
| | | *//** |
| | | * 验证是否可以字符转为整数 |
| | | * @param str |
| | | * @return |
| | | *//* |
| | | public static boolean isInteger(String str) { |
| | | try{ |
| | | String reg = "^[0-9]\\d*$"; |
| | | boolean flag = str.matches(reg); |
| | | return flag; |
| | | }catch(NumberFormatException e) { |
| | | System.out.println("异常:\"" + str + "\"..."); |
| | | return false; |
| | | } |
| | | } |
| | | *//** |
| | | * 验证手机号格式是否正确 |
| | | * @param str |
| | | * @return |
| | | *//* |
| | | public static boolean isPhone(String str) { |
| | | try{ |
| | | String reg = "^1\\d{10}$"; |
| | | boolean flag = str.matches(reg); |
| | | return flag; |
| | | }catch(NumberFormatException e) { |
| | | System.out.println("异常:\"" + str + "\"..."); |
| | | return false; |
| | | } |
| | | } |
| | | *//** |
| | | * 验证密码长度是否正确 |
| | | * @param str |
| | | * @return |
| | | *//* |
| | | public static boolean isPassword(String str) { |
| | | try{ |
| | | String reg = "^.{6,18}$"; |
| | | boolean flag = str.matches(reg); |
| | | return flag; |
| | | }catch(NumberFormatException e) { |
| | | System.out.println("异常:\"" + str + "\"..."); |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | *//** |
| | | * 导出司机信息 |
| | | *//* |
| | | @RequestMapping(value = "/outDriver") |
| | | public void outDriver(HttpServletRequest request, HttpServletResponse response) { |
| | | List<Map<String,Object>> listMap = tDriverService.getDriverListNoPage(ShiroKit.getUser().getRoleType(),ShiroKit.getUser().getObjectId()); |
| | | |
| | | // 表格数据【封装】 |
| | | List<List<String>> dataList = new ArrayList<>(); |
| | | |
| | | //第一行显示【封装】 |
| | | List<String> twoList = new ArrayList<String>(); |
| | | twoList.add("总计:"); |
| | | twoList.add(String.valueOf(listMap.size())+"条"); |
| | | dataList.add(twoList); |
| | | |
| | | // 列【封装】 |
| | | List<String> shellList = new ArrayList<String>(); |
| | | shellList.add("添加时间"); |
| | | shellList.add("姓名"); |
| | | shellList.add("登录账号【手机号】"); |
| | | shellList.add("性别"); |
| | | shellList.add("司机来源"); |
| | | shellList.add("所属分公司"); |
| | | shellList.add("所属加盟商"); |
| | | shellList.add("当前车辆"); |
| | | shellList.add("服务模式"); |
| | | shellList.add("关联线路"); |
| | | shellList.add("评分"); |
| | | shellList.add("历史接单数"); |
| | | shellList.add("历史订单总金额"); |
| | | shellList.add("当前钱包余额"); |
| | | shellList.add("钱包活动余额"); |
| | | shellList.add("钱包收入余额"); |
| | | shellList.add("状态"); |
| | | dataList.add(shellList); |
| | | |
| | | for (Map<String,Object> object : listMap){ |
| | | // 详细数据列【封装】 |
| | | shellList = new ArrayList<String>(); |
| | | if(SinataUtil.isNotEmpty(object.get("insertTime"))){ |
| | | shellList.add(DateUtil.formatDate(DateUtil.parse(object.get("insertTime").toString(),"YYYY-MM-dd HH:mm:ss.S"), "YYYY-MM-dd HH:mm:ss")); |
| | | }else{ |
| | | shellList.add("-"); |
| | | } |
| | | if(SinataUtil.isNotEmpty(object.get("name"))){ |
| | | shellList.add(object.get("name").toString()); |
| | | }else{ |
| | | shellList.add("-"); |
| | | } |
| | | if(SinataUtil.isNotEmpty(object.get("phone"))){ |
| | | shellList.add(object.get("phone").toString()); |
| | | }else{ |
| | | shellList.add("-"); |
| | | } |
| | | if(SinataUtil.isNotEmpty(object.get("sex"))){ |
| | | shellList.add(object.get("sex").toString() == "1"?"男":"女"); |
| | | }else{ |
| | | shellList.add("-"); |
| | | } |
| | | if(SinataUtil.isNotEmpty(object.get("addType"))){ |
| | | |
| | | shellList.add(object.get("addType").toString().equals("1")?"司机注册":(object.get("addType").toString().equals("2")?"平台添加":(object.get("addType").toString().equals("3")?"分公司添加":(object.get("addType").toString().equals("4")?"加盟商添加":"")))); |
| | | }else{ |
| | | shellList.add("-"); |
| | | } |
| | | if(SinataUtil.isNotEmpty(object.get("companyName"))){ |
| | | shellList.add(object.get("companyName").toString()); |
| | | }else{ |
| | | shellList.add("-"); |
| | | } |
| | | if(SinataUtil.isNotEmpty(object.get("franchiseeName"))){ |
| | | shellList.add(object.get("franchiseeName").toString()); |
| | | }else{ |
| | | shellList.add("-"); |
| | | } |
| | | if(SinataUtil.isNotEmpty(object.get("carLicensePlate"))){ |
| | | shellList.add(object.get("carLicensePlate").toString()); |
| | | }else{ |
| | | shellList.add("-"); |
| | | } |
| | | if(SinataUtil.isNotEmpty(object.get("serverStr"))){ |
| | | shellList.add(object.get("serverStr").toString()); |
| | | }else{ |
| | | shellList.add("-"); |
| | | } |
| | | if(SinataUtil.isNotEmpty(object.get("lineStr"))){ |
| | | shellList.add(object.get("lineStr").toString()); |
| | | }else{ |
| | | shellList.add("-"); |
| | | } |
| | | if(SinataUtil.isNotEmpty(object.get("evaluateNum"))){ |
| | | shellList.add(object.get("evaluateNum").toString()); |
| | | }else{ |
| | | shellList.add("0"); |
| | | } |
| | | if(SinataUtil.isNotEmpty(object.get("historyNum"))){ |
| | | shellList.add(object.get("historyNum").toString()); |
| | | }else{ |
| | | shellList.add("0"); |
| | | } |
| | | if(SinataUtil.isNotEmpty(object.get("historyMoney"))){ |
| | | shellList.add(object.get("historyMoney").toString()); |
| | | }else{ |
| | | shellList.add("0"); |
| | | } |
| | | if(SinataUtil.isNotEmpty(object.get("balance"))){ |
| | | shellList.add(object.get("balance").toString()); |
| | | }else{ |
| | | shellList.add("0"); |
| | | } |
| | | if(SinataUtil.isNotEmpty(object.get("laveActivityMoney"))){ |
| | | shellList.add(object.get("laveActivityMoney").toString()); |
| | | }else{ |
| | | shellList.add("0"); |
| | | } |
| | | if(SinataUtil.isNotEmpty(object.get("laveBusinessMoney"))){ |
| | | shellList.add(object.get("laveBusinessMoney").toString()); |
| | | }else{ |
| | | shellList.add("0"); |
| | | } |
| | | if(SinataUtil.isNotEmpty(object.get("authState"))){ |
| | | shellList.add(object.get("authState").toString().equals("1")?"待审核":(object.get("authState").toString().equals("2")?"正常":(object.get("authState").toString().equals("3")?"冻结":(object.get("authState").toString().equals("4")?"已拒绝":"")))); |
| | | |
| | | shellList.add(object.get("authState").toString()); |
| | | }else{ |
| | | shellList.add("-"); |
| | | } |
| | | dataList.add(shellList); |
| | | } |
| | | try { |
| | | // 调用工具类进行导出 |
| | | ExcelExportUtil.easySheet("司机信息导出记录"+DateUtil.formatDate(new Date(), "YYYYMMddHHmmss"), "司机信息导出记录", dataList,request, response); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | }*/ |
| | | |
| | | } |
| | |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.ui.Model; |
| | | import org.springframework.util.StringUtils; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | import java.io.OutputStream; |
| | | import java.math.BigDecimal; |
| | | import java.text.DateFormat; |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.LocalDate; |
| | | import java.time.Period; |
| | |
| | | * 跳转到修改 |
| | | */ |
| | | @RequestMapping("/tDriver_update") |
| | | public String tDriverUpdate( Integer tDriverId, Model model) throws ParseException { |
| | | public String tDriverUpdate( Integer tDriverId, Model model) { |
| | | TDriver tDriver = tDriverService.selectById(tDriverId); |
| | | TDriverResp tDriverResp = new TDriverResp(); |
| | | BeanUtils.copyProperties(tDriver,tDriverResp); |
| | |
| | | } |
| | | |
| | | model.addAttribute("item",tDriverResp); |
| | | model.addAttribute("driver",tDriver); |
| | | LogObjectHolder.me().set(tDriver); |
| | | return PREFIX + "tDriver_edit.html"; |
| | | } |
| | |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取详情中的汇总数据查询 |
| | | * @param id |
| | | * @param time |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/querySummaryData") |
| | | public Object querySummaryData(Integer id, String time){ |
| | | return tDriverService.querySummaryData(id, time); |
| | | } |
| | | } |
| | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | | import com.stylefeng.guns.GunsApplication; |
| | | import com.stylefeng.guns.core.base.controller.BaseController; |
| | | import com.stylefeng.guns.core.common.constant.state.Order; |
| | |
| | | model.addAttribute("addressLon",map.get("addressLon")); |
| | | model.addAttribute("addressLat",map.get("addressLat")); |
| | | // 查询广东全区域数据 查询广东所有的代理商 |
| | | List<TAgent> tAgentList = tAgentService.selectList(new EntityWrapper<TAgent>() |
| | | .eq("provinceCode", "440000")); |
| | | Wrapper<TAgent> status = new EntityWrapper<TAgent>().eq("status", 1); |
| | | if(null != agentId){ |
| | | status.eq("id", agentId); |
| | | } |
| | | List<TAgent> tAgentList = tAgentService.selectList(status); |
| | | List<Integer> ids = tAgentList.stream().map(TAgent::getId).collect(Collectors.toList()); |
| | | // 查询统计在线司机,待接单,服务中,已完成,已取消 |
| | | List<TDriver> onLineDriver = tDriverService.selectList(new EntityWrapper<TDriver>() |
| | |
| | | |
| | | @RequestMapping("/getMap") |
| | | @ResponseBody |
| | | public Object getMap(Integer agentId,Integer type,Model model) { |
| | | Integer objectId = Objects.requireNonNull(ShiroKit.getUser()).getObjectId(); |
| | | Integer roleType = ShiroKit.getUser().getRoleType(); |
| | | if(roleType == 3 && Objects.nonNull(objectId)){ |
| | | agentId = objectId; |
| | | public Object getMap(Integer agentId) { |
| | | Map<String, Object> maps = new HashMap<>(); |
| | | Wrapper<TOrder> last = new EntityWrapper<TOrder>().eq("state", 301).eq("status", 1); |
| | | if(null != agentId){ |
| | | last.eq("agentId", agentId); |
| | | } |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | // 查询所有代理商 |
| | | List<TAgent> agentList = tAgentService.selectList(new EntityWrapper<TAgent>() |
| | | .ne("status", StatusEnum.DELETE.getCode()) |
| | | .ne("principal","")); |
| | | |
| | | map.put("agentList",agentList); |
| | | if(Objects.nonNull(agentId)){ |
| | | // 查询当前代理商 |
| | | TAgent tAgent = tAgentService.selectById(agentId); |
| | | Map<String, String> mapAddress = geocode(tAgent.getProvinceName()+tAgent.getCityName()); |
| | | map.put("addressLon",mapAddress.get("addressLon")); |
| | | map.put("addressLat",mapAddress.get("addressLat")); |
| | | // 查询统计在线司机,待接单,服务中,已完成,已取消 |
| | | List<TDriver> onLineDriver = tDriverService.selectList(new EntityWrapper<TDriver>() |
| | | .eq("agentId", agentId)); |
| | | List<TAgent> tAgentAllList = tAgentService.selectList(new EntityWrapper<TAgent>()); |
| | | List<Integer> allIds = tAgentAllList.stream().map(TAgent::getId).collect(Collectors.toList()); |
| | | tOrderService.getDataStatisticsCountByIdsGetMap(allIds,map); |
| | | |
| | | // 查询服务中的订单列表 |
| | | List<TOrderServerResp> orderServerRespList = tOrderService.getDataStatisticsServerListByIds(allIds); |
| | | List<TOrder> orderList = tOrderService.selectList(new EntityWrapper<TOrder>()); |
| | | // 查询司机 |
| | | for (TOrderServerResp tOrderServerResp : orderServerRespList) { |
| | | TDriver tDriver = tDriverService.selectById(tOrderServerResp.getDriverId()); |
| | | tOrderServerResp.setAvatar(tDriver.getAvatar()); |
| | | tOrderServerResp.setDriverName(tDriver.getName()); |
| | | List<TOrder> collect = orderList.stream().filter(order -> tDriver.getId().equals(order.getDriverId()) && |
| | | (order.getState().equals(OrderStateEnum.WAIT_PAY.getCode()) |
| | | || order.getState().equals(OrderStateEnum.WAIT_EVALUATED.getCode()) |
| | | || order.getState().equals(OrderStateEnum.FINISH.getCode()))).collect(Collectors.toList()); |
| | | // 驾龄 |
| | | if(Objects.nonNull(tDriver.getFirstCertificateTime())){ |
| | | Period period = Period.between(LocalDate.now(), DateUtil.dateToLocalDate(tDriver.getFirstCertificateTime())); |
| | | tOrderServerResp.setDrivingExperience(Math.max(Math.abs(period.getYears()), 1)); |
| | | }else { |
| | | tOrderServerResp.setDrivingExperience(0); |
| | | } |
| | | // 代驾次数 |
| | | tOrderServerResp.setValetDrivingCount(collect.size()); |
| | | // 行驶时间 |
| | | long goTime = 0; |
| | | for (TOrder tOrder : collect) { |
| | | // 下车时间 |
| | | Date getoffTime = tOrder.getGetoffTime(); |
| | | // 上车时间 |
| | | Date boardingTime = tOrder.getBoardingTime(); |
| | | long minutes = Duration.between(DateUtil.dateToLocalDateTime(getoffTime), DateUtil.dateToLocalDateTime(boardingTime)).toMinutes(); |
| | | goTime += Math.abs(minutes); |
| | | } |
| | | tOrderServerResp.setGoTime(Long.valueOf(goTime).intValue()); |
| | | // 行驶里程 |
| | | if(CollectionUtils.isEmpty(collect)){ |
| | | tOrderServerResp.setMileageTraveled(0); |
| | | }else { |
| | | int sum = collect.stream().mapToInt(TOrder::getActualMileage).sum(); |
| | | tOrderServerResp.setMileageTraveled(sum/1000); |
| | | } |
| | | } |
| | | map.put("serverList",orderServerRespList); |
| | | // 查询今天所有订单 |
| | | List<TOrder> allList = tOrderService.getDataStatisticsAllList(agentId,type); |
| | | List<List<String>> list = new ArrayList<>(allList.size()); |
| | | for (TOrder tOrder : allList) { |
| | | List<String> obj = new ArrayList<>(3); |
| | | obj.add(tOrder.getStartLng()); |
| | | obj.add(tOrder.getStartLat()); |
| | | obj.add(String.valueOf(tOrder.getState())); |
| | | list.add(obj); |
| | | } |
| | | map.put("allList",list); |
| | | List<List<String>> list1 = new ArrayList<>(); |
| | | for (TDriver tDriver : onLineDriver) { |
| | | List<String> obj = new ArrayList<>(3); |
| | | String value = redisUtil.getValue("DRIVER" + tDriver.getId()); |
| | | if(ToolUtil.isEmpty(value)){ |
| | | continue; |
| | | } |
| | | obj.add(value.split(",")[0]);// 经度 |
| | | obj.add(value.split(",")[1]);// 纬度 |
| | | obj.add(String.valueOf(tDriver.getServerStatus()));// 服务状态 |
| | | list1.add(obj); |
| | | } |
| | | map.put("onLineDriverCount",list1.size()); |
| | | // 拿到所有在线司机地址 |
| | | map.put("onLineDriver",list1); |
| | | }else { |
| | | List<TAgent> tAgentList = tAgentService.selectList(new EntityWrapper<TAgent>() |
| | | .eq("provinceCode", "440000")); |
| | | List<Integer> ids = tAgentList.stream().map(TAgent::getId).collect(Collectors.toList()); |
| | | // 查询统计在线司机,待接单,服务中,已完成,已取消 |
| | | List<TDriver> onLineDriver = tDriverService.selectList(new EntityWrapper<TDriver>() |
| | | .in("agentId", ids)); |
| | | |
| | | Map<String, String> mapAddress = geocode("广东省广州市"); |
| | | map.put("addressLon",mapAddress.get("addressLon")); |
| | | map.put("addressLat",mapAddress.get("addressLat")); |
| | | |
| | | List<TAgent> tAgentAllList = tAgentService.selectList(new EntityWrapper<TAgent>()); |
| | | List<Integer> allIds = tAgentAllList.stream().map(TAgent::getId).collect(Collectors.toList()); |
| | | tOrderService.getDataStatisticsCountByIdsGetMap(allIds,map); |
| | | |
| | | // 查询服务中的订单列表 |
| | | List<TOrderServerResp> orderServerRespList = tOrderService.getDataStatisticsServerListByIds(allIds); |
| | | List<TOrder> orderList = tOrderService.selectList(new EntityWrapper<TOrder>()); |
| | | // 查询司机 |
| | | for (TOrderServerResp tOrderServerResp : orderServerRespList) { |
| | | TDriver tDriver = tDriverService.selectById(tOrderServerResp.getDriverId()); |
| | | tOrderServerResp.setAvatar(tDriver.getAvatar()); |
| | | tOrderServerResp.setDriverName(tDriver.getName()); |
| | | List<TOrder> collect = orderList.stream().filter(order -> tDriver.getId().equals(order.getDriverId()) && |
| | | (order.getState().equals(OrderStateEnum.WAIT_PAY.getCode()) |
| | | || order.getState().equals(OrderStateEnum.WAIT_EVALUATED.getCode()) |
| | | || order.getState().equals(OrderStateEnum.FINISH.getCode()))).collect(Collectors.toList()); |
| | | // 驾龄 |
| | | if(Objects.nonNull(tDriver.getFirstCertificateTime())){ |
| | | Period period = Period.between(LocalDate.now(), DateUtil.dateToLocalDate(tDriver.getFirstCertificateTime())); |
| | | tOrderServerResp.setDrivingExperience(Math.max(Math.abs(period.getYears()), 1)); |
| | | }else { |
| | | tOrderServerResp.setDrivingExperience(0); |
| | | } |
| | | // 代驾次数 |
| | | tOrderServerResp.setValetDrivingCount(collect.size()); |
| | | // 行驶时间 |
| | | long goTime = 0; |
| | | for (TOrder tOrder : collect) { |
| | | // 下车时间 |
| | | Date getoffTime = tOrder.getGetoffTime(); |
| | | // 上车时间 |
| | | Date boardingTime = tOrder.getBoardingTime(); |
| | | long minutes = Duration.between(DateUtil.dateToLocalDateTime(getoffTime), DateUtil.dateToLocalDateTime(boardingTime)).toMinutes(); |
| | | goTime += Math.abs(minutes); |
| | | } |
| | | tOrderServerResp.setGoTime(Long.valueOf(goTime).intValue()); |
| | | // 行驶里程 |
| | | if(CollectionUtils.isEmpty(collect)){ |
| | | tOrderServerResp.setMileageTraveled(0); |
| | | }else { |
| | | int sum = collect.stream().mapToInt(TOrder::getActualMileage).sum(); |
| | | tOrderServerResp.setMileageTraveled(sum/1000); |
| | | } |
| | | } |
| | | map.put("serverList",orderServerRespList); |
| | | |
| | | // 查询今天所有订单 |
| | | List<TOrder> allList = tOrderService.getDataStatisticsAllListByIds(allIds,type); |
| | | List<List<String>> list = new ArrayList<>(allList.size()); |
| | | for (TOrder tOrder : allList) { |
| | | List<String> obj = new ArrayList<>(3); |
| | | obj.add(tOrder.getStartLng()); |
| | | obj.add(tOrder.getStartLat()); |
| | | obj.add(String.valueOf(tOrder.getState())); |
| | | list.add(obj); |
| | | } |
| | | map.put("allList",list); |
| | | List<List<String>> list1 = new ArrayList<>(); |
| | | for (TDriver tDriver : onLineDriver) { |
| | | List<String> obj = new ArrayList<>(3); |
| | | String value = redisUtil.getValue("DRIVER" + tDriver.getId()); |
| | | if(ToolUtil.isEmpty(value)){ |
| | | continue; |
| | | } |
| | | obj.add(value.split(",")[0]);// 经度 |
| | | obj.add(value.split(",")[1]);// 纬度 |
| | | obj.add(String.valueOf(tDriver.getServerStatus()));// 服务状态 |
| | | list1.add(obj); |
| | | } |
| | | map.put("onLineDriverCount",list1.size()); |
| | | // 拿到所有在线司机地址 |
| | | map.put("onLineDriver",list1); |
| | | List<TOrder> tOrders = tOrderService.selectList(last.last(" and UNIX_TIMESTAMP(createTime) + 7200 >= UNIX_TIMESTAMP(NOW())")); |
| | | List<Map<String, Object>> cancel = new ArrayList<>(); |
| | | for (TOrder order : tOrders) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("lonLat", order.getStartLng() + "," + order.getStartLat()); |
| | | cancel.add(map); |
| | | } |
| | | return map; |
| | | maps.put("cancel", cancel); |
| | | Wrapper<TDriver> eq = new EntityWrapper<TDriver>().eq("serverStatus", 1).eq("approvalStatus", 2).eq("status", 1); |
| | | if(null != agentId){ |
| | | eq.eq("agentId", agentId); |
| | | } |
| | | List<TDriver> tDrivers = tDriverService.selectList(eq); |
| | | List<Map<String, Object>> leisure = new ArrayList<>(); |
| | | for (TDriver tDriver : tDrivers) { |
| | | String value = redisUtil.getValue("DRIVER" + tDriver.getId()); |
| | | if(ToolUtil.isEmpty(value)){ |
| | | continue; |
| | | } |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("name", tDriver.getName()); |
| | | map.put("lonLat", value); |
| | | leisure.add(map); |
| | | } |
| | | maps.put("leisure", leisure); |
| | | Wrapper<TOrder> en = new EntityWrapper<TOrder>().in("state", Arrays.asList(103, 104, 105, 106)).eq("status", 1); |
| | | if(null != agentId){ |
| | | en.eq("agentId", agentId); |
| | | } |
| | | List<TOrder> tOrders1 = tOrderService.selectList(en); |
| | | List<Map<String, Object>> receivedOrder = new ArrayList<>(); |
| | | for (TOrder order : tOrders1) { |
| | | String value = redisUtil.getValue("DRIVER" + order.getDriverId()); |
| | | if(ToolUtil.isEmpty(value)){ |
| | | continue; |
| | | } |
| | | TDriver tDriver = tDriverService.selectById(order.getDriverId()); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("name", tDriver.getName()); |
| | | map.put("lonLat", value); |
| | | receivedOrder.add(map); |
| | | } |
| | | maps.put("receivedOrder", receivedOrder); |
| | | Wrapper<TOrder> en1 = new EntityWrapper<TOrder>().eq("state", 102).eq("status", 1); |
| | | if(null != agentId){ |
| | | en1.eq("agentId", agentId); |
| | | } |
| | | List<TOrder> tOrders2 = tOrderService.selectList(en1); |
| | | List<Map<String, Object>> service = new ArrayList<>(); |
| | | for (TOrder order : tOrders2) { |
| | | TDriver tDriver = tDriverService.selectById(order.getDriverId()); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("name", tDriver.getName()); |
| | | map.put("lonLat", order.getStartLng() + "," + order.getStartLat()); |
| | | service.add(map); |
| | | } |
| | | maps.put("service", service); |
| | | List<TOrder> tOrders3 = tOrderService.selectList(new EntityWrapper<TOrder>().eq("state", 101).eq("hallOrder", 1).eq("status", 1)); |
| | | List<Map<String, Object>> lobby = new ArrayList<>(); |
| | | for (TOrder order : tOrders3) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("lonLat", order.getStartLng() + "," + order.getStartLat()); |
| | | lobby.add(map); |
| | | } |
| | | maps.put("lobby", lobby); |
| | | return maps; |
| | | } |
| | | |
| | | @RequestMapping("/getServerOrder") |
| | |
| | | model.addAttribute("num1",jsonObject.getInteger("num1")); |
| | | model.addAttribute("num2",jsonObject.getInteger("num2")); |
| | | model.addAttribute("num3",jsonObject.getString("num3")); |
| | | model.addAttribute("num4",jsonObject.getString("num4")); |
| | | return PREFIX + "tSystemConfigExtractionRules.html"; |
| | | } |
| | | /** |
| | |
| | | }else { |
| | | // 查询广东全区域数据 查询广东所有的代理商 |
| | | List<TAgent> tAgentList = tAgentService.selectList(new EntityWrapper<TAgent>() |
| | | .eq("provinceCode", "440000")); |
| | | .eq("status", 1)); |
| | | List<Integer> ids = tAgentList.stream().map(TAgent::getId).collect(Collectors.toList()); |
| | | // 统计代理商 |
| | | tAgentService.getDataStatisticsByIds(ids,model,map); |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.dao; |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.stylefeng.guns.modular.system.model.CompanyFundFlow; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2023/7/30 4:32 |
| | | */ |
| | | public interface CompanyFundFlowMapper extends BaseMapper<CompanyFundFlow> { |
| | | |
| | | |
| | | /** |
| | | * 获取企业流水 |
| | | * @param role |
| | | * @param id |
| | | * @param type |
| | | * @return |
| | | */ |
| | | List<Map<String, Object>> queryCompanyFundFlow(Page<Map<String, Object>> page, @Param("role") Integer role, |
| | | @Param("id") Integer id, @Param("type") Integer type, |
| | | @Param("startTime") String startTime, @Param("endTime") String endTime); |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.dao; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.stylefeng.guns.modular.system.model.DivisionRecord; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2023/8/15 16:47 |
| | | */ |
| | | public interface DivisionRecordMapper extends BaseMapper<DivisionRecord> { |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.dao; |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.stylefeng.guns.modular.system.model.DriverOnlineTime; |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2023/7/30 1:33 |
| | | */ |
| | | public interface DriverOnlineTimeMapper extends BaseMapper<DriverOnlineTime> { |
| | | } |
| | |
| | | |
| | | |
| | | Double querSumSurplusDividedAmount(@Param("type") Integer type); |
| | | |
| | | |
| | | /** |
| | | * 获取代理商账户余额 |
| | | * @param companyId |
| | | * @return |
| | | */ |
| | | Double queryAgentBalance(@Param("companyId") Integer companyId); |
| | | /** |
| | | * 获取平台账户余额 |
| | | * @return |
| | | */ |
| | | Double queryCompanyBalance(); |
| | | } |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.stylefeng.guns.modular.system.dao.CompanyFundFlowMapper"> |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.stylefeng.guns.modular.system.model.CompanyFundFlow"> |
| | | <id column="id" property="id"/> |
| | | <result column="type" property="type"/> |
| | | <result column="objectType" property="objectType"/> |
| | | <result column="objectId" property="objectId"/> |
| | | <result column="balance" property="balance"/> |
| | | <result column="money" property="money"/> |
| | | <result column="createTime" property="createTime"/> |
| | | </resultMap> |
| | | |
| | | |
| | | |
| | | <select id="queryCompanyFundFlow" resultType="map"> |
| | | select |
| | | a.id, |
| | | DATE_FORMAT(a.createTime, '%Y-%m-%d %H:%i') as createTime, |
| | | a.type, |
| | | b.`name` as driverName, |
| | | a.money, |
| | | a.money + a.balance as balance |
| | | from t_company_fund_flow a |
| | | left join t_driver b on (a.driverId = b.id) |
| | | where 1 = 1 |
| | | <if test="null != role and 1 == role"> |
| | | and a.objectType = 1 |
| | | </if> |
| | | <if test="null != role and 2 == role"> |
| | | and a.objectType = 2 and a.objectId = #{id} |
| | | </if> |
| | | <if test="null != type"> |
| | | and a.type = #{type} |
| | | </if> |
| | | <if test="null != startTime and '' != startTime and null != endTime and '' != endTime"> |
| | | and DATE_FORMAT(a.createTime, '%Y-%m-%d %H:%i') between #{startTime} and #{endTime} |
| | | </if> |
| | | order by a.createTime desc |
| | | </select> |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.stylefeng.guns.modular.system.dao.DivisionRecordMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.stylefeng.guns.modular.system.model.DivisionRecord"> |
| | | <id column="id" property="id"/> |
| | | <result column="userType" property="userType"/> |
| | | <result column="userId" property="userId"/> |
| | | <result column="orderId" property="orderId"/> |
| | | <result column="rechargeRecordId" property="rechargeRecordId"/> |
| | | <result column="merOrderId" property="merOrderId"/> |
| | | <result column="sourceType" property="sourceType"/> |
| | | <result column="amount" property="amount"/> |
| | | <result column="merchantNumber" property="merchantNumber"/> |
| | | <result column="state" property="state"/> |
| | | <result column="payTime" property="payTime"/> |
| | | <result column="createTime" property="createTime"/> |
| | | </resultMap> |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.stylefeng.guns.modular.system.dao.DriverOnlineTimeMapper"> |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.stylefeng.guns.modular.system.model.DriverOnlineTime"> |
| | | <id column="id" property="id" /> |
| | | <result column="driverId" property="driverId" /> |
| | | <result column="day" property="day" /> |
| | | <result column="onlineTime" property="onlineTime"/> |
| | | </resultMap> |
| | | </mapper> |
| | |
| | | and `type` = #{type} |
| | | </if> |
| | | </select> |
| | | |
| | | |
| | | <select id="queryAgentBalance" resultType="double"> |
| | | select |
| | | sum(aa.income) - sum(aa.disburse) as balance |
| | | from ( |
| | | select sum(amount) as income, 0 as disburse from t_revenue where userType = 3 and userId = #{companyId} |
| | | union all |
| | | select 0 as ncome, sum(amount) as disburse from t_settlement_record where type = 2 and objectId = #{companyId} |
| | | ) as aa |
| | | </select> |
| | | <select id="queryCompanyBalance" resultType="double"> |
| | | select |
| | | sum(aa.income) - sum(aa.disburse) + sum(aa.recharge) as balance |
| | | from ( |
| | | select sum(amount) as income, 0 as disburse, 0 as recharge from t_revenue where userType = 4 |
| | | union all |
| | | select 0 as ncome, sum(amount) as disburse, 0 as recharge from t_settlement_record where type = 1 |
| | | union all |
| | | select 0 as ncome, 0 as disburse, sum(surplusDividedAmount) as recharge from t_recharge_record where type = 4 and payStatus = 2 |
| | | ) as aa |
| | | </select> |
| | | </mapper> |
| | |
| | | <result column="endLng" property="endLng" /> |
| | | <result column="boardingTime" property="boardingTime" /> |
| | | <result column="getoffTime" property="getoffTime" /> |
| | | <result column="boardingAddress" property="boardingAddress"/> |
| | | <result column="boardingLng" property="boardingLng"/> |
| | | <result column="boardingLat" property="boardingLat"/> |
| | | <result column="debusAddress" property="debusAddress"/> |
| | | <result column="debusLng" property="debusLng"/> |
| | | <result column="debusLat" property="debusLat"/> |
| | | <result column="estimatedPrice" property="estimatedPrice" /> |
| | | <result column="orderMoney" property="orderMoney" /> |
| | | <result column="payMoney" property="payMoney" /> |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.model; |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import lombok.Data; |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2023/7/30 3:02 |
| | | */ |
| | | @Data |
| | | @TableName("t_company_fund_flow") |
| | | public class CompanyFundFlow { |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | /** |
| | | * 变动类型(1=充值,2=提现,3=佣金收入,4=保险收入) |
| | | */ |
| | | @TableField("type") |
| | | private Integer type; |
| | | /** |
| | | * 对象类型(1=平台,2=代理商) |
| | | */ |
| | | @TableField("objectType") |
| | | private Integer objectType; |
| | | /** |
| | | * 代理商id |
| | | */ |
| | | @TableField("objectId") |
| | | private Integer objectId; |
| | | /** |
| | | * 历史账户余额 |
| | | */ |
| | | @TableField("balance") |
| | | private BigDecimal balance; |
| | | /** |
| | | * 变动金额 |
| | | */ |
| | | @TableField("money") |
| | | private BigDecimal money; |
| | | /** |
| | | * 变动时间 |
| | | */ |
| | | @TableField("createTime") |
| | | private Date createTime; |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2023/8/15 16:45 |
| | | */ |
| | | @TableName("t_division_record") |
| | | public class DivisionRecord { |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | /** |
| | | * 用户类型(1=司机,2=代理商,3=平台) |
| | | */ |
| | | @TableField("userType") |
| | | private Integer userType; |
| | | /** |
| | | * 用户id |
| | | */ |
| | | @TableField("userId") |
| | | private Integer userId; |
| | | /** |
| | | * 分账业务订单id |
| | | */ |
| | | @TableField("orderId") |
| | | private Long orderId; |
| | | /** |
| | | * 充值记录id |
| | | */ |
| | | @TableField("rechargeRecordId") |
| | | private Integer rechargeRecordId; |
| | | /** |
| | | * 第三方分账业务订单id |
| | | */ |
| | | @TableField("merOrderId") |
| | | private String merOrderId; |
| | | /** |
| | | * 业务来源(1=订单业务,2=平台充值) |
| | | */ |
| | | @TableField("sourceType") |
| | | private Integer sourceType; |
| | | /** |
| | | * 分账金额 |
| | | */ |
| | | @TableField("amount") |
| | | private Double amount; |
| | | /** |
| | | * 收款商户号 |
| | | */ |
| | | @TableField("merchantNumber") |
| | | private String merchantNumber; |
| | | /** |
| | | * 分账状态(1=分账中,2=分账成功) |
| | | */ |
| | | @TableField("state") |
| | | private Integer state; |
| | | /** |
| | | * 分账时间 |
| | | */ |
| | | @TableField("payTime") |
| | | private Date payTime; |
| | | /** |
| | | * 添加时间 |
| | | */ |
| | | @TableField("createTime") |
| | | private Date createTime; |
| | | |
| | | public Integer getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(Integer id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public Integer getUserType() { |
| | | return userType; |
| | | } |
| | | |
| | | public void setUserType(Integer userType) { |
| | | this.userType = userType; |
| | | } |
| | | |
| | | public Integer getUserId() { |
| | | return userId; |
| | | } |
| | | |
| | | public void setUserId(Integer userId) { |
| | | this.userId = userId; |
| | | } |
| | | |
| | | public Long getOrderId() { |
| | | return orderId; |
| | | } |
| | | |
| | | public void setOrderId(Long orderId) { |
| | | this.orderId = orderId; |
| | | } |
| | | |
| | | public Integer getRechargeRecordId() { |
| | | return rechargeRecordId; |
| | | } |
| | | |
| | | public void setRechargeRecordId(Integer rechargeRecordId) { |
| | | this.rechargeRecordId = rechargeRecordId; |
| | | } |
| | | |
| | | public String getMerOrderId() { |
| | | return merOrderId; |
| | | } |
| | | |
| | | public void setMerOrderId(String merOrderId) { |
| | | this.merOrderId = merOrderId; |
| | | } |
| | | |
| | | public Integer getSourceType() { |
| | | return sourceType; |
| | | } |
| | | |
| | | public void setSourceType(Integer sourceType) { |
| | | this.sourceType = sourceType; |
| | | } |
| | | |
| | | public Double getAmount() { |
| | | return amount; |
| | | } |
| | | |
| | | public void setAmount(Double amount) { |
| | | this.amount = amount; |
| | | } |
| | | |
| | | public String getMerchantNumber() { |
| | | return merchantNumber; |
| | | } |
| | | |
| | | public void setMerchantNumber(String merchantNumber) { |
| | | this.merchantNumber = merchantNumber; |
| | | } |
| | | |
| | | public Integer getState() { |
| | | return state; |
| | | } |
| | | |
| | | public void setState(Integer state) { |
| | | this.state = state; |
| | | } |
| | | |
| | | public Date getPayTime() { |
| | | return payTime; |
| | | } |
| | | |
| | | public void setPayTime(Date payTime) { |
| | | this.payTime = payTime; |
| | | } |
| | | |
| | | public Date getCreateTime() { |
| | | return createTime; |
| | | } |
| | | |
| | | public void setCreateTime(Date createTime) { |
| | | this.createTime = createTime; |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.model; |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import lombok.Data; |
| | | import java.math.BigInteger; |
| | | import java.util.Date; |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2023/7/30 1:31 |
| | | */ |
| | | @Data |
| | | @TableName("t_driver_online_time") |
| | | public class DriverOnlineTime { |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | /** |
| | | * 司机id |
| | | */ |
| | | @TableField("driverId") |
| | | private Integer driverId; |
| | | /** |
| | | * 统计日期 |
| | | */ |
| | | @TableField("day") |
| | | private Date day; |
| | | /** |
| | | * 在线时长(秒) |
| | | */ |
| | | @TableField("onlineTime") |
| | | private BigInteger onlineTime; |
| | | } |
| | |
| | | @ApiModelProperty(value = "密码") |
| | | private String password; |
| | | |
| | | public String getDistrictCode() { |
| | | return districtCode; |
| | | } |
| | | |
| | | public void setDistrictCode(String districtCode) { |
| | | this.districtCode = districtCode; |
| | | } |
| | | |
| | | public String getDistrictName() { |
| | | return districtName; |
| | | } |
| | | |
| | | public void setDistrictName(String districtName) { |
| | | this.districtName = districtName; |
| | | } |
| | | |
| | | public String getAccount() { |
| | | return account; |
| | | } |
| | |
| | | private Date firstCertificateTime; |
| | | @ApiModelProperty(value = "佣金") |
| | | private BigDecimal commission; |
| | | |
| | | /** |
| | | * 在线时长 |
| | | */ |
| | | @TableField("onlineTime") |
| | | private Long onlineTime; |
| | | @TableField(exist = false) |
| | | @ApiModelProperty(value = "区域") |
| | | private String area; |
| | |
| | | public void setCreateTime(Date createTime) { |
| | | this.createTime = createTime; |
| | | } |
| | | |
| | | public Long getOnlineTime() { |
| | | return onlineTime; |
| | | } |
| | | public void setOnlineTime(Long onlineTime) { |
| | | this.onlineTime = onlineTime; |
| | | } |
| | | @Override |
| | | protected Serializable pkVal() { |
| | | return this.id; |
| | |
| | | */ |
| | | private Date getoffTime; |
| | | /** |
| | | * 上车地址 |
| | | */ |
| | | private String boardingAddress; |
| | | /** |
| | | * 上车经度 |
| | | */ |
| | | private String boardingLng; |
| | | /** |
| | | * 上车纬度 |
| | | */ |
| | | private String boardingLat; |
| | | /** |
| | | * 下车地址 |
| | | */ |
| | | private String debusAddress; |
| | | /** |
| | | * 下车经度 |
| | | */ |
| | | private String debusLng; |
| | | /** |
| | | * 下车纬度 |
| | | */ |
| | | private String debusLat; |
| | | /** |
| | | * 预估价 |
| | | */ |
| | | private BigDecimal estimatedPrice; |
| | |
| | | this.createTime = createTime; |
| | | } |
| | | |
| | | public String getBoardingAddress() { |
| | | return boardingAddress; |
| | | } |
| | | |
| | | public void setBoardingAddress(String boardingAddress) { |
| | | this.boardingAddress = boardingAddress; |
| | | } |
| | | |
| | | public String getBoardingLng() { |
| | | return boardingLng; |
| | | } |
| | | |
| | | public void setBoardingLng(String boardingLng) { |
| | | this.boardingLng = boardingLng; |
| | | } |
| | | |
| | | public String getBoardingLat() { |
| | | return boardingLat; |
| | | } |
| | | |
| | | public void setBoardingLat(String boardingLat) { |
| | | this.boardingLat = boardingLat; |
| | | } |
| | | |
| | | public String getDebusAddress() { |
| | | return debusAddress; |
| | | } |
| | | |
| | | public void setDebusAddress(String debusAddress) { |
| | | this.debusAddress = debusAddress; |
| | | } |
| | | |
| | | public String getDebusLng() { |
| | | return debusLng; |
| | | } |
| | | |
| | | public void setDebusLng(String debusLng) { |
| | | this.debusLng = debusLng; |
| | | } |
| | | |
| | | public String getDebusLat() { |
| | | return debusLat; |
| | | } |
| | | |
| | | public void setDebusLat(String debusLat) { |
| | | this.debusLat = debusLat; |
| | | } |
| | | |
| | | @Override |
| | | protected Serializable pkVal() { |
| | | return this.id; |
| | |
| | | package com.stylefeng.guns.modular.system.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.activerecord.Model; |
| | |
| | | * 内容 |
| | | */ |
| | | private String content; |
| | | /** |
| | | * 分公司id |
| | | */ |
| | | @TableField("companyId") |
| | | private Integer companyId; |
| | | |
| | | |
| | | public Integer getId() { |
| | |
| | | this.content = content; |
| | | } |
| | | |
| | | public Integer getCompanyId() { |
| | | return companyId; |
| | | } |
| | | |
| | | public void setCompanyId(Integer companyId) { |
| | | this.companyId = companyId; |
| | | } |
| | | |
| | | @Override |
| | | protected Serializable pkVal() { |
| | | return this.id; |
| | |
| | | @Override |
| | | public String toString() { |
| | | return "TSystemConfig{" + |
| | | "id=" + id + |
| | | ", type=" + type + |
| | | ", content=" + content + |
| | | "}"; |
| | | "id=" + id + |
| | | ", type=" + type + |
| | | ", content=" + content + |
| | | "}"; |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.service; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.stylefeng.guns.modular.system.model.CompanyFundFlow; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2023/7/30 4:34 |
| | | */ |
| | | public interface ICompanyFundFlowService extends IService<CompanyFundFlow> { |
| | | |
| | | |
| | | /** |
| | | * 获取企业流水记录 |
| | | * @param type |
| | | * @param time |
| | | * @return |
| | | */ |
| | | List<Map<String, Object>> queryCompanyFundFlow(Page<Map<String, Object>> page, Integer type, String time); |
| | | |
| | | |
| | | /** |
| | | * 获取企业流水记录 |
| | | * @return |
| | | */ |
| | | List<Map<String, Object>> queryAgentCompanyFundFlow(Page<Map<String, Object>> page, Integer id); |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.stylefeng.guns.modular.system.model.DivisionRecord; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2023/8/15 16:48 |
| | | */ |
| | | public interface IDivisionRecordService extends IService<DivisionRecord> { |
| | | |
| | | |
| | | /** |
| | | * 获取总分账金额 |
| | | * @param userType |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | Double queryTotalMoney(Integer userType, Integer userId); |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.service; |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.stylefeng.guns.modular.system.model.DriverOnlineTime; |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2023/7/30 1:35 |
| | | */ |
| | | public interface IDriverOnlineTimeService extends IService<DriverOnlineTime> { |
| | | } |
| | |
| | | * @throws Exception |
| | | */ |
| | | Double querSumSurplusDividedAmount(Integer type); |
| | | |
| | | |
| | | /** |
| | | * 获取代理商账户余额 |
| | | * @param companyId |
| | | * @return |
| | | */ |
| | | Double queryAgentBalance(Integer companyId); |
| | | /** |
| | | * 获取平台账户余额 |
| | | * @return |
| | | */ |
| | | Double queryCompanyBalance(); |
| | | } |
| | |
| | | * @param map |
| | | */ |
| | | void getDataStatisticsByIds(List<Integer> ids, Model model, Map<String, Object> map); |
| | | |
| | | |
| | | /** |
| | | * 获取汇总数据 |
| | | * @param id |
| | | * @param time |
| | | * @return |
| | | */ |
| | | Map<String, Object> queryAgentSummaryData(Integer id, String time); |
| | | } |
| | |
| | | * @param map |
| | | */ |
| | | void getDataStatisticsByIds(List<Integer> ids, Model model, Map<String, Object> map); |
| | | |
| | | |
| | | /** |
| | | * 获取司机详情汇总数据 |
| | | * @param driverId |
| | | * @param time |
| | | * @return |
| | | */ |
| | | Map<String, Object> querySummaryData(Integer driverId, String time); |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.service.impl; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.stylefeng.guns.core.shiro.ShiroKit; |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | import com.stylefeng.guns.modular.system.dao.CompanyFundFlowMapper; |
| | | import com.stylefeng.guns.modular.system.model.CompanyFundFlow; |
| | | import com.stylefeng.guns.modular.system.service.ICompanyFundFlowService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2023/7/30 4:34 |
| | | */ |
| | | @Service |
| | | public class CompanyFundFlowServiceImpl extends ServiceImpl<CompanyFundFlowMapper, CompanyFundFlow> implements ICompanyFundFlowService { |
| | | |
| | | |
| | | /** |
| | | * 获取企业流水记录 |
| | | * @param type |
| | | * @param time |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<Map<String, Object>> queryCompanyFundFlow(Page<Map<String, Object>> page, Integer type, String time) { |
| | | Integer roleType = ShiroKit.getUser().getRoleType(); |
| | | if(roleType == 3){ |
| | | roleType = 2; |
| | | } |
| | | Integer objectId = ShiroKit.getUser().getObjectId(); |
| | | String start = ""; |
| | | String end = ""; |
| | | if(ToolUtil.isNotEmpty(time)){ |
| | | start = time.split(" - ")[0]; |
| | | end = time.split(" - ")[1]; |
| | | } |
| | | return this.baseMapper.queryCompanyFundFlow(page, roleType, objectId, type, start, end); |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> queryAgentCompanyFundFlow(Page<Map<String, Object>> page, Integer id) { |
| | | return this.baseMapper.queryCompanyFundFlow(page, 2, id, null, null, null); |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.stylefeng.guns.modular.system.dao.DivisionRecordMapper; |
| | | import com.stylefeng.guns.modular.system.model.DivisionRecord; |
| | | import com.stylefeng.guns.modular.system.service.IDivisionRecordService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2023/8/15 16:49 |
| | | */ |
| | | @Service |
| | | public class DivisionRecordServiceImpl extends ServiceImpl<DivisionRecordMapper, DivisionRecord> implements IDivisionRecordService { |
| | | |
| | | |
| | | /** |
| | | * 获取总分账金额 |
| | | * @param userType |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Double queryTotalMoney(Integer userType, Integer userId) { |
| | | List<DivisionRecord> divisionRecords = this.selectList(new EntityWrapper<DivisionRecord>().eq("userType", userType).eq("userId", userId)); |
| | | BigDecimal total = new BigDecimal("0"); |
| | | for (DivisionRecord divisionRecord : divisionRecords) { |
| | | total = total.add(new BigDecimal(divisionRecord.getAmount())); |
| | | } |
| | | return total.setScale(2, RoundingMode.HALF_EVEN).doubleValue(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.service.impl; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.stylefeng.guns.modular.system.dao.DriverOnlineTimeMapper; |
| | | import com.stylefeng.guns.modular.system.model.DriverOnlineTime; |
| | | import com.stylefeng.guns.modular.system.service.IDriverOnlineTimeService; |
| | | import org.springframework.stereotype.Service; |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2023/7/30 1:35 |
| | | */ |
| | | @Service |
| | | public class DriverOnlineTimeServiceImpl extends ServiceImpl<DriverOnlineTimeMapper, DriverOnlineTime> implements IDriverOnlineTimeService { |
| | | } |
| | |
| | | public Double querSumSurplusDividedAmount(Integer type) { |
| | | return this.baseMapper.querSumSurplusDividedAmount(type); |
| | | } |
| | | |
| | | /** |
| | | * 获取代理商账户余额 |
| | | * @param companyId |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Double queryAgentBalance(Integer companyId) { |
| | | return this.baseMapper.queryAgentBalance(companyId); |
| | | } |
| | | /** |
| | | * 获取平台账户余额 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Double queryCompanyBalance() { |
| | | return this.baseMapper.queryCompanyBalance(); |
| | | } |
| | | } |
| | |
| | | package com.stylefeng.guns.modular.system.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | | import com.stylefeng.guns.core.shiro.ShiroKit; |
| | | import com.stylefeng.guns.core.util.DateUtil; |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | import com.stylefeng.guns.modular.system.controller.resp.TAgentResp; |
| | | import com.stylefeng.guns.modular.system.dao.*; |
| | | import com.stylefeng.guns.modular.system.enums.OrderStateEnum; |
| | |
| | | import com.stylefeng.guns.modular.system.enums.StatusEnum; |
| | | import com.stylefeng.guns.modular.system.enums.UserTypeEnum; |
| | | import com.stylefeng.guns.modular.system.model.*; |
| | | import com.stylefeng.guns.modular.system.service.IDivisionRecordService; |
| | | import com.stylefeng.guns.modular.system.service.ITAgentService; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.stylefeng.guns.modular.system.util.MallBook.model.InterfaceResponse; |
| | | import com.stylefeng.guns.modular.system.util.MallBook.model.QueryBalance; |
| | | import com.stylefeng.guns.modular.system.util.MallBook.util.TrhRequest; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | @Autowired |
| | | private TUserToCouponMapper tUserToCouponMapper; |
| | | |
| | | @Autowired |
| | | private IDivisionRecordService divisionRecordService; |
| | | |
| | | @Override |
| | | public EntityWrapper<TAgent> getAgentWrapper(String principal, String principalPhone, String createTime,Integer status) { |
| | | EntityWrapper<TAgent> wrapper = new EntityWrapper<>(); |
| | |
| | | model.addAttribute("startTimeToEndTime",new SimpleDateFormat("yyyy-MM-dd").format(tAgent.getCreateTime()).replace("-",".") + "-" + |
| | | new SimpleDateFormat("yyyy-MM-dd").format(new Date()).replace("-",".")); |
| | | |
| | | model.addAttribute("id", agentId); |
| | | model.addAttribute("principal",tAgent.getPrincipal()); |
| | | model.addAttribute("principalPhone",tAgent.getPrincipalPhone()); |
| | | model.addAttribute("email",tAgent.getEmail()); |
| | |
| | | List<TOrder> orders = orderList.stream().filter(order -> (order.getState().equals(OrderStateEnum.FINISH.getCode()) || order.getState().equals(OrderStateEnum.WAIT_EVALUATED.getCode())) |
| | | && 0 < order.getOrderMoney().compareTo(new BigDecimal("14")) && order.getAgentId().equals(tAgent.getId())).collect(Collectors.toList()); |
| | | model.addAttribute("validOrder",orders.size()); |
| | | // 过滤已使用优惠券 |
| | | List<TOrder> usedCoupon = orderList.stream().filter(order -> (order.getState().equals(OrderStateEnum.FINISH.getCode()) || order.getState().equals(OrderStateEnum.WAIT_EVALUATED.getCode())) |
| | | && Objects.nonNull(order.getCouponId()) && order.getAgentId().equals(tAgent.getId())).collect(Collectors.toList()); |
| | | // model.addAttribute("usedCoupon",usedCoupon.size()); |
| | | // 已使用优惠券金额求和,已使用优惠券id |
| | | // List<Integer> usedCouponId = usedCoupon.stream().map(TOrder::getCouponId).collect(Collectors.toList()); |
| | | // if(CollectionUtils.isEmpty(usedCouponId)){ |
| | | // // 如果优惠券为空 |
| | | // model.addAttribute("couponPriceSum", BigDecimal.ZERO); |
| | | // }else { |
| | | // // 查询已使用优惠券金额求和 |
| | | // List<TCoupon> tCoupons1 = tCouponMapper.selectList(new EntityWrapper<TCoupon>().in("id", usedCouponId)); |
| | | // if(CollectionUtils.isEmpty(tCoupons1)){ |
| | | // model.addAttribute("couponPriceSum", BigDecimal.ZERO); |
| | | // }else { |
| | | // tCoupons1.stream().map(TCoupon::getCouponPreferentialAmount).reduce(BigDecimal::add).ifPresent(bigDecimal -> model.addAttribute("couponPriceSum", bigDecimal)); |
| | | // } |
| | | // } |
| | | // 优惠券信息 |
| | | // 过滤代理商发放的优惠券 |
| | | List<TUserToCoupon> tUserToCoupons = tUserToCouponMapper.selectList(new EntityWrapper<TUserToCoupon>().eq("objectId",tAgent.getId()) |
| | |
| | | int validCount = tUserToCoupons.stream().mapToInt(TUserToCoupon::getValidCount).sum();//有效数量 |
| | | int expireCount = tUserToCoupons.stream().mapToInt(TUserToCoupon::getExpireCount).sum();//过期数量 |
| | | model.addAttribute("usedCoupon",sum-validCount-expireCount); |
| | | // 司机信息 |
| | | // 司机数 |
| | | List<TDriver> drivers = tDriverMapper.selectList(new EntityWrapper<TDriver>().eq("agentId", tAgent.getId())); |
| | | model.addAttribute("driverCount",drivers.size()); |
| | | // 司机充值计算 |
| | | List<Integer> driverIds = drivers.stream().map(TDriver::getId).collect(Collectors.toList()); |
| | | List<TRechargeRecord> tRechargeRecords = tRechargeRecordMapper.selectList(new EntityWrapper<TRechargeRecord>() |
| | | .in("userId", driverIds) |
| | | .eq("type", UserTypeEnum.AGENT.getCode()) |
| | | .eq("payStatus", PayStatusEnum.FINISH.getCode())); |
| | | if(CollectionUtils.isEmpty(tRechargeRecords)){ |
| | | model.addAttribute("driverRecharge",BigDecimal.ZERO); |
| | | }else { |
| | | tRechargeRecords.stream().map(TRechargeRecord::getAmount).reduce(BigDecimal::add).ifPresent(record->model.addAttribute("driverRecharge",record)); |
| | | |
| | | Double aDouble = divisionRecordService.queryTotalMoney(2, agentId); |
| | | model.addAttribute("income",aDouble); |
| | | QueryBalance queryBalance = new QueryBalance(); |
| | | queryBalance.setUserId(tAgent.getMerchantNumber()); |
| | | TrhRequest<QueryBalance> request = new TrhRequest(); |
| | | InterfaceResponse execute = request.execute(queryBalance, QueryBalance.SERVICE_CODE); |
| | | model.addAttribute("balance", 0); |
| | | if("0000".equals(execute.getCode())){ |
| | | JSONObject jsonObject = JSON.parseObject(execute.getResult()); |
| | | model.addAttribute("balance", jsonObject.getDoubleValue("settledAmount") / 100); |
| | | } |
| | | } |
| | | |
| | |
| | | map.put("agentTotal",agentTotal); |
| | | map.put("agentMonthTotal",agentMonthTotal); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public Map<String, Object> queryAgentSummaryData(Integer id, String time) { |
| | | // 查询代理商用户信息 |
| | | TAgent tAgent = tAgentMapper.selectById(id); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | String startTime = ""; |
| | | String endTime = ""; |
| | | if(ToolUtil.isNotEmpty(time)){ |
| | | startTime = time.split(" - ")[0]; |
| | | endTime = time.split(" - ")[1]; |
| | | } |
| | | Wrapper<TOrder> agentId = new EntityWrapper<TOrder>().eq("agentId", tAgent.getId()); |
| | | if(ToolUtil.isNotEmpty(time)){ |
| | | agentId.last(" and DATE_FORMAT(createTime, '%Y-%m-%d') between '" + startTime + "' and '" + endTime + "'"); |
| | | } |
| | | List<TOrder> orderList = tOrderMapper.selectList(agentId); |
| | | map.put("orderSum",orderList.size()); |
| | | // 过滤已完成和待评价订单,且支付金额在14元以上 |
| | | List<TOrder> orders = orderList.stream().filter(order -> (order.getState().equals(OrderStateEnum.FINISH.getCode()) || order.getState().equals(OrderStateEnum.WAIT_EVALUATED.getCode())) |
| | | && 0 < order.getOrderMoney().compareTo(new BigDecimal("14")) && order.getAgentId().equals(tAgent.getId())).collect(Collectors.toList()); |
| | | map.put("validOrder",orders.size()); |
| | | // 优惠券信息 |
| | | // 过滤代理商发放的优惠券 |
| | | Wrapper<TUserToCoupon> wrapper = new EntityWrapper<TUserToCoupon>().eq("objectId", tAgent.getId()) |
| | | .eq("roleType", 3); |
| | | if(ToolUtil.isNotEmpty(time)){ |
| | | wrapper.last(" and DATE_FORMAT(createTime, '%Y-%m-%d') between '" + startTime + "' and '" + endTime + "'"); |
| | | } |
| | | List<TUserToCoupon> tUserToCoupons = tUserToCouponMapper.selectList(wrapper); |
| | | BigDecimal couponPriceSum = BigDecimal.ZERO; |
| | | for (TUserToCoupon userToCoupon : tUserToCoupons) { |
| | | TCoupon tCoupons1 = tCouponMapper.selectById(userToCoupon.getCouponId()); |
| | | if(Objects.nonNull(tCoupons1)){ |
| | | couponPriceSum = couponPriceSum.add(tCoupons1.getCouponPreferentialAmount().multiply(new BigDecimal(userToCoupon.getCouponTotal()))); |
| | | } |
| | | } |
| | | map.put("couponPriceSum", couponPriceSum); |
| | | // 过滤代理商发放的优惠券 |
| | | int sum = tUserToCoupons.stream().mapToInt(TUserToCoupon::getCouponTotal).sum(); |
| | | // 总量减去有效数量和过期数量为使用数量 |
| | | int validCount = tUserToCoupons.stream().mapToInt(TUserToCoupon::getValidCount).sum();//有效数量 |
| | | int expireCount = tUserToCoupons.stream().mapToInt(TUserToCoupon::getExpireCount).sum();//过期数量 |
| | | map.put("usedCoupon",sum-validCount-expireCount); |
| | | |
| | | Double aDouble = divisionRecordService.queryTotalMoney(2, id); |
| | | map.put("income",aDouble); |
| | | QueryBalance queryBalance = new QueryBalance(); |
| | | queryBalance.setUserId(tAgent.getMerchantNumber()); |
| | | TrhRequest<QueryBalance> request = new TrhRequest(); |
| | | InterfaceResponse execute = request.execute(queryBalance, QueryBalance.SERVICE_CODE); |
| | | map.put("balance", 0); |
| | | if("0000".equals(execute.getCode())){ |
| | | JSONObject jsonObject = JSON.parseObject(execute.getResult()); |
| | | map.put("balance", jsonObject.getDoubleValue("settledAmount") / 100); |
| | | } |
| | | return map; |
| | | } |
| | | } |
| | |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | | import com.stylefeng.guns.core.base.tips.SuccessTip; |
| | | import com.stylefeng.guns.core.shiro.ShiroKit; |
| | | import com.stylefeng.guns.core.util.DateUtil; |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | 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.enums.StatusEnum; |
| | | import com.stylefeng.guns.modular.system.enums.UserTypeEnum; |
| | | import com.stylefeng.guns.modular.system.model.*; |
| | | import com.stylefeng.guns.modular.system.service.IDriverOnlineTimeService; |
| | | import com.stylefeng.guns.modular.system.service.ITDriverService; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.stylefeng.guns.modular.system.service.ITRegionService; |
| | |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.util.StringUtils; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.File; |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | |
| | | @Service |
| | | public class TDriverServiceImpl extends ServiceImpl<TDriverMapper, TDriver> implements ITDriverService { |
| | | |
| | | |
| | | @Autowired |
| | | @Resource |
| | | private TAgentMapper tAgentMapper; |
| | | @Autowired |
| | | @Resource |
| | | private TBranchOfficeMapper tBranchOfficeMapper; |
| | | @Autowired |
| | | @Resource |
| | | private TOrderMapper tOrderMapper; |
| | | @Autowired |
| | | @Resource |
| | | private TDriverMapper tDriverMapper; |
| | | @Autowired |
| | | @Resource |
| | | private TAppUserMapper tAppUserMapper; |
| | | @Autowired |
| | | @Resource |
| | | private TOrderRefusalMapper tOrderRefusalMapper; |
| | | @Autowired |
| | | @Resource |
| | | private TRegionMapper tRegionMapper; |
| | | @Autowired |
| | | @Resource |
| | | private TRevenueMapper tRevenueMapper; |
| | | @Autowired |
| | | private ITRegionService itRegionService; |
| | | @Autowired |
| | | private HttpUtils httpUtils; |
| | | |
| | | @Autowired |
| | | @Resource |
| | | private TRechargeRecordMapper tRechargeRecordMapper; |
| | | @Autowired |
| | | @Resource |
| | | private TCashWithdrawalMapper tCashWithdrawalMapper; |
| | | |
| | | @Autowired |
| | | private IDriverOnlineTimeService driverOnlineTimeService; |
| | | |
| | | private Logger log = LoggerFactory.getLogger(this.getClass()); |
| | | @Override |
| | |
| | | model.addAttribute("score",tDriver.getScore()); |
| | | model.addAttribute("source",tDriver.getSource()); |
| | | model.addAttribute("createTime",new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(tDriver.getCreateTime())); |
| | | model.addAttribute("balance", tDriver.getBalance().add(tDriver.getCouponBalance()).add(tDriver.getBackgroundBalance()).add(tDriver.getCommission()).doubleValue()); |
| | | |
| | | // 计算驾龄 |
| | | if(Objects.nonNull(tDriver.getFirstCertificateTime())){ |
| | |
| | | model.addAttribute("drivingExperience",Math.max(Math.abs(period.getYears()), 1)); |
| | | }else { |
| | | model.addAttribute("drivingExperience",0); |
| | | } |
| | | |
| | | List<TOrder> tOrders = tOrderMapper.selectList(new EntityWrapper<TOrder>()); |
| | | |
| | | String monthDate = new SimpleDateFormat("yyyyMM").format(new Date()); |
| | | |
| | | if(Objects.nonNull(tDriver.getBackgroundBalance()) && Objects.nonNull(tDriver.getBalance()) && Objects.nonNull(tDriver.getCouponBalance())){ |
| | | // 设置余额 |
| | | tDriver.setBalance(tDriver.getBackgroundBalance().add(tDriver.getBalance()).add(tDriver.getCouponBalance())); |
| | | model.addAttribute("balance",tDriver.getBalance()); |
| | | }else { |
| | | model.addAttribute("balance",BigDecimal.ZERO); |
| | | } |
| | | |
| | | // 所属代理商 |
| | |
| | | |
| | | // 查询当前用户邀请了哪些人 |
| | | List<TDriver> list = tDriverMapper.selectList(new EntityWrapper<TDriver>().eq("inviterId", tDriver.getId())); |
| | | if(!CollectionUtils.isEmpty(list)){ |
| | | List<TCashWithdrawal> tCashWithdrawals = tCashWithdrawalMapper.selectList(new EntityWrapper<TCashWithdrawal>() |
| | | .eq("type", UserTypeEnum.DRIVER.getCode()) |
| | | .eq("userDriverId", tDriver.getId()) |
| | | .eq("businessType", 11) |
| | | .eq("state", 2)); |
| | | Optional<BigDecimal> reduce = tCashWithdrawals.stream().map(TCashWithdrawal::getAmount).reduce(BigDecimal::add); |
| | | BigDecimal bigDecimal = BigDecimal.ZERO; |
| | | reduce.ifPresent(bigDecimal::add); |
| | | model.addAttribute("inviterCommission",bigDecimal.add(tDriver.getCommission())); |
| | | model.addAttribute("inviterCount",list.size()); |
| | | }else { |
| | | model.addAttribute("inviterCommission",0); |
| | | model.addAttribute("inviterCount",0); |
| | | } |
| | | List<TAppUser> tAppUsers = tAppUserMapper.selectList(new EntityWrapper<TAppUser>().eq("inviterType", 2).eq("inviterId", tDriver.getId())); |
| | | model.addAttribute("inviterDriverCount",list.size()); |
| | | model.addAttribute("inviterUserCount",tAppUsers.size()); |
| | | List<TCashWithdrawal> tCashWithdrawals = tCashWithdrawalMapper.selectList(new EntityWrapper<TCashWithdrawal>() |
| | | .eq("type", UserTypeEnum.DRIVER.getCode()) |
| | | .eq("userDriverId", tDriver.getId()) |
| | | .eq("businessType", 11) |
| | | .eq("state", 2)); |
| | | Optional<BigDecimal> reduce = tCashWithdrawals.stream().map(TCashWithdrawal::getAmount).reduce(BigDecimal::add); |
| | | BigDecimal bigDecimal = BigDecimal.ZERO; |
| | | reduce.ifPresent(bigDecimal::add); |
| | | model.addAttribute("inviterCommission",bigDecimal.add(tDriver.getCommission())); |
| | | |
| | | if(!CollectionUtils.isEmpty(tOrders)){ |
| | | //累计订单量 |
| | | List<TOrder> cumulativeOrderCount = tOrders.stream().filter(order -> tDriver.getId().equals(order.getDriverId()) |
| | | && (order.getState().equals(OrderStateEnum.WAIT_EVALUATED.getCode()) || order.getState().equals(OrderStateEnum.FINISH.getCode()))).collect(Collectors.toList()); |
| | | model.addAttribute("cumulativeOrderCount",cumulativeOrderCount.size()); |
| | | //当月订单量 |
| | | List<TOrder> monthOrderCount = tOrders.stream().filter(order -> tDriver.getId().equals(order.getDriverId()) |
| | | && (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()); |
| | | // 拒单次数 |
| | | List<TOrderRefusal> driverRefusalList = tOrderRefusalMapper.selectList(new EntityWrapper<TOrderRefusal>().eq("driver_id", tDriver.getId())); |
| | | model.addAttribute("refusalCount",driverRefusalList.size()); |
| | | // 累计收入 司机提现记录加上余额减去充值金额,为累计收入 |
| | | List<TCashWithdrawal> tCashWithdrawals = tCashWithdrawalMapper.selectList(new EntityWrapper<TCashWithdrawal>() |
| | | .eq("type", UserTypeEnum.DRIVER.getCode()) |
| | | .eq("userDriverId", tDriver.getId()) |
| | | .eq("state", 2)); |
| | | BigDecimal balance = tDriver.getBalance(); |
| | | // if(!CollectionUtils.isEmpty(tCashWithdrawals)){ |
| | | // Optional<BigDecimal> reduce = tCashWithdrawals.stream().map(TCashWithdrawal::getAmount).reduce(BigDecimal::add); |
| | | // if(reduce.isPresent()){ |
| | | // balance = balance.add(reduce.get()); |
| | | // } |
| | | // } |
| | | // List<TRechargeRecord> tRechargeRecords = tRechargeRecordMapper.selectList(new EntityWrapper<TRechargeRecord>() |
| | | // .eq("type", UserTypeEnum.DRIVER.getCode()) |
| | | // .eq("userId", tDriver.getId()) |
| | | // .eq("payType", 1) |
| | | // .eq("payStatus", PayStatusEnum.FINISH.getCode())); |
| | | // if(!CollectionUtils.isEmpty(tRechargeRecords)){ |
| | | // Optional<BigDecimal> reduce = tRechargeRecords.stream().map(TRechargeRecord::getAmount).reduce(BigDecimal::add); |
| | | // if(reduce.isPresent()){ |
| | | // balance = balance.subtract(reduce.get()); |
| | | // } |
| | | // } |
| | | List<TRevenue> tRevenues = tRevenueMapper.selectList(new EntityWrapper<TRevenue>() |
| | | .eq("userType", 2) |
| | | .eq("userId", tDriver.getId())); |
| | | Optional<BigDecimal> reduce = tRevenues.stream().map(TRevenue::getAmount).reduce(BigDecimal::add); |
| | | // 减去充值金额 |
| | | if(reduce.isPresent()){ |
| | | model.addAttribute("cumulativeIncome", reduce.get()); |
| | | }else { |
| | | model.addAttribute("cumulativeIncome",0); |
| | | } |
| | | //累计订单量 |
| | | Integer cumulativeOrderCount = tOrderMapper.selectCount(new EntityWrapper<TOrder>().eq("driverId", tDriver.getId()).eq("status", 1)); |
| | | model.addAttribute("cumulativeOrderCount", cumulativeOrderCount); |
| | | //有效订单数 |
| | | Integer effectiveOrderCount = tOrderMapper.selectCount(new EntityWrapper<TOrder>().eq("driverId", tDriver.getId()).eq("status", 1).in("state", Arrays.asList(106, 107, 108))); |
| | | model.addAttribute("effectiveOrderCount", effectiveOrderCount); |
| | | model.addAttribute("commission", tDriver.getCommission().doubleValue()); |
| | | // 拒单次数 |
| | | List<TOrderRefusal> driverRefusalList = tOrderRefusalMapper.selectList(new EntityWrapper<TOrderRefusal>().eq("driver_id", tDriver.getId())); |
| | | model.addAttribute("refusalCount",driverRefusalList.size()); |
| | | List<TRevenue> tRevenues = tRevenueMapper.selectList(new EntityWrapper<TRevenue>() |
| | | .eq("userType", 2) |
| | | .eq("userId", tDriver.getId())); |
| | | Optional<BigDecimal> reduce1 = tRevenues.stream().map(TRevenue::getAmount).reduce(BigDecimal::add); |
| | | // 减去充值金额 |
| | | if(reduce1.isPresent()){ |
| | | model.addAttribute("cumulativeIncome", reduce1.get()); |
| | | }else { |
| | | model.addAttribute("cumulativeOrderCount",0); |
| | | model.addAttribute("monthOrderCount",0); |
| | | model.addAttribute("refusalCount",0); |
| | | // 累计收入 |
| | | model.addAttribute("cumulativeIncome",0); |
| | | } |
| | | //消单次数 |
| | | Integer cancelOrderCount = tOrderMapper.selectCount(new EntityWrapper<TOrder>().eq("driverId", tDriver.getId()).eq("status", 1).in("state", Arrays.asList(301))); |
| | | model.addAttribute("cancelOrderCount",cancelOrderCount); |
| | | //有效在线时长 |
| | | Long onlineTime = tDriver.getOnlineTime(); |
| | | Long s = onlineTime % 60; |
| | | Long m = onlineTime / 60; |
| | | model.addAttribute("onlineTime", (m < 10 ? ("0" + m) : m) + ":" + (s < 10 ? ("0" + s) : s)); |
| | | } |
| | | |
| | | @Override |
| | |
| | | map.put("driverTotal",driverTotal); |
| | | map.put("driverMonthTotal",driverMonthTotal); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取司机详情汇总数据 |
| | | * @param driverId |
| | | * @param time |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Map<String, Object> querySummaryData(Integer driverId, String time) { |
| | | String startTime = ""; |
| | | String endTime = ""; |
| | | if(ToolUtil.isNotEmpty(time)){ |
| | | String[] split = time.split(" - "); |
| | | startTime = split[0]; |
| | | endTime = split[1]; |
| | | } |
| | | Map<String, Object> map = new HashMap<>(); |
| | | TDriver tDriver = this.selectById(driverId); |
| | | //累计订单量 |
| | | Wrapper<TOrder> cumulativeOrderCountWrapper = new EntityWrapper<TOrder>().eq("driverId", tDriver.getId()).eq("status", 1); |
| | | if(ToolUtil.isNotEmpty(time)){ |
| | | cumulativeOrderCountWrapper.last(" and DATE_FORMAT(createTime, '$Y-$m-$d') between '" + startTime + "' and '" + endTime + "'"); |
| | | } |
| | | Integer cumulativeOrderCount = tOrderMapper.selectCount(cumulativeOrderCountWrapper); |
| | | map.put("cumulativeOrderCount", cumulativeOrderCount); |
| | | //有效订单数 |
| | | Wrapper<TOrder> effectiveOrderCountWrapper = new EntityWrapper<TOrder>().eq("driverId", tDriver.getId()).eq("status", 1).in("state", Arrays.asList(106, 107, 108)); |
| | | if(ToolUtil.isNotEmpty(time)){ |
| | | effectiveOrderCountWrapper.last(" and DATE_FORMAT(createTime, '$Y-$m-$d') between '" + startTime + "' and '" + endTime + "'"); |
| | | } |
| | | Integer effectiveOrderCount = tOrderMapper.selectCount(effectiveOrderCountWrapper); |
| | | map.put("effectiveOrderCount", effectiveOrderCount); |
| | | map.put("commission", tDriver.getCommission().doubleValue()); |
| | | map.put("balance", tDriver.getBalance().add(tDriver.getCouponBalance()).add(tDriver.getBackgroundBalance()).add(tDriver.getCommission()).doubleValue()); |
| | | // 查询当前用户邀请了哪些人 |
| | | Wrapper<TDriver> inviterDriverCountWrapper = new EntityWrapper<TDriver>().eq("inviterId", tDriver.getId()); |
| | | if(ToolUtil.isNotEmpty(time)){ |
| | | inviterDriverCountWrapper.last(" and DATE_FORMAT(createTime, '$Y-$m-$d') between '" + startTime + "' and '" + endTime + "'"); |
| | | } |
| | | List<TDriver> list = tDriverMapper.selectList(inviterDriverCountWrapper); |
| | | map.put("inviterDriverCount",list.size()); |
| | | Wrapper<TAppUser> inviterUserCountWrapper = new EntityWrapper<TAppUser>().eq("inviterType", 2).eq("inviterId", tDriver.getId()); |
| | | if(ToolUtil.isNotEmpty(time)){ |
| | | inviterUserCountWrapper.last(" and DATE_FORMAT(createTime, '$Y-$m-$d') between '" + startTime + "' and '" + endTime + "'"); |
| | | } |
| | | List<TAppUser> tAppUsers = tAppUserMapper.selectList(inviterUserCountWrapper); |
| | | map.put("inviterUserCount",tAppUsers.size()); |
| | | Wrapper<TRevenue> cumulativeIncomeWrapper = new EntityWrapper<TRevenue>().eq("userType", 2).eq("userId", tDriver.getId()); |
| | | if(ToolUtil.isNotEmpty(time)){ |
| | | cumulativeIncomeWrapper.last(" and DATE_FORMAT(createTime, '$Y-$m-$d') between '" + startTime + "' and '" + endTime + "'"); |
| | | } |
| | | List<TRevenue> tRevenues = tRevenueMapper.selectList(cumulativeIncomeWrapper); |
| | | Optional<BigDecimal> reduce1 = tRevenues.stream().map(TRevenue::getAmount).reduce(BigDecimal::add); |
| | | // 减去充值金额 |
| | | if(reduce1.isPresent()){ |
| | | map.put("cumulativeIncome", reduce1.get()); |
| | | }else { |
| | | map.put("cumulativeIncome",0); |
| | | } |
| | | Wrapper<TCashWithdrawal> inviterCommissionWrapper = new EntityWrapper<TCashWithdrawal>().eq("type", UserTypeEnum.DRIVER.getCode()).eq("userDriverId", tDriver.getId()) |
| | | .eq("businessType", 11).eq("state", 2); |
| | | if(ToolUtil.isNotEmpty(time)){ |
| | | inviterCommissionWrapper.last(" and DATE_FORMAT(createTime, '$Y-$m-$d') between '" + startTime + "' and '" + endTime + "'"); |
| | | } |
| | | List<TCashWithdrawal> tCashWithdrawals = tCashWithdrawalMapper.selectList(inviterCommissionWrapper); |
| | | Optional<BigDecimal> reduce = tCashWithdrawals.stream().map(TCashWithdrawal::getAmount).reduce(BigDecimal::add); |
| | | BigDecimal bigDecimal = BigDecimal.ZERO; |
| | | reduce.ifPresent(bigDecimal::add); |
| | | map.put("inviterCommission",bigDecimal.add(tDriver.getCommission())); |
| | | //消单次数 |
| | | Wrapper<TOrder> cancelOrderCountWrapper = new EntityWrapper<TOrder>().eq("driverId", tDriver.getId()).eq("status", 1).in("state", Arrays.asList(301)); |
| | | if(ToolUtil.isNotEmpty(time)){ |
| | | cancelOrderCountWrapper.last(" and DATE_FORMAT(createTime, '$Y-$m-$d') between '" + startTime + "' and '" + endTime + "'"); |
| | | } |
| | | Integer cancelOrderCount = tOrderMapper.selectCount(cancelOrderCountWrapper); |
| | | map.put("cancelOrderCount",cancelOrderCount); |
| | | Wrapper<DriverOnlineTime> driverOnlineTimeWrapper = new EntityWrapper<DriverOnlineTime>().eq("driverId", driverId); |
| | | if(ToolUtil.isNotEmpty(time)){ |
| | | driverOnlineTimeWrapper.last(" and DATE_FORMAT(`day`, '$Y-$m-$d') between '" + startTime + "' and '" + endTime + "'"); |
| | | } |
| | | Long onlineTime = 0L; |
| | | List<DriverOnlineTime> driverOnlineTimes = driverOnlineTimeService.selectList(driverOnlineTimeWrapper); |
| | | for (DriverOnlineTime driverOnlineTime : driverOnlineTimes) { |
| | | onlineTime += driverOnlineTime.getOnlineTime().longValue(); |
| | | } |
| | | Long s = onlineTime % 60; |
| | | Long m = onlineTime / 60; |
| | | map.put("onlineTime", (m < 10 ? ("0" + m) : m) + ":" + (s < 10 ? ("0" + s) : s)); |
| | | return map; |
| | | } |
| | | } |
| | |
| | | model.addAttribute("endAddress",tOrder.getEndAddress());//终点 |
| | | model.addAttribute("endLng",tOrder.getEndLng());// 终点经度 |
| | | model.addAttribute("endLat",tOrder.getEndLat());// 终点纬度 |
| | | model.addAttribute("boardingAddress", tOrder.getBoardingAddress());//上车点 |
| | | model.addAttribute("debusAddress", tOrder.getDebusAddress());//下车点 |
| | | |
| | | if(Objects.nonNull(tOrder.getStartTime())){ |
| | | model.addAttribute("startTime",new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(tOrder.getStartTime()));//乘车时间 |
| | |
| | | model.addAttribute("userPhone",tOrder.getUserPhone());//用户手机号 |
| | | model.addAttribute("userName",tOrder.getUserName());//用户名称 |
| | | |
| | | if(null != tOrder.getActualMileage()){ |
| | | model.addAttribute("actualMileage",new BigDecimal(tOrder.getActualMileage() / 1000).setScale(2, RoundingMode.HALF_EVEN).doubleValue());//用户名称 |
| | | }else{ |
| | | model.addAttribute("actualMileage", 0); |
| | | } |
| | | if(null != tOrder.getGetoffTime() && null != tOrder.getBoardingTime()){ |
| | | long t = tOrder.getGetoffTime().getTime() - tOrder.getBoardingTime().getTime(); |
| | | int ti = Long.valueOf(t / 1000).intValue(); |
| | | Integer s = ti % 60; |
| | | Integer m = ti / 60; |
| | | model.addAttribute("time", (m < 10 ? ("0" + m) : m) + ":" + (s < 10 ? ("0" + s) : s));//用户名称 |
| | | }else{ |
| | | model.addAttribute("time", 0); |
| | | } |
| | | |
| | | // 查询用户 |
| | | TAppUser tAppUser = tAppUserMapper.selectById(tOrder.getUserId()); |
| | | if(Objects.nonNull(tAppUser)){ |
| | |
| | | |
| | | spring: |
| | | profiles: |
| | | # active: dev |
| | | active: produce |
| | | active: dev |
| | | # active: produce |
| | | mvc: |
| | | static-path-pattern: /static/** |
| | | view: |
| | |
| | | |
| | | spring: |
| | | datasource: |
| | | url: jdbc:mysql://127.0.0.1:3306/super_save_driving?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=GMT%2B8 |
| | | url: jdbc:mysql://192.168.110.80:3306/super_save_driving?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=GMT%2B8 |
| | | username: root |
| | | password: f4OfRjqoN3jSiNGiUoiNsQdOBtCOKYRj |
| | | # password: 123456 |
| | | # password: f4OfRjqoN3jSiNGiUoiNsQdOBtCOKYRj |
| | | password: 123456 |
| | | db-name: super_save_driving #用来搜集数据库的所有表 |
| | | filters: wall,mergeStat |
| | | |
| | |
| | | spring.redis.database=0 |
| | | |
| | | ## Redis·þÎñÆ÷µØÖ· |
| | | spring.redis.host=127.0.0.1 |
| | | ## Redis·þÎñÆ÷Á¬½Ó¶Ë¿Ú |
| | | spring.redis.port=16379 |
| | | ## Redis·þÎñÆ÷Á¬½ÓÃÜÂ루ĬÈÏΪ¿Õ£© |
| | | spring.redis.password=cKsEeyffDXG5PzNg8CIbrWxFluXrCprZ |
| | | |
| | | # Redis·þÎñÆ÷µØÖ· |
| | | #spring.redis.host=127.0.0.1 |
| | | ## Redis·þÎñÆ÷Á¬½Ó¶Ë¿Ú |
| | | #spring.redis.port=6379 |
| | | #spring.redis.port=16379 |
| | | ## Redis·þÎñÆ÷Á¬½ÓÃÜÂ루ĬÈÏΪ¿Õ£© |
| | | #spring.redis.password=123456 |
| | | #spring.redis.password=cKsEeyffDXG5PzNg8CIbrWxFluXrCprZ |
| | | |
| | | #Redis·þÎñÆ÷µØÖ· |
| | | spring.redis.host=127.0.0.1 |
| | | # Redis·þÎñÆ÷Á¬½Ó¶Ë¿Ú |
| | | spring.redis.port=6379 |
| | | # Redis·þÎñÆ÷Á¬½ÓÃÜÂ루ĬÈÏΪ¿Õ£© |
| | | spring.redis.password=123456 |
| | | |
| | | # Á¬½Ó³Ø×î´óÁ¬½ÓÊý£¨Ê¹ÓøºÖµ±íʾûÓÐÏÞÖÆ£© |
| | | spring.redis.jedis.pool.max-active=1024 |
| | |
| | | <div class="row" style="border-style: none none solid; border-color: #e7eaec; border-width: 1px 0px;"> |
| | | <ul class="breadcrumb" style="height: 45px; line-height: 45px; padding-left: 20px;"> |
| | | <li><a href="#" class="statistics">运营数据总览</a></li> |
| | | <li><a href="#" class="map">车辆地图总览</a></li> |
| | | <li><a href="#" class="order">订单热点图</a></li> |
| | | <li><a href="#" class="map">地图总览</a></li> |
| | | </ul> |
| | | </div> |
| | | |
| | |
| | | </div><br/> |
| | | <div id="chart1" style="height: 90%;width: 100%"></div> |
| | | </div> |
| | | |
| | | <div class="initialLevel col-sm-4 control-label form-group" > |
| | | </div> |
| | | |
| | |
| | | </select> |
| | | </div> |
| | | <div class="initialLevel col-sm-2 control-label form-group" > |
| | | <button type="button" class="btn btn-primary" onclick="getData()" style="height: 33px"> |
| | | <button type="button" class="btn btn-primary" onclick="getMapData()" style="height: 33px"> |
| | | <i class="fa fa-search"></i> 查询 |
| | | </button> |
| | | <button type="button" class="btn btn-primary button-margin" onclick="reset()" style="height: 33px"> |
| | |
| | | <label id="onLineDriverCount">${onLineDriverCount}</label> |
| | | <label>人</label> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="row content" id="orderDiv"> |
| | | <div class="initialLevel col-sm-12 control-label form-group" style="cursor: pointer;text-align: left;"> |
| | | <div class="initialLevel col-sm-2 control-label form-group" > |
| | | <select class="input-group" id="orderType" style="width: 180px;height: 33px" name="orderType"> |
| | | <option value="">请选择订单类型</option> |
| | | <option value="1">未接单</option> |
| | | <option value="2">服务中</option> |
| | | <option value="3">已完成</option> |
| | | <option value="4">已取消</option> |
| | | </select> |
| | | </div> |
| | | <div class="initialLevel col-sm-2 control-label form-group" > |
| | | <button type="button" class="btn btn-primary " onclick="getDataOrder()" style="height: 33px"> |
| | | <i class="fa fa-search"></i> 查询 |
| | | </button> |
| | | <button type="button" class="btn btn-primary button-margin" onclick="resetOrder()" style="height: 33px"> |
| | | <i class="fa fa-trash"></i> 重置 |
| | | </button> |
| | | </div> |
| | | </div> |
| | | <div class="col-sm-10" > |
| | | <input hidden id="allList" value="${allList}"> |
| | | <div class="initialLevel col-sm-12 control-label form-group" style="cursor: pointer;text-align: left;"> |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <div id="containerOrder" ></div> |
| | | <div id="panelOrder" ></div> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="initialLevel col-sm-12 control-label form-group" style="cursor: pointer;text-align: left;"> |
| | | <div class="initialLevel col-sm-2 control-label form-group" > |
| | | <label>未接单</label> |
| | | <label>未接单:</label> |
| | | <label id="pendingOrderCount">${pendingOrderCount}</label> |
| | | </div> |
| | | <div class="initialLevel col-sm-2 control-label form-group" > |
| | | <label>服务中</label> |
| | | <label>服务中:</label> |
| | | <label id="serverCount">${serverCount}</label> |
| | | </div> |
| | | <div class="initialLevel col-sm-2 control-label form-group" > |
| | | <label>已完成</label> |
| | | <label>已完成:</label> |
| | | <label id="finishCount">${finishCount}</label> |
| | | </div> |
| | | <div class="initialLevel col-sm-2 control-label form-group" > |
| | | <label>已取消</label> |
| | | <label>已取消:</label> |
| | | <label id="cancelCount">${cancelCount}</label> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="col-sm-2"> |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-content"> |
| | | <div class="form-horizontal" id="serverOrder" style="overflow:scroll;width: 100%; height:650px;"> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <!--<div class="row content" id="orderDiv">--> |
| | | <!--<div class="col-sm-10" >--> |
| | | <!--<div class="initialLevel col-sm-12 control-label form-group" style="cursor: pointer;text-align: left;">--> |
| | | <!--<div class="initialLevel col-sm-2 control-label form-group" >--> |
| | | <!--<label>未接单:</label>--> |
| | | <!--<label id="pendingOrderCount">${pendingOrderCount}</label>--> |
| | | <!--</div>--> |
| | | <!--<div class="initialLevel col-sm-2 control-label form-group" >--> |
| | | <!--<label>服务中:</label>--> |
| | | <!--<label id="serverCount">${serverCount}</label>--> |
| | | <!--</div>--> |
| | | <!--<div class="initialLevel col-sm-2 control-label form-group" >--> |
| | | <!--<label>已完成:</label>--> |
| | | <!--<label id="finishCount">${finishCount}</label>--> |
| | | <!--</div>--> |
| | | <!--<div class="initialLevel col-sm-2 control-label form-group" >--> |
| | | <!--<label>已取消:</label>--> |
| | | <!--<label id="cancelCount">${cancelCount}</label>--> |
| | | <!--</div>--> |
| | | <!--</div>--> |
| | | <!--</div>--> |
| | | <!--<div class="col-sm-2">--> |
| | | <!--<div class="ibox float-e-margins">--> |
| | | <!--<div class="ibox-content">--> |
| | | <!--<div class="form-horizontal" id="serverOrder" style="overflow:scroll;width: 100%; height:650px;">--> |
| | | <!--</div>--> |
| | | <!--</div>--> |
| | | <!--</div>--> |
| | | <!--</div>--> |
| | | <!--</div>--> |
| | | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <script type="text/javascript" src="http://tajs.qq.com/stats?sId=9051096" charset="UTF-8"></script> |
| | | <script src="${ctxPath}/static/modular/system/tCoupon/tAgent_info.js"></script> |
| | | <script src="${ctxPath}/static/modular/system/tCoupon/tAgent.js"></script> |
| | | |
| | | <link rel="stylesheet" href="${ctxPath}/static/css/plugins/lineProgressbar/jquery.lineProgressbar.css"> |
| | | <script src="${ctxPath}/static/js/plugins/lineProgressbar/jquery.lineProgressbar.js"></script> |
| | | |
| | |
| | | queryOrderCount() |
| | | break; |
| | | case "map": |
| | | map("",113.264434,23.129162); |
| | | break; |
| | | case "order": |
| | | mapOrder(""); |
| | |
| | | } |
| | | |
| | | }) |
| | | // $('#mapDiv').hide() |
| | | // $('#orderDiv').hide() |
| | | // loading() |
| | | // orderByMonth(new Date().getMonth() + 1) |
| | | // orderByYear(new Date().getFullYear()) |
| | | // queryOrderCount() |
| | | setInterval(function () { |
| | | console.log(1111111111) |
| | | getData() |
| | | }, 30000); |
| | | }) |
| | | |
| | | function selectYear(e){ |
| | |
| | | }); |
| | | $('#pro2').LineProgressbar(options); |
| | | var options = $.extend({ |
| | | percentage : $('#driverTotal').text()<100?$('#driverTotal').text():($('#driverTotal').text()>1000?$('#driverTotal').text()/100:$('#driverTotal').text()/10), |
| | | percentage : $('#driverTotal').text(), |
| | | ShowProgressCount: false, |
| | | duration: 10, |
| | | |
| | |
| | | ajax.start(); |
| | | } |
| | | |
| | | function getDataOrder(){ |
| | | var ajax = new $ax(Feng.ctxPath + "/tHomePage/getMap", function (data) { |
| | | document.getElementById("onLineDriverCount").innerText=data.onLineDriverCount |
| | | document.getElementById("pendingOrderCount").innerText=data.pendingOrderCount |
| | | document.getElementById("serverCount").innerText=data.serverCount |
| | | document.getElementById("finishCount").innerText=data.finishCount |
| | | document.getElementById("cancelCount").innerText=data.cancelCount |
| | | $('#allList').val(data.allList); |
| | | console.log(data.allList) |
| | | mapOrder(data.allList) |
| | | getOrderData() |
| | | |
| | | }, function (data) { |
| | | }); |
| | | ajax.set("agentId",$("#agentId").val()); |
| | | ajax.set("type",$("#orderType").val()); |
| | | ajax.start(); |
| | | } |
| | | function resetOrder(){ |
| | | $("#agentId").val('') |
| | | $("#orderType").val('') |
| | | var ajax = new $ax(Feng.ctxPath + "/tHomePage/getMap", function (data) { |
| | | document.getElementById("onLineDriverCount").innerText=data.onLineDriverCount |
| | | document.getElementById("pendingOrderCount").innerText=data.pendingOrderCount |
| | | document.getElementById("serverCount").innerText=data.serverCount |
| | | document.getElementById("finishCount").innerText=data.finishCount |
| | | document.getElementById("cancelCount").innerText=data.cancelCount |
| | | $('#allList').val(data.allList); |
| | | mapOrder(data.allList) |
| | | getOrderData() |
| | | }, function (data) { |
| | | }); |
| | | ajax.set("agentId",$("#agentId").val()); |
| | | ajax.set("type",$("#orderType").val()); |
| | | ajax.start(); |
| | | } |
| | | |
| | | |
| | | function map(e,addressLon,addressLat){ |
| | | window._AMapSecurityConfig = { |
| | | securityJsCode:'b62d9146929db08c4c2f4537d045320d', |
| | | }; |
| | | // 创建地图实例 |
| | | var map = new AMap.Map("container", { |
| | | zoom: 13, |
| | | center: [103.924660,30.588548], |
| | | resizeEnable: true |
| | | }); |
| | | |
| | | AMapLoader.reset() // 需要把这个reset一下 |
| | | AMapLoader.load({ |
| | | "key": "1d43098bcd98ab124623e7e4bcc9595e", // 申请好的Web端开发者Key,首次调用 load 时必填 |
| | | "version": "2.0", // 指定要加载的 JSAPI 的版本,缺省时默认为 1.4.15 |
| | | "plugins": ['AMap.Driving'], // 需要使用的的插件列表,如比例尺'AMap.Scale'等 |
| | | "AMapUI": { // 是否加载 AMapUI,缺省不加载 |
| | | "version": '1.1', // AMapUI 版本 |
| | | "plugins":['overlay/SimpleMarker'], // 需要加载的 AMapUI ui插件 |
| | | }, |
| | | "Loca":{ // 是否加载 Loca, 缺省不加载 |
| | | "version": '2.0' // Loca 版本 |
| | | }, |
| | | }).then((AMap)=>{ |
| | | //初始化地图对象,加载地图 |
| | | var map = new AMap.Map('container', { |
| | | viewMode: '2D', // 默认使用 2D 模式,如果希望使用带有俯仰角的 3D 模式,请设置 viewMode: '3D', |
| | | zoom:10, //初始化地图层级 |
| | | center: [addressLon,addressLat] //初始化地图中心点 |
| | | }); |
| | | // map.clearMap(); // 清除地图覆盖物 |
| | | // 经纬度坐标数组 |
| | | |
| | | var onLineDriver; |
| | | if(e==""){ |
| | | onLineDriver = $('#onLineDriver').val(); |
| | | console.log("onLineDriver========================") |
| | | console.log(onLineDriver) |
| | | var list1 = JSON.stringify(onLineDriver) |
| | | console.log("list1========================") |
| | | console.log(list1) |
| | | const jsonArr = JSON.parse(list1) |
| | | console.log("jsonArr========================") |
| | | console.log(jsonArr) |
| | | const jsonArr1 = JSON.parse(jsonArr); |
| | | console.log("jsonArr1========================") |
| | | console.log(jsonArr1) |
| | | M = jsonArr1; |
| | | }else{ |
| | | M=e; |
| | | } |
| | | console.log("M =========================") |
| | | console.log(M) |
| | | M.forEach(function(marker) { |
| | | console.log("========================") |
| | | console.log(marker) |
| | | new AMap.Marker({ |
| | | map: map, |
| | | icon: marker[2]==1?'https://csxdj.obs.cn-south-1.myhuaweicloud.com/c1d2f38187de40daa353fcc70993288e.png':'https://csxdj.obs.cn-south-1.myhuaweicloud.com/c1d2f38187de40daa353fcc70993288e.png', |
| | | position: [marker[0], marker[1]], |
| | | offset: new AMap.Pixel(-13, -30) |
| | | }); |
| | | }); |
| | | |
| | | // var center = map.getCenter(); |
| | | // var centerText = '当前中心点坐标:' + center.getLng() + ',' + center.getLat(); |
| | | // 添加事件监听, 使地图自适应显示到合适的范围 |
| | | AMap.event.addDomListener(document.getElementById('container'), 'click', function() { |
| | | var newCenter = map.setFitView(); |
| | | }); |
| | | }).catch((e)=>{ |
| | | console.error(e); //加载错误提示 |
| | | }); |
| | | } |
| | | let texts = []; |
| | | function getMapData() { |
| | | map.remove(texts); |
| | | var ajax = new $ax(Feng.ctxPath + "/tHomePage/getMap", function (data) { |
| | | let lobby = data.lobby;//大厅 |
| | | let service = data.service;//服务中 |
| | | let receivedOrder = data.receivedOrder;//已接单 |
| | | let leisure = data.leisure;//空闲 |
| | | let cancel = data.cancel;//流失 |
| | | for (let i = 0; i < cancel.length; i++) { |
| | | let lonLat = cancel[i].lonLat; |
| | | let positon = lonLat.split(","); |
| | | var text = new AMap.Text({ |
| | | text:'流 失', |
| | | anchor:'center', // 设置文本标记锚点 |
| | | draggable:true, |
| | | cursor:'pointer', |
| | | style:{ |
| | | // 'padding': '.75rem 1.25rem', |
| | | // 'margin-bottom': '1rem', |
| | | // 'border-radius': '.25rem', |
| | | // 'background-color': 'white', |
| | | // 'width': '15rem', |
| | | 'border-width': 0, |
| | | 'box-shadow': '0 2px 6px 0 rgba(114, 124, 245, .5)', |
| | | 'text-align': 'center', |
| | | 'font-size': '16px', |
| | | 'color': 'red' |
| | | }, |
| | | position: [parseFloat(positon[0]),parseFloat(positon[1])] |
| | | }); |
| | | text.setMap(map); |
| | | texts.push(text); |
| | | } |
| | | for (let i = 0; i < lobby.length; i++) { |
| | | let lonLat = lobby[i].lonLat; |
| | | let positon = lonLat.split(","); |
| | | var text = new AMap.Text({ |
| | | text:'大 厅', |
| | | anchor:'center', // 设置文本标记锚点 |
| | | draggable:true, |
| | | cursor:'pointer', |
| | | style:{ |
| | | 'border-width': 0, |
| | | 'box-shadow': '0 2px 6px 0 rgba(114, 124, 245, .5)', |
| | | 'text-align': 'center', |
| | | 'font-size': '16px', |
| | | 'color': 'blue' |
| | | }, |
| | | position: [parseFloat(positon[0]),parseFloat(positon[1])] |
| | | }); |
| | | text.setMap(map); |
| | | texts.push(text); |
| | | } |
| | | for (let i = 0; i < leisure.length; i++) { |
| | | let name = leisure[i].name; |
| | | let lonLat = leisure[i].lonLat; |
| | | let positon = lonLat.split(","); |
| | | var text = new AMap.Text({ |
| | | text:name, |
| | | anchor:'center', // 设置文本标记锚点 |
| | | draggable:true, |
| | | cursor:'pointer', |
| | | style:{ |
| | | 'border-width': 0, |
| | | 'box-shadow': '0 2px 6px 0 rgba(114, 124, 245, .5)', |
| | | 'text-align': 'center', |
| | | 'font-size': '16px', |
| | | 'color': 'white', |
| | | 'background-color':'green' |
| | | }, |
| | | position: [parseFloat(positon[0]),parseFloat(positon[1])] |
| | | }); |
| | | text.setMap(map); |
| | | texts.push(text); |
| | | } |
| | | for (let i = 0; i < service.length; i++) { |
| | | let name = service[i].name; |
| | | let lonLat = service[i].lonLat; |
| | | let positon = lonLat.split(","); |
| | | var text = new AMap.Text({ |
| | | text:name, |
| | | anchor:'center', // 设置文本标记锚点 |
| | | draggable:true, |
| | | cursor:'pointer', |
| | | style:{ |
| | | 'border-width': 0, |
| | | 'box-shadow': '0 2px 6px 0 rgba(114, 124, 245, .5)', |
| | | 'text-align': 'center', |
| | | 'font-size': '16px', |
| | | 'color': 'white', |
| | | 'background-color':'red' |
| | | }, |
| | | position: [parseFloat(positon[0]),parseFloat(positon[1])] |
| | | }); |
| | | text.setMap(map); |
| | | texts.push(text); |
| | | } |
| | | for (let i = 0; i < receivedOrder.length; i++) { |
| | | let name = receivedOrder[i].name; |
| | | let lonLat = receivedOrder[i].lonLat; |
| | | let positon = lonLat.split(","); |
| | | var text = new AMap.Text({ |
| | | text:name, |
| | | anchor:'center', // 设置文本标记锚点 |
| | | draggable:true, |
| | | cursor:'pointer', |
| | | style:{ |
| | | 'border-width': 0, |
| | | 'box-shadow': '0 2px 6px 0 rgba(114, 124, 245, .5)', |
| | | 'text-align': 'center', |
| | | 'font-size': '16px', |
| | | 'color': 'black', |
| | | 'background-color':'yellow' |
| | | }, |
| | | position: [parseFloat(positon[0]),parseFloat(positon[1])] |
| | | }); |
| | | text.setMap(map); |
| | | texts.push(text); |
| | | } |
| | | }, function (data) { |
| | | }); |
| | | ajax.set("agentId", $("#agentId").val()); |
| | | ajax.start(); |
| | | } |
| | | getMapData(); |
| | | setInterval(function () { |
| | | getMapData(); |
| | | }, 30000); |
| | | |
| | | function mapOrder(e){ |
| | | window._AMapSecurityConfig = { |
| | |
| | | <form class="m-t" role="form" action="${ctxPath}/login" method="post"> |
| | | <div class="item"> |
| | | <img src="${ctxPath}/static/img/account.png" /> |
| | | <input class="itemInput" type="text" name="username" id="username" placeholder="请输入您的账号" required="" value=""> |
| | | <input class="itemInput" type="text" name="username" id="username" placeholder="请输入您的账号" required="" value="admin"> |
| | | </div> |
| | | <div class="item"> |
| | | <img src="${ctxPath}/static/img/password.png" /> |
| | | <input class="itemInput" type="password" name="password" id="password" placeholder="请输入您的密码" required="" value=""> |
| | | <input class="itemInput" type="password" name="password" id="password" placeholder="请输入您的密码" required="" value="111111"> |
| | | </div> |
| | | <div id="verify" style="display: none"> |
| | | @if(kaptcha.getKaptchaOnOff() == true){ |
| | |
| | | <input type="hidden" id="provCodeBank1" value="${item.provCodeBank}"> |
| | | <input type="hidden" id="areaCodeBank1" value="${item.areaCodeBank}"> |
| | | <div class="row"> |
| | | <div class="col-sm-6"> |
| | | <div class="col-sm-8"> |
| | | <div class="form-group"> |
| | | 企业信息 |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">*负责人姓名:</label> |
| | | <div class="col-sm-9"> |
| | | <label class="col-sm-2 control-label">*负责人姓名:</label> |
| | | <div class="col-sm-5"> |
| | | <input class="form-control" id="principal" name="principal" value="${item.principal}" placeholder="请输入"> |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">*联系电话:</label> |
| | | <div class="col-sm-9"> |
| | | <label class="col-sm-2 control-label">*联系电话:</label> |
| | | <div class="col-sm-5"> |
| | | <input class="form-control" id="principalPhone" name="principalPhone" value="${item.principalPhone}" maxlength="11" type="number" placeholder="请输入"> |
| | | </div> |
| | | </div> |
| | | <div class="form-group" ${roleType == 1 ? 'hidden' : ''}> |
| | | <input id="areaId" type="hidden"> |
| | | <label class="col-sm-3 control-label">*代理区域:</label> |
| | | <div class="col-sm-9"> |
| | | <label class="col-sm-2 control-label">*代理区域:</label> |
| | | <div class="col-sm-5"> |
| | | <input class="form-control" id="area" onclick="TAgent.area()" name="area" value="${item.provinceName}/${item.cityName}" placeholder="请选择" readonly> |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">*邮箱:</label> |
| | | <div class="col-sm-9"> |
| | | <label class="col-sm-2 control-label">*邮箱:</label> |
| | | <div class="col-sm-5"> |
| | | <input class="form-control" id="email" name="email" type="email" value="${item.email}" maxlength="40" placeholder="请输入"> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="row" ${roleType == 1 ? 'hidden' : ''}> |
| | | <div class="col-sm-6"> |
| | | <div class="col-sm-8"> |
| | | <div class="form-group"> |
| | | 商户信息 |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">*商户类型:</label> |
| | | <div class="col-sm-9"> |
| | | <label class="col-sm-2 control-label">*商户类型:</label> |
| | | <div class="col-sm-5"> |
| | | <select class="form-control" id="userType"> |
| | | <option value="0" ${item.userType == 0 ? 'selected' : '' }>小微商户</option> |
| | | <option value="1" ${item.userType == 1 ? 'selected' : '' }>个体工商户</option> |
| | |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">*姓名:</label> |
| | | <div class="col-sm-9"> |
| | | <label class="col-sm-2 control-label">*姓名:</label> |
| | | <div class="col-sm-5"> |
| | | <input class="form-control" id="merchantName" name="merchantName" value="${item.merchantName}" type="text" maxlength="20" placeholder="请输入"> |
| | | </div> |
| | | </div> |
| | | <div class="form-group qy"> |
| | | <label class="col-sm-3 control-label">*经营范围:</label> |
| | | <div class="col-sm-9"> |
| | | <label class="col-sm-2 control-label">*经营范围:</label> |
| | | <div class="col-sm-5"> |
| | | <input class="form-control" id="businessScope" name="businessScope" value="${item.businessScope}" type="text" maxlength="20" placeholder="请输入"> |
| | | </div> |
| | | </div> |
| | | <div class="form-group qy"> |
| | | <label class="col-sm-3 control-label">*统一社会信用码:</label> |
| | | <div class="col-sm-9"> |
| | | <label class="col-sm-2 control-label">*统一社会信用码:</label> |
| | | <div class="col-sm-5"> |
| | | <input class="form-control" id="socialCreditCode" name="socialCreditCode" value="${item.socialCreditCode}" type="text" maxlength="20" placeholder="请输入"> |
| | | </div> |
| | | </div> |
| | | <div class="form-group qy"> |
| | | <label class="col-sm-3 control-label">*统一社会信用证有效期:</label> |
| | | <div class="col-sm-9"> |
| | | <label class="col-sm-2 control-label">*统一社会信用证有效期:</label> |
| | | <div class="col-sm-5"> |
| | | <input class="form-control" id="socialCreditCodeExpires" name="socialCreditCodeExpires" value="${socialCreditCodeExpires}" type="text" maxlength="20" placeholder="请输入"> |
| | | </div> |
| | | </div> |
| | | <div class="form-group qy"> |
| | | <label class="col-sm-3 control-label">*地区:</label> |
| | | <div class="col-sm-4"> |
| | | <label class="col-sm-2 control-label">*地区:</label> |
| | | <div class="col-sm-3"> |
| | | <select class="form-control" id="provCodeEnterprise" name="provCodeEnterprise" onchange="initArea(this, 'areaCodeEnterprise')"></select> |
| | | </div> |
| | | <div class="col-sm-4"> |
| | | <div class="col-sm-3"> |
| | | <select class="form-control" id="areaCodeEnterprise" name="areaCodeEnterprise"></select> |
| | | </div> |
| | | </div> |
| | | <div class="form-group qy"> |
| | | <label class="col-sm-3 control-label">*企业详细地址:</label> |
| | | <div class="col-sm-9"> |
| | | <label class="col-sm-2 control-label">*企业详细地址:</label> |
| | | <div class="col-sm-5"> |
| | | <input class="form-control" id="address" name="address" value="${item.address}" type="text" maxlength="20" placeholder="请输入"> |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">*结算账户名:</label> |
| | | <div class="col-sm-9"> |
| | | <label class="col-sm-2 control-label">*结算账户名:</label> |
| | | <div class="col-sm-5"> |
| | | <input class="form-control" id="cardName" name="cardName" value="${item.cardName}" type="text" maxlength="20" placeholder="请输入"> |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">*结算账户号:</label> |
| | | <div class="col-sm-9"> |
| | | <label class="col-sm-2 control-label">*结算账户号:</label> |
| | | <div class="col-sm-5"> |
| | | <input class="form-control" id="cardNo" name="cardNo" value="${item.cardNo}" type="text" maxlength="20" placeholder="请输入"> |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">*银行账户类型:</label> |
| | | <div class="col-sm-9"> |
| | | <label class="col-sm-2 control-label">*银行账户类型:</label> |
| | | <div class="col-sm-5"> |
| | | <select class="form-control" id="bankAcctType"> |
| | | <option value="1" ${item.bankAcctType == 1 ? 'selected' : ''}>对公</option> |
| | | <option value="2" ${item.bankAcctType == 2 ? 'selected' : ''}>对私</option> |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="col-sm-6"> |
| | | <div class="col-sm-8"> |
| | | <div class="form-group"> |
| | | </div> |
| | | <div class="form-group qy"> |
| | | <label class="col-sm-3 control-label">*法人姓名:</label> |
| | | <div class="col-sm-9"> |
| | | <label class="col-sm-2 control-label">*法人姓名:</label> |
| | | <div class="col-sm-5"> |
| | | <input class="form-control" id="legalPerson" name="legalPerson" value="${item.legalPerson}" type="text" maxlength="20" placeholder="请输入"> |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">*身份证号:</label> |
| | | <div class="col-sm-9"> |
| | | <label class="col-sm-2 control-label">*身份证号:</label> |
| | | <div class="col-sm-5"> |
| | | <input class="form-control" id="merchantIDCode" name="merchantIDCode" value="${item.merchantIDCode}" type="text" maxlength="20" placeholder="请输入"> |
| | | </div> |
| | | </div> |
| | | <div class="form-group qy"> |
| | | <label class="col-sm-3 control-label">*法人身份证有效期:</label> |
| | | <div class="col-sm-9"> |
| | | <label class="col-sm-2 control-label">*法人身份证有效期:</label> |
| | | <div class="col-sm-5"> |
| | | <input class="form-control" id="certIdExpires" name="certIdExpires" value="${certIdExpires}"> |
| | | </div> |
| | | </div> |
| | | <div class="form-group qy"> |
| | | <label class="col-sm-3 control-label">*法人手机号:</label> |
| | | <div class="col-sm-9"> |
| | | <label class="col-sm-2 control-label">*法人手机号:</label> |
| | | <div class="col-sm-5"> |
| | | <input class="form-control" id="legalPhone" name="legalPhone" value="${item.legalPhone}" type="text" maxlength="11" placeholder="请输入"> |
| | | </div> |
| | | </div> |
| | | <div class="form-group qy"> |
| | | <label class="col-sm-3 control-label">营业执照扫描件:</label> |
| | | <div class="col-sm-7"> |
| | | <label class="col-sm-2 control-label">营业执照扫描件:</label> |
| | | <div class="col-sm-5"> |
| | | <input class="form-control" id="fileNo" name="fileNo" value="${item.fileNo}" value="" readonly style="height: 100%;width: 100%;border: none;"/> |
| | | </div> |
| | | <div class="col-sm-2"> |
| | |
| | | <input type="file" id="file" style="display: none;"> |
| | | </div> |
| | | <div class="form-group qy"> |
| | | <label class="col-sm-3 control-label">*银行名称:</label> |
| | | <div class="col-sm-9"> |
| | | <label class="col-sm-2 control-label">*银行名称:</label> |
| | | <div class="col-sm-5"> |
| | | <select class="form-control" id="bankCode" name="bankCode"> |
| | | <option value="01020000" ${item.bankAcctType == '01020000' ? 'selected' : ''}>工商银行</option> |
| | | <option value="01030000" ${item.bankAcctType == '01030000' ? 'selected' : ''}>农业银行</option> |
| | |
| | | </div> |
| | | </div> |
| | | <div class="form-group qy"> |
| | | <label class="col-sm-3 control-label">*开户行地区:</label> |
| | | <div class="col-sm-4"> |
| | | <label class="col-sm-2 control-label">*开户行地区:</label> |
| | | <div class="col-sm-3"> |
| | | <select class="form-control" id="provCodeBank" name="provCodeBank" onchange="initArea(this, 'areaCodeBank')"></select> |
| | | </div> |
| | | <div class="col-sm-4"> |
| | | <div class="col-sm-3"> |
| | | <select class="form-control" id="areaCodeBank" name="areaCodeBank"></select> |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">*银行预留手机号:</label> |
| | | <div class="col-sm-9"> |
| | | <label class="col-sm-2 control-label">*银行预留手机号:</label> |
| | | <div class="col-sm-5"> |
| | | <input class="form-control" id="phone" name="phone" value="${item.phone}" type="number" maxlength="11" placeholder="请输入"> |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">*注册状态:</label> |
| | | <div class="col-sm-4"> |
| | | <label class="col-sm-2 control-label">*注册状态:</label> |
| | | <div class="col-sm-3"> |
| | | 商户开户状态: |
| | | </div> |
| | | <div class="col-sm-4"> |
| | | <div class="col-sm-3"> |
| | | 结算账户绑定状态: |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="row"> |
| | | <div class="col-sm-6"> |
| | | <div class="col-sm-8"> |
| | | <div class="form-group"> |
| | | 账户信息 |
| | | </div> |
| | | <div class="form-group" ${roleType != 1 ? 'hidden' : ''}> |
| | | <label class="col-sm-3 control-label">充值余额:</label> |
| | | <div class="col-sm-3"> |
| | | <label class="col-sm-2 control-label">充值余额:</label> |
| | | <div class="col-sm-2"> |
| | | <span>${marketingAmount}</span> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <div class="col-sm-2"> |
| | | <input class="form-control" id="amount" type="number" min="0" placeholder="请输入充值金额"> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <div class="col-sm-2"> |
| | | <button onclick="accountRecharge()">充值</button> |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">可提现余额:</label> |
| | | <label class="col-sm-2 control-label">可提现余额:</label> |
| | | <div class="col-sm-3"> |
| | | <span id="balance">${balance}</span> |
| | | </div> |
| | |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">提现记录:</label> |
| | | <div class="col-sm-9"> |
| | | <table> |
| | | <thead> |
| | | <tr><th>提现时间</th><th>提现金额</th><th>到账时间</th></tr> |
| | | </thead> |
| | | <tbody> |
| | | @for(obj in settlementRecords){ |
| | | <tr><td>${obj.insertTime}</td><td>${obj.amount}</td><td>${obj.arrivalTime}</td></tr> |
| | | @} |
| | | </tbody> |
| | | </table> |
| | | <label class="col-sm-2 control-label">交易类型:</label> |
| | | <div class="col-sm-3"> |
| | | <select class="form-control" id="type"> |
| | | <option value="">全部</option> |
| | | <option value="1">充值</option> |
| | | <option value="2">提现</option> |
| | | <option value="3">佣金收入</option> |
| | | <option value="4">保险收入</option> |
| | | <option value="5">补贴支付</option> |
| | | </select> |
| | | </div> |
| | | <label class="col-sm-1 control-label">时间:</label> |
| | | <div class="col-sm-3"> |
| | | <input class="form-control" id="timeS"/> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <#button name="查询" icon="fa-search" clickFun="EnterprisePage.search()"/> |
| | | <#button name="重置" icon="fa-trash" clickFun="EnterprisePage.resetSearch()" space="true"/> |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-2 control-label">明细记录:</label> |
| | | <div class="col-sm-10"> |
| | | <#table id="EnterprisePageTable"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/static/modular/system/tAgent/tAgent_info.js"></script> |
| | |
| | | <script src="${ctxPath}/static/js/qrcode.js"></script> |
| | | <script src="${ctxPath}/static/js/jquery.qrcode.js"></script> |
| | | <script type="text/javascript"> |
| | | let EnterprisePage = { |
| | | table: null, |
| | | }; |
| | | |
| | | var citys = [{"value":"0011","title":"北京市","cities":[{"value":"1100","title":"北京市"}]},{"value":"0012","title":"天津市","cities":[{"value":"1200","title":"天津市"}]},{"value":"0013","title":"河北省","cities":[{"value":"1301","title":"石家庄"},{"value":"1302","title":"保定"},{"value":"1303","title":"沧州"},{"value":"1304","title":"承德"},{"value":"1305","title":"邯郸"},{"value":"1306","title":"衡水"},{"value":"1307","title":"廊坊"},{"value":"1308","title":"秦皇岛"},{"value":"1309","title":"唐山"},{"value":"1310","title":"邢台"},{"value":"1311","title":"张家口"}]},{"value":"0014","title":"山西省","cities":[{"value":"1401","title":"太原"},{"value":"1402","title":"长治"},{"value":"1403","title":"大同"},{"value":"1404","title":"晋城"},{"value":"1405","title":"离石"},{"value":"1406","title":"临汾"},{"value":"1407","title":"朔州"},{"value":"1408","title":"忻州"},{"value":"1409","title":"阳泉"},{"value":"1410","title":"榆次"},{"value":"1411","title":"运城"},{"value":"1412","title":"晋中"},{"value":"1413","title":"吕梁"}]},{"value":"0015","title":"内蒙古自治区","cities":[{"value":"1501","title":"呼和浩特"},{"value":"1502","title":"包头"},{"value":"1503","title":"阿拉善"},{"value":"1504","title":"巴彦淖尔"},{"value":"1505","title":"赤峰"},{"value":"1506","title":"呼伦贝尔"},{"value":"1507","title":"乌海"},{"value":"1508","title":"乌兰察布"},{"value":"1509","title":"锡林郭勒"},{"value":"1510","title":"兴安"},{"value":"1511","title":"鄂尔多斯"},{"value":"1512","title":"通辽"},{"value":"1513","title":"满洲里"}]},{"value":"0021","title":"辽宁省","cities":[{"value":"2101","title":"沈阳"},{"value":"2102","title":"大连"},{"value":"2103","title":"鞍山"},{"value":"2104","title":"本溪"},{"value":"2105","title":"朝阳"},{"value":"2106","title":"丹东"},{"value":"2107","title":"抚顺"},{"value":"2108","title":"阜新"},{"value":"2109","title":"葫芦岛"},{"value":"2110","title":"锦州"},{"value":"2111","title":"辽阳"},{"value":"2112","title":"盘锦"},{"value":"2113","title":"铁岭"},{"value":"2114","title":"营口"}]},{"value":"0022","title":"吉林省","cities":[{"value":"2201","title":"长春"},{"value":"2202","title":"白城"},{"value":"2203","title":"白山"},{"value":"2204","title":"吉林"},{"value":"2205","title":"辽源"},{"value":"2206","title":"四平"},{"value":"2207","title":"松原"},{"value":"2208","title":"通化"},{"value":"2209","title":"延边"}]},{"value":"0023","title":"黑龙江省","cities":[{"value":"2301","title":"哈尔滨"},{"value":"2302","title":"大庆"},{"value":"2303","title":"大兴安岭"},{"value":"2304","title":"鹤岗"},{"value":"2305","title":"黑河"},{"value":"2306","title":"鸡西"},{"value":"2307","title":"佳木斯"},{"value":"2308","title":"牡丹江"},{"value":"2309","title":"七台河"},{"value":"2310","title":"齐齐哈尔"},{"value":"2311","title":"双鸭山"},{"value":"2312","title":"绥化"},{"value":"2313","title":"伊春"}]},{"value":"0031","title":"上海市","cities":[{"value":"3100","title":"上海市"}]},{"value":"0032","title":"江苏省","cities":[{"value":"3201","title":"南京"},{"value":"3202","title":"常州"},{"value":"3203","title":"淮安"},{"value":"3204","title":"连云港"},{"value":"3205","title":"南通"},{"value":"3206","title":"苏州"},{"value":"3207","title":"宿迁"},{"value":"3208","title":"泰州"},{"value":"3209","title":"无锡"},{"value":"3210","title":"徐州"},{"value":"3211","title":"盐城"},{"value":"3212","title":"扬州"},{"value":"3213","title":"镇江"},{"value":"3214","title":"胥浦"},{"value":"3215","title":"昆山"}]},{"value":"0033","title":"浙江省","cities":[{"value":"3301","title":"杭州"},{"value":"3302","title":"宁波"},{"value":"3303","title":"湖州"},{"value":"3304","title":"嘉兴"},{"value":"3305","title":"金华"},{"value":"3306","title":"绍兴"},{"value":"3307","title":"台州"},{"value":"3308","title":"温州"},{"value":"3309","title":"舟山"},{"value":"3310","title":"衢州"},{"value":"3311","title":"丽水"}]},{"value":"0034","title":"安徽省","cities":[{"value":"3401","title":"合肥"},{"value":"3402","title":"安庆"},{"value":"3403","title":"蚌埠"},{"value":"3404","title":"巢湖"},{"value":"3405","title":"池州"},{"value":"3406","title":"滁州"},{"value":"3407","title":"阜阳"},{"value":"3408","title":"淮北"},{"value":"3409","title":"淮南"},{"value":"3410","title":"黄山"},{"value":"3411","title":"六安"},{"value":"3412","title":"马鞍山"},{"value":"3414","title":"铜陵"},{"value":"3415","title":"芜湖"},{"value":"3416","title":"宣城"},{"value":"3417","title":"亳州"},{"value":"3418","title":"宿州"}]},{"value":"0035","title":"福建省","cities":[{"value":"3501","title":"福州"},{"value":"3502","title":"厦门"},{"value":"3503","title":"龙岩"},{"value":"3504","title":"南平"},{"value":"3505","title":"宁德"},{"value":"3506","title":"莆田"},{"value":"3507","title":"泉州"},{"value":"3508","title":"三明"},{"value":"3509","title":"漳州"}]},{"value":"0036","title":"江西省","cities":[{"value":"3601","title":"南昌"},{"value":"3602","title":"抚州"},{"value":"3603","title":"赣州"},{"value":"3604","title":"吉安"},{"value":"3605","title":"景德镇"},{"value":"3606","title":"九江"},{"value":"3607","title":"萍乡"},{"value":"3608","title":"上饶"},{"value":"3609","title":"新余"},{"value":"3610","title":"宜春"},{"value":"3611","title":"鹰潭"}]},{"value":"0037","title":"山东省","cities":[{"value":"3701","title":"济南"},{"value":"3702","title":"青岛"},{"value":"3703","title":"滨州"},{"value":"3704","title":"德州"},{"value":"3705","title":"东营"},{"value":"3706","title":"菏泽"},{"value":"3707","title":"济宁"},{"value":"3708","title":"莱芜"},{"value":"3709","title":"聊城"},{"value":"3710","title":"临沂"},{"value":"3711","title":"日照"},{"value":"3712","title":"泰安"},{"value":"3713","title":"威海"},{"value":"3714","title":"潍坊"},{"value":"3715","title":"烟台"},{"value":"3716","title":"枣庄"},{"value":"3717","title":"淄博"}]},{"value":"0041","title":"河南省","cities":[{"value":"4101","title":"郑州"},{"value":"4102","title":"安阳"},{"value":"4103","title":"焦作"},{"value":"4104","title":"鹤壁"},{"value":"4105","title":"开封"},{"value":"4106","title":"洛阳"},{"value":"4107","title":"南阳"},{"value":"4108","title":"平顶山"},{"value":"4109","title":"三门峡"},{"value":"4110","title":"商丘"},{"value":"4111","title":"新乡"},{"value":"4112","title":"信阳"},{"value":"4113","title":"许昌"},{"value":"4114","title":"周口"},{"value":"4115","title":"驻马店"},{"value":"4116","title":"漯河"},{"value":"4117","title":"濮阳"},{"value":"4118","title":"济源"}]},{"value":"0042","title":"湖北省","cities":[{"value":"4201","title":"武汉"},{"value":"4202","title":"鄂州"},{"value":"4203","title":"恩施"},{"value":"4204","title":"黄冈"},{"value":"4205","title":"黄石"},{"value":"4206","title":"荆门"},{"value":"4207","title":"荆州"},{"value":"4208","title":"十堰"},{"value":"4209","title":"随州"},{"value":"4210","title":"咸宁"},{"value":"4211","title":"襄樊"},{"value":"4212","title":"孝感"},{"value":"4213","title":"神农架"},{"value":"4214","title":"天门"},{"value":"4215","title":"宜昌"},{"value":"4216","title":"三峡"},{"value":"4217","title":"潜江"},{"value":"4218","title":"仙桃"}]},{"value":"0043","title":"湖南省","cities":[{"value":"4301","title":"长沙"},{"value":"4302","title":"常德"},{"value":"4303","title":"郴州"},{"value":"4304","title":"衡阳"},{"value":"4305","title":"怀化"},{"value":"4306","title":"娄底"},{"value":"4307","title":"邵阳"},{"value":"4308","title":"湘潭"},{"value":"4309","title":"湘西"},{"value":"4310","title":"益阳"},{"value":"4311","title":"永州"},{"value":"4312","title":"岳阳"},{"value":"4313","title":"张家界"},{"value":"4314","title":"株洲"},{"value":"4331","title":"吉首"}]},{"value":"0044","title":"广东省","cities":[{"value":"4401","title":"广州"},{"value":"4402","title":"深圳"},{"value":"4403","title":"潮州"},{"value":"4404","title":"东莞"},{"value":"4405","title":"佛山"},{"value":"4406","title":"惠州"},{"value":"4407","title":"江门"},{"value":"4408","title":"揭阳"},{"value":"4409","title":"茂名"},{"value":"4410","title":"梅州"},{"value":"4411","title":"清远"},{"value":"4412","title":"汕头"},{"value":"4413","title":"汕尾"},{"value":"4414","title":"韶关"},{"value":"4415","title":"阳江"},{"value":"4416","title":"云浮"},{"value":"4417","title":"湛江"},{"value":"4418","title":"肇庆"},{"value":"4419","title":"中山"},{"value":"4420","title":"河源"},{"value":"4421","title":"珠海"}]},{"value":"0045","title":"广西壮族自治区","cities":[{"value":"4501","title":"南宁"},{"value":"4502","title":"百色"},{"value":"4503","title":"北海"},{"value":"4504","title":"桂林"},{"value":"4505","title":"河池"},{"value":"4506","title":"柳州"},{"value":"4507","title":"梧州"},{"value":"4508","title":"玉林"},{"value":"4509","title":"崇左"},{"value":"4510","title":"防城港"},{"value":"4511","title":"贵港"},{"value":"4512","title":"贺州"},{"value":"4513","title":"来宾"},{"value":"4514","title":"钦州"}]},{"value":"0046","title":"海南省","cities":[{"value":"4601","title":"海口"},{"value":"4602","title":"三亚"},{"value":"4603","title":"白沙"},{"value":"4604","title":"保亭"},{"value":"4605","title":"昌江"},{"value":"4606","title":"澄迈"},{"value":"4607","title":"儋州"},{"value":"4608","title":"定安"},{"value":"4609","title":"东方"},{"value":"4610","title":"乐东"},{"value":"4611","title":"临高"},{"value":"4612","title":"陵水"},{"value":"4613","title":"琼海"},{"value":"4614","title":"琼中"},{"value":"4615","title":"屯昌"},{"value":"4616","title":"万宁"},{"value":"4617","title":"文昌"},{"value":"4618","title":"五指山"},{"value":"4619","title":"洋浦"}]},{"value":"0050","title":"重庆市","cities":[{"value":"5000","title":"重庆市"}]},{"value":"0051","title":"四川省","cities":[{"value":"5101","title":"成都"},{"value":"5102","title":"巴中"},{"value":"5103","title":"达州"},{"value":"5104","title":"德阳"},{"value":"5105","title":"广安"},{"value":"5106","title":"广元"},{"value":"5107","title":"乐山"},{"value":"5108","title":"凉山"},{"value":"5109","title":"眉山"},{"value":"5110","title":"绵阳"},{"value":"5111","title":"南充"},{"value":"5112","title":"内江"},{"value":"5113","title":"攀枝花"},{"value":"5114","title":"遂宁"},{"value":"5115","title":"雅安"},{"value":"5116","title":"宜宾"},{"value":"5117","title":"自贡"},{"value":"5118","title":"泸州"},{"value":"5119","title":"阿坝"},{"value":"5120","title":"甘孜"},{"value":"5121","title":"资阳"}]},{"value":"0052","title":"贵州省","cities":[{"value":"5201","title":"贵阳"},{"value":"5202","title":"安顺"},{"value":"5203","title":"毕节"},{"value":"5204","title":"六盘水"},{"value":"5205","title":"铜仁"},{"value":"5206","title":"遵义"},{"value":"5207","title":"黔东南"},{"value":"5208","title":"黔南"},{"value":"5209","title":"黔西南"}]},{"value":"0053","title":"云南省","cities":[{"value":"5301","title":"昆明"},{"value":"5302","title":"西双版纳"},{"value":"5303","title":"保山"},{"value":"5304","title":"楚雄"},{"value":"5305","title":"大理"},{"value":"5306","title":"德宏"},{"value":"5307","title":"红河"},{"value":"5308","title":"丽江"},{"value":"5309","title":"临沧"},{"value":"5310","title":"怒江"},{"value":"5311","title":"曲靖"},{"value":"5312","title":"思茅"},{"value":"5313","title":"文山"},{"value":"5314","title":"玉溪"},{"value":"5315","title":"昭通"},{"value":"5316","title":"中甸"},{"value":"5317","title":"迪庆州"}]},{"value":"0054","title":"西藏自治区","cities":[{"value":"5401","title":"拉萨"},{"value":"5402","title":"阿里"},{"value":"5403","title":"昌都"},{"value":"5404","title":"林芝"},{"value":"5405","title":"那曲"},{"value":"5406","title":"日喀则"},{"value":"5407","title":"山南"},{"value":"5424","title":"樟木口岸"}]},{"value":"0061","title":"陕西省","cities":[{"value":"6101","title":"西安"},{"value":"6102","title":"安康"},{"value":"6103","title":"宝鸡"},{"value":"6104","title":"汉中"},{"value":"6105","title":"商洛"},{"value":"6106","title":"铜川"},{"value":"6107","title":"渭南"},{"value":"6108","title":"咸阳"},{"value":"6109","title":"延安"},{"value":"6110","title":"榆林"}]},{"value":"0062","title":"甘肃省","cities":[{"value":"6201","title":"兰州"},{"value":"6202","title":"白银"},{"value":"6203","title":"定西"},{"value":"6204","title":"东风"},{"value":"6205","title":"合作"},{"value":"6206","title":"嘉峪关"},{"value":"6207","title":"金昌"},{"value":"6208","title":"酒泉"},{"value":"6209","title":"矿区"},{"value":"6210","title":"临夏"},{"value":"6211","title":"陇南"},{"value":"6212","title":"平凉"},{"value":"6213","title":"庆阳"},{"value":"6214","title":"天水"},{"value":"6215","title":"武威"},{"value":"6216","title":"张掖"},{"value":"6217","title":"甘南州"}]},{"value":"0063","title":"青海省","cities":[{"value":"6301","title":"西宁"},{"value":"6302","title":"海东"},{"value":"6322","title":"海北"},{"value":"6323","title":"黄南"},{"value":"6325","title":"海南"},{"value":"6326","title":"果洛"},{"value":"6327","title":"玉树"},{"value":"6328","title":"海西"}]},{"value":"0064","title":"宁夏回族自治区","cities":[{"value":"6401","title":"银川"},{"value":"6402","title":"中卫"},{"value":"6403","title":"固原"},{"value":"6404","title":"石嘴山"},{"value":"6405","title":"吴忠"}]},{"value":"0065","title":"新疆维吾尔自治区","cities":[{"value":"6501","title":"乌鲁木齐"},{"value":"6502","title":"阿克苏"},{"value":"6503","title":"阿勒泰"},{"value":"6504","title":"巴州"},{"value":"6505","title":"博州"},{"value":"6506","title":"昌吉"},{"value":"6507","title":"哈密"},{"value":"6508","title":"和田"},{"value":"6509","title":"喀什"},{"value":"6510","title":"克拉玛依"},{"value":"6511","title":"马兰"},{"value":"6512","title":"石河子"},{"value":"6513","title":"塔城"},{"value":"6514","title":"吐鲁番"},{"value":"6515","title":"伊犁"},{"value":"6516","title":"克州"},{"value":"6517","title":"阿拉尔"},{"value":"6518","title":"五家渠"}]},{"value":"2003","title":"台湾省","cities":[{"value":"9903","title":"台湾省"}]},{"value":"2001","title":"香港特别行政区","cities":[{"value":"9901","title":"香港特别行政区"}]},{"value":"2002","title":"澳门特别行政区","cities":[{"value":"9902","title":"澳门特别行政区"}]}]; |
| | | laydate.render({ |
| | | elem: '#socialCreditCodeExpires', |
| | |
| | | laydate.render({ |
| | | elem: '#certIdExpires', |
| | | type: "date" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#timeS', |
| | | type: "date", |
| | | range: true |
| | | }); |
| | | $('#userType').change(function () { |
| | | let userType = $(this).val(); |
| | |
| | | } |
| | | |
| | | |
| | | EnterprisePage.search = function () { |
| | | var queryData = {}; |
| | | queryData['type'] = $("#type").val(); |
| | | queryData['time'] = $("#timeS").val(); |
| | | EnterprisePage.table.refresh({query: queryData}); |
| | | }; |
| | | |
| | | EnterprisePage.resetSearch = function (){ |
| | | $("#type").val(''); |
| | | $("#timeS").val(''); |
| | | EnterprisePage.search(); |
| | | } |
| | | |
| | | |
| | | |
| | | $(function () { |
| | | initCity('provCodeBank'); |
| | |
| | | $('#provCodeEnterprise').val($('#provCodeEnterprise1').val()); |
| | | initArea($('#provCodeEnterprise'), 'areaCodeEnterprise'); |
| | | $('#areaCodeEnterprise').val($('#areaCodeEnterprise1').val()); |
| | | |
| | | $('#userType').change(); |
| | | |
| | | let tables = [ |
| | | {field: 'selectItem', radio: true}, |
| | | // {title: '主键', field: 'id', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '到账时间', field: 'createTime', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '交易类型', field: 'type', visible: true, align: 'center', valign: 'middle', |
| | | formatter: function (value, row) { |
| | | switch (value) { |
| | | case 1: |
| | | return '充值' |
| | | case 2: |
| | | return '提现' |
| | | case 3: |
| | | return '佣金收入' |
| | | case 4: |
| | | return '保险收入' |
| | | case 5: |
| | | return '补贴支付' |
| | | } |
| | | } |
| | | }, |
| | | {title: '司机姓名', field: 'driverName', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '交易金额', field: 'money', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '账户余额', field: 'balance', visible: true, align: 'center', valign: 'middle'} |
| | | ] |
| | | |
| | | var table = new BSTable("EnterprisePageTable", "/tAgent/queryCompanyFundFlow", tables); |
| | | table.setPaginationType("server"); |
| | | EnterprisePage.table = table.init(); |
| | | }) |
| | | </script> |
| | | @} |
| | |
| | | <#button name="导出" icon="" clickFun="TAgent.export()"/> |
| | | @} |
| | | @if(shiro.hasPermission("/tAgent/add")){ |
| | | <#button name="添加" icon="fa-plus" clickFun="TAgent.openAddTAgent()"/> |
| | | <#button name="添加" icon="fa-plus" clickFun="TAgent.openAddTAgent()" space="true"/> |
| | | @} |
| | | @if(shiro.hasPermission("/tAgent/update")){ |
| | | <#button name="编辑" icon="fa-edit" clickFun="TAgent.openUpdateTAgent()" space="true"/> |
| | | @} |
| | | @if(shiro.hasPermission("/tAgent/stop")){ |
| | | <#button name="冻结" icon="fa-edit" clickFun="TAgent.stop()" space="true"/> |
| | | @} |
| | | @if(shiro.hasPermission("/tAgent/start")){ |
| | | <#button name="启动" icon="fa-edit" clickFun="TAgent.start()" space="true"/> |
| | | @} |
| | | </div> |
| | | <#table id="TAgentTable"/> |
| | |
| | | <div class="ibox-title"> |
| | | <h5>管理</h5> |
| | | </div> |
| | | <input type="hidden" id="id" value="${id}"> |
| | | <div class="ibox-content"> |
| | | <div class="row row-lg"> |
| | | <div class="col-sm-12"> |
| | |
| | | <hr/> |
| | | |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <label class="control-label" >时间筛选:</label> |
| | | <input id="time" placeholder="请选择时间" style="height: 30px"> |
| | | <#button name="查询" icon="fa-search" clickFun="search()"/> |
| | | </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> |
| | | <span>${startTimeToEndTime}</span> |
| | | <label class="control-label" >累计订单数:</label> |
| | | <label id="orderSum">${orderSum}</label> |
| | | </div> |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <label class="control-label" >累计获得分账金额:</label> |
| | | <label id="income">${income}</label> |
| | | </div> |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <label class="control-label" >已使用优惠券数量:</label> |
| | | <label id="usedCoupon">${usedCoupon}</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>${orderSum}</label>单 |
| | | <label class="control-label" >有效订单数:</label> |
| | | <label id="validOrder">${validOrder}</label> |
| | | </div> |
| | | <div class="initialLevel col-sm-2 control-label form-group" > |
| | | <label class="control-label">累计优惠券金额:</label> |
| | | <label>${couponPriceSum}</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>${validOrder}</label>单 |
| | | <label class="control-label" >可提现金额:</label> |
| | | <label id="balances">${balance}</label> |
| | | </div> |
| | | <div class="initialLevel col-sm-2 control-label form-group" > |
| | | <label class="control-label">累计发放司机金额:</label> |
| | | <label>${driverRecharge}</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>${issuedCoupon}</label>张 |
| | | </div> |
| | | <div class="initialLevel col-sm-2 control-label form-group" > |
| | | <label class="control-label">司机数量:</label> |
| | | <label>${driverCount}</label>人 |
| | | <label class="control-label" >累计优惠券金额:</label> |
| | | <label id="couponPriceSum">${couponPriceSum}</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>${usedCoupon}</label>张 |
| | | <div class="row"> |
| | | <div class="form-group"> |
| | | <label class="col-sm-2 control-label">明细记录:</label> |
| | | <div class="col-sm-10"> |
| | | <#table id="EnterprisePageTable"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | type: 'date', |
| | | range: true |
| | | }); |
| | | laydate.render({ |
| | | elem: '#time', |
| | | type: 'date', |
| | | range: true |
| | | }); |
| | | |
| | | function search() { |
| | | var ajax = new $ax(Feng.ctxPath + "/tAgent/queryAgentSummaryData", function(data){ |
| | | if(data.code == 500){ |
| | | Feng.error("获取失败!" + data.message + "!"); |
| | | return false; |
| | | } |
| | | $('#orderSum').val(data.orderSum); |
| | | $('#income').val(data.income); |
| | | $('#usedCoupon').val(data.usedCoupon); |
| | | $('#validOrder').val(data.validOrder); |
| | | $('#balances').val(data.balance); |
| | | $('#couponPriceSum').val(data.couponPriceSum); |
| | | },function(data){ |
| | | Feng.error("获取失败!" + data.message + "!"); |
| | | }); |
| | | ajax.set({ |
| | | id: $('#id').val(), |
| | | time: $('#time').val() |
| | | }); |
| | | ajax.start(); |
| | | } |
| | | |
| | | |
| | | $(function () { |
| | | |
| | | let tables = [ |
| | | {field: 'selectItem', radio: true}, |
| | | // {title: '主键', field: 'id', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '到账时间', field: 'createTime', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '交易类型', field: 'type', visible: true, align: 'center', valign: 'middle', |
| | | formatter: function (value, row) { |
| | | switch (value) { |
| | | case 1: |
| | | return '充值' |
| | | case 2: |
| | | return '提现' |
| | | case 3: |
| | | return '佣金收入' |
| | | case 4: |
| | | return '保险收入' |
| | | case 5: |
| | | return '补贴支付' |
| | | } |
| | | } |
| | | }, |
| | | {title: '交易金额', field: 'money', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '账户余额', field: 'balance', visible: true, align: 'center', valign: 'middle'} |
| | | ] |
| | | |
| | | var table = new BSTable("EnterprisePageTable", "/tAgent/queryAgentCompanyFundFlow", tables); |
| | | table.setPaginationType("server"); |
| | | table.setQueryParams({ |
| | | id: $('#id').val() |
| | | }) |
| | | table.init(); |
| | | }) |
| | | </script> |
| | | @} |
| | |
| | | @layout("/common/_container.html"){ |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-content"> |
| | | <div class="form-horizontal"> |
| | | <div class="form-horizontal" id="tAgentInfoForm"> |
| | | |
| | | <div class="row"> |
| | | <div class="col-sm-6 b-r"> |
| | | <#input id="id" name="主键" value="${item.id}" underline="true"/> |
| | | <#input id="principal" name="负责人姓名" value="${item.principal}" underline="true"/> |
| | | <#input id="principalPhone" name="负责人电话" value="${item.principalPhone}" underline="true"/> |
| | | <#input id="email" name="邮箱" value="${item.email}" underline="true"/> |
| | | <#input id="provinceCode" name="代理区域省编号" value="${item.provinceCode}" /> |
| | | </div> |
| | | |
| | | <input type="hidden" id="id" value="${item.id}"> |
| | | <div class="col-sm-6"> |
| | | <#input id="provinceName" name="代理区域省名称" value="${item.provinceName}" underline="true"/> |
| | | <#input id="cityCode" name="代理区域市编号" value="${item.cityCode}" underline="true"/> |
| | | <#input id="cityName" name="代理区域市名称" value="${item.cityName}" underline="true"/> |
| | | <#input id="status" name="状态(1=正常,2=冻结,3=删除)" value="${item.status}" underline="true"/> |
| | | <#input id="createTime" name="添加时间" value="${item.createTime}" /> |
| | | <div class="form-group"> |
| | | 代理商信息 |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">*负责人姓名:</label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" id="principal" name="principal" value="${item.principal}" placeholder="请输入"> |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">*联系电话:</label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" id="principalPhone" name="principalPhone" value="${item.principalPhone}" maxlength="11" type="number" placeholder="请输入"> |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <input id="areaId" type="hidden"> |
| | | <label class="col-sm-3 control-label">*代理区域:</label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" id="area" onclick="TAgent.area()" name="area" placeholder="请选择" readonly> |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">*邮箱:</label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" id="email" name="email" type="email" value="${item.email}" maxlength="40" placeholder="请输入"> |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">*登录账号:</label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" id="account" name="account" type="text" value="${user.account}" maxlength="20" placeholder="请输入"> |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">*登录密码:</label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" id="password" name="password" type="password" maxlength="20" placeholder="请输入"> |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">*确认密码:</label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" id="rePassword" name="rePassword" type="password" maxlength="20" placeholder="请输入"> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="row btn-group-m-t"> |
| | | <div class="col-sm-10"> |
| | | <#button btnCss="info" name="提交" id="ensure" icon="fa-check" clickFun="TAgentInfoDlg.editSubmit()"/> |
| | | <div class="col-sm-10" style="text-align: center"> |
| | | <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" clickFun="TAgentInfoDlg.close()"/> |
| | | <#button btnCss="info" name="提交" id="ensure" icon="fa-check" clickFun="TAgentInfoDlg.editSubmit()"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/static/modular/system/tAgent/tAgent_info.js"></script> |
| | | <script src="${ctxPath}/static/modular/system/tAgent/tAgentInfo.js"></script> |
| | | <script src="${ctxPath}/static/modular/system/tAgent/tAgent.js"></script> |
| | | <script type="text/javascript"> |
| | | var citys = [{"value":"0011","title":"北京市","cities":[{"value":"1100","title":"北京市"}]},{"value":"0012","title":"天津市","cities":[{"value":"1200","title":"天津市"}]},{"value":"0013","title":"河北省","cities":[{"value":"1301","title":"石家庄"},{"value":"1302","title":"保定"},{"value":"1303","title":"沧州"},{"value":"1304","title":"承德"},{"value":"1305","title":"邯郸"},{"value":"1306","title":"衡水"},{"value":"1307","title":"廊坊"},{"value":"1308","title":"秦皇岛"},{"value":"1309","title":"唐山"},{"value":"1310","title":"邢台"},{"value":"1311","title":"张家口"}]},{"value":"0014","title":"山西省","cities":[{"value":"1401","title":"太原"},{"value":"1402","title":"长治"},{"value":"1403","title":"大同"},{"value":"1404","title":"晋城"},{"value":"1405","title":"离石"},{"value":"1406","title":"临汾"},{"value":"1407","title":"朔州"},{"value":"1408","title":"忻州"},{"value":"1409","title":"阳泉"},{"value":"1410","title":"榆次"},{"value":"1411","title":"运城"},{"value":"1412","title":"晋中"},{"value":"1413","title":"吕梁"}]},{"value":"0015","title":"内蒙古自治区","cities":[{"value":"1501","title":"呼和浩特"},{"value":"1502","title":"包头"},{"value":"1503","title":"阿拉善"},{"value":"1504","title":"巴彦淖尔"},{"value":"1505","title":"赤峰"},{"value":"1506","title":"呼伦贝尔"},{"value":"1507","title":"乌海"},{"value":"1508","title":"乌兰察布"},{"value":"1509","title":"锡林郭勒"},{"value":"1510","title":"兴安"},{"value":"1511","title":"鄂尔多斯"},{"value":"1512","title":"通辽"},{"value":"1513","title":"满洲里"}]},{"value":"0021","title":"辽宁省","cities":[{"value":"2101","title":"沈阳"},{"value":"2102","title":"大连"},{"value":"2103","title":"鞍山"},{"value":"2104","title":"本溪"},{"value":"2105","title":"朝阳"},{"value":"2106","title":"丹东"},{"value":"2107","title":"抚顺"},{"value":"2108","title":"阜新"},{"value":"2109","title":"葫芦岛"},{"value":"2110","title":"锦州"},{"value":"2111","title":"辽阳"},{"value":"2112","title":"盘锦"},{"value":"2113","title":"铁岭"},{"value":"2114","title":"营口"}]},{"value":"0022","title":"吉林省","cities":[{"value":"2201","title":"长春"},{"value":"2202","title":"白城"},{"value":"2203","title":"白山"},{"value":"2204","title":"吉林"},{"value":"2205","title":"辽源"},{"value":"2206","title":"四平"},{"value":"2207","title":"松原"},{"value":"2208","title":"通化"},{"value":"2209","title":"延边"}]},{"value":"0023","title":"黑龙江省","cities":[{"value":"2301","title":"哈尔滨"},{"value":"2302","title":"大庆"},{"value":"2303","title":"大兴安岭"},{"value":"2304","title":"鹤岗"},{"value":"2305","title":"黑河"},{"value":"2306","title":"鸡西"},{"value":"2307","title":"佳木斯"},{"value":"2308","title":"牡丹江"},{"value":"2309","title":"七台河"},{"value":"2310","title":"齐齐哈尔"},{"value":"2311","title":"双鸭山"},{"value":"2312","title":"绥化"},{"value":"2313","title":"伊春"}]},{"value":"0031","title":"上海市","cities":[{"value":"3100","title":"上海市"}]},{"value":"0032","title":"江苏省","cities":[{"value":"3201","title":"南京"},{"value":"3202","title":"常州"},{"value":"3203","title":"淮安"},{"value":"3204","title":"连云港"},{"value":"3205","title":"南通"},{"value":"3206","title":"苏州"},{"value":"3207","title":"宿迁"},{"value":"3208","title":"泰州"},{"value":"3209","title":"无锡"},{"value":"3210","title":"徐州"},{"value":"3211","title":"盐城"},{"value":"3212","title":"扬州"},{"value":"3213","title":"镇江"},{"value":"3214","title":"胥浦"},{"value":"3215","title":"昆山"}]},{"value":"0033","title":"浙江省","cities":[{"value":"3301","title":"杭州"},{"value":"3302","title":"宁波"},{"value":"3303","title":"湖州"},{"value":"3304","title":"嘉兴"},{"value":"3305","title":"金华"},{"value":"3306","title":"绍兴"},{"value":"3307","title":"台州"},{"value":"3308","title":"温州"},{"value":"3309","title":"舟山"},{"value":"3310","title":"衢州"},{"value":"3311","title":"丽水"}]},{"value":"0034","title":"安徽省","cities":[{"value":"3401","title":"合肥"},{"value":"3402","title":"安庆"},{"value":"3403","title":"蚌埠"},{"value":"3404","title":"巢湖"},{"value":"3405","title":"池州"},{"value":"3406","title":"滁州"},{"value":"3407","title":"阜阳"},{"value":"3408","title":"淮北"},{"value":"3409","title":"淮南"},{"value":"3410","title":"黄山"},{"value":"3411","title":"六安"},{"value":"3412","title":"马鞍山"},{"value":"3414","title":"铜陵"},{"value":"3415","title":"芜湖"},{"value":"3416","title":"宣城"},{"value":"3417","title":"亳州"},{"value":"3418","title":"宿州"}]},{"value":"0035","title":"福建省","cities":[{"value":"3501","title":"福州"},{"value":"3502","title":"厦门"},{"value":"3503","title":"龙岩"},{"value":"3504","title":"南平"},{"value":"3505","title":"宁德"},{"value":"3506","title":"莆田"},{"value":"3507","title":"泉州"},{"value":"3508","title":"三明"},{"value":"3509","title":"漳州"}]},{"value":"0036","title":"江西省","cities":[{"value":"3601","title":"南昌"},{"value":"3602","title":"抚州"},{"value":"3603","title":"赣州"},{"value":"3604","title":"吉安"},{"value":"3605","title":"景德镇"},{"value":"3606","title":"九江"},{"value":"3607","title":"萍乡"},{"value":"3608","title":"上饶"},{"value":"3609","title":"新余"},{"value":"3610","title":"宜春"},{"value":"3611","title":"鹰潭"}]},{"value":"0037","title":"山东省","cities":[{"value":"3701","title":"济南"},{"value":"3702","title":"青岛"},{"value":"3703","title":"滨州"},{"value":"3704","title":"德州"},{"value":"3705","title":"东营"},{"value":"3706","title":"菏泽"},{"value":"3707","title":"济宁"},{"value":"3708","title":"莱芜"},{"value":"3709","title":"聊城"},{"value":"3710","title":"临沂"},{"value":"3711","title":"日照"},{"value":"3712","title":"泰安"},{"value":"3713","title":"威海"},{"value":"3714","title":"潍坊"},{"value":"3715","title":"烟台"},{"value":"3716","title":"枣庄"},{"value":"3717","title":"淄博"}]},{"value":"0041","title":"河南省","cities":[{"value":"4101","title":"郑州"},{"value":"4102","title":"安阳"},{"value":"4103","title":"焦作"},{"value":"4104","title":"鹤壁"},{"value":"4105","title":"开封"},{"value":"4106","title":"洛阳"},{"value":"4107","title":"南阳"},{"value":"4108","title":"平顶山"},{"value":"4109","title":"三门峡"},{"value":"4110","title":"商丘"},{"value":"4111","title":"新乡"},{"value":"4112","title":"信阳"},{"value":"4113","title":"许昌"},{"value":"4114","title":"周口"},{"value":"4115","title":"驻马店"},{"value":"4116","title":"漯河"},{"value":"4117","title":"濮阳"},{"value":"4118","title":"济源"}]},{"value":"0042","title":"湖北省","cities":[{"value":"4201","title":"武汉"},{"value":"4202","title":"鄂州"},{"value":"4203","title":"恩施"},{"value":"4204","title":"黄冈"},{"value":"4205","title":"黄石"},{"value":"4206","title":"荆门"},{"value":"4207","title":"荆州"},{"value":"4208","title":"十堰"},{"value":"4209","title":"随州"},{"value":"4210","title":"咸宁"},{"value":"4211","title":"襄樊"},{"value":"4212","title":"孝感"},{"value":"4213","title":"神农架"},{"value":"4214","title":"天门"},{"value":"4215","title":"宜昌"},{"value":"4216","title":"三峡"},{"value":"4217","title":"潜江"},{"value":"4218","title":"仙桃"}]},{"value":"0043","title":"湖南省","cities":[{"value":"4301","title":"长沙"},{"value":"4302","title":"常德"},{"value":"4303","title":"郴州"},{"value":"4304","title":"衡阳"},{"value":"4305","title":"怀化"},{"value":"4306","title":"娄底"},{"value":"4307","title":"邵阳"},{"value":"4308","title":"湘潭"},{"value":"4309","title":"湘西"},{"value":"4310","title":"益阳"},{"value":"4311","title":"永州"},{"value":"4312","title":"岳阳"},{"value":"4313","title":"张家界"},{"value":"4314","title":"株洲"},{"value":"4331","title":"吉首"}]},{"value":"0044","title":"广东省","cities":[{"value":"4401","title":"广州"},{"value":"4402","title":"深圳"},{"value":"4403","title":"潮州"},{"value":"4404","title":"东莞"},{"value":"4405","title":"佛山"},{"value":"4406","title":"惠州"},{"value":"4407","title":"江门"},{"value":"4408","title":"揭阳"},{"value":"4409","title":"茂名"},{"value":"4410","title":"梅州"},{"value":"4411","title":"清远"},{"value":"4412","title":"汕头"},{"value":"4413","title":"汕尾"},{"value":"4414","title":"韶关"},{"value":"4415","title":"阳江"},{"value":"4416","title":"云浮"},{"value":"4417","title":"湛江"},{"value":"4418","title":"肇庆"},{"value":"4419","title":"中山"},{"value":"4420","title":"河源"},{"value":"4421","title":"珠海"}]},{"value":"0045","title":"广西壮族自治区","cities":[{"value":"4501","title":"南宁"},{"value":"4502","title":"百色"},{"value":"4503","title":"北海"},{"value":"4504","title":"桂林"},{"value":"4505","title":"河池"},{"value":"4506","title":"柳州"},{"value":"4507","title":"梧州"},{"value":"4508","title":"玉林"},{"value":"4509","title":"崇左"},{"value":"4510","title":"防城港"},{"value":"4511","title":"贵港"},{"value":"4512","title":"贺州"},{"value":"4513","title":"来宾"},{"value":"4514","title":"钦州"}]},{"value":"0046","title":"海南省","cities":[{"value":"4601","title":"海口"},{"value":"4602","title":"三亚"},{"value":"4603","title":"白沙"},{"value":"4604","title":"保亭"},{"value":"4605","title":"昌江"},{"value":"4606","title":"澄迈"},{"value":"4607","title":"儋州"},{"value":"4608","title":"定安"},{"value":"4609","title":"东方"},{"value":"4610","title":"乐东"},{"value":"4611","title":"临高"},{"value":"4612","title":"陵水"},{"value":"4613","title":"琼海"},{"value":"4614","title":"琼中"},{"value":"4615","title":"屯昌"},{"value":"4616","title":"万宁"},{"value":"4617","title":"文昌"},{"value":"4618","title":"五指山"},{"value":"4619","title":"洋浦"}]},{"value":"0050","title":"重庆市","cities":[{"value":"5000","title":"重庆市"}]},{"value":"0051","title":"四川省","cities":[{"value":"5101","title":"成都"},{"value":"5102","title":"巴中"},{"value":"5103","title":"达州"},{"value":"5104","title":"德阳"},{"value":"5105","title":"广安"},{"value":"5106","title":"广元"},{"value":"5107","title":"乐山"},{"value":"5108","title":"凉山"},{"value":"5109","title":"眉山"},{"value":"5110","title":"绵阳"},{"value":"5111","title":"南充"},{"value":"5112","title":"内江"},{"value":"5113","title":"攀枝花"},{"value":"5114","title":"遂宁"},{"value":"5115","title":"雅安"},{"value":"5116","title":"宜宾"},{"value":"5117","title":"自贡"},{"value":"5118","title":"泸州"},{"value":"5119","title":"阿坝"},{"value":"5120","title":"甘孜"},{"value":"5121","title":"资阳"}]},{"value":"0052","title":"贵州省","cities":[{"value":"5201","title":"贵阳"},{"value":"5202","title":"安顺"},{"value":"5203","title":"毕节"},{"value":"5204","title":"六盘水"},{"value":"5205","title":"铜仁"},{"value":"5206","title":"遵义"},{"value":"5207","title":"黔东南"},{"value":"5208","title":"黔南"},{"value":"5209","title":"黔西南"}]},{"value":"0053","title":"云南省","cities":[{"value":"5301","title":"昆明"},{"value":"5302","title":"西双版纳"},{"value":"5303","title":"保山"},{"value":"5304","title":"楚雄"},{"value":"5305","title":"大理"},{"value":"5306","title":"德宏"},{"value":"5307","title":"红河"},{"value":"5308","title":"丽江"},{"value":"5309","title":"临沧"},{"value":"5310","title":"怒江"},{"value":"5311","title":"曲靖"},{"value":"5312","title":"思茅"},{"value":"5313","title":"文山"},{"value":"5314","title":"玉溪"},{"value":"5315","title":"昭通"},{"value":"5316","title":"中甸"},{"value":"5317","title":"迪庆州"}]},{"value":"0054","title":"西藏自治区","cities":[{"value":"5401","title":"拉萨"},{"value":"5402","title":"阿里"},{"value":"5403","title":"昌都"},{"value":"5404","title":"林芝"},{"value":"5405","title":"那曲"},{"value":"5406","title":"日喀则"},{"value":"5407","title":"山南"},{"value":"5424","title":"樟木口岸"}]},{"value":"0061","title":"陕西省","cities":[{"value":"6101","title":"西安"},{"value":"6102","title":"安康"},{"value":"6103","title":"宝鸡"},{"value":"6104","title":"汉中"},{"value":"6105","title":"商洛"},{"value":"6106","title":"铜川"},{"value":"6107","title":"渭南"},{"value":"6108","title":"咸阳"},{"value":"6109","title":"延安"},{"value":"6110","title":"榆林"}]},{"value":"0062","title":"甘肃省","cities":[{"value":"6201","title":"兰州"},{"value":"6202","title":"白银"},{"value":"6203","title":"定西"},{"value":"6204","title":"东风"},{"value":"6205","title":"合作"},{"value":"6206","title":"嘉峪关"},{"value":"6207","title":"金昌"},{"value":"6208","title":"酒泉"},{"value":"6209","title":"矿区"},{"value":"6210","title":"临夏"},{"value":"6211","title":"陇南"},{"value":"6212","title":"平凉"},{"value":"6213","title":"庆阳"},{"value":"6214","title":"天水"},{"value":"6215","title":"武威"},{"value":"6216","title":"张掖"},{"value":"6217","title":"甘南州"}]},{"value":"0063","title":"青海省","cities":[{"value":"6301","title":"西宁"},{"value":"6302","title":"海东"},{"value":"6322","title":"海北"},{"value":"6323","title":"黄南"},{"value":"6325","title":"海南"},{"value":"6326","title":"果洛"},{"value":"6327","title":"玉树"},{"value":"6328","title":"海西"}]},{"value":"0064","title":"宁夏回族自治区","cities":[{"value":"6401","title":"银川"},{"value":"6402","title":"中卫"},{"value":"6403","title":"固原"},{"value":"6404","title":"石嘴山"},{"value":"6405","title":"吴忠"}]},{"value":"0065","title":"新疆维吾尔自治区","cities":[{"value":"6501","title":"乌鲁木齐"},{"value":"6502","title":"阿克苏"},{"value":"6503","title":"阿勒泰"},{"value":"6504","title":"巴州"},{"value":"6505","title":"博州"},{"value":"6506","title":"昌吉"},{"value":"6507","title":"哈密"},{"value":"6508","title":"和田"},{"value":"6509","title":"喀什"},{"value":"6510","title":"克拉玛依"},{"value":"6511","title":"马兰"},{"value":"6512","title":"石河子"},{"value":"6513","title":"塔城"},{"value":"6514","title":"吐鲁番"},{"value":"6515","title":"伊犁"},{"value":"6516","title":"克州"},{"value":"6517","title":"阿拉尔"},{"value":"6518","title":"五家渠"}]},{"value":"2003","title":"台湾省","cities":[{"value":"9903","title":"台湾省"}]},{"value":"2001","title":"香港特别行政区","cities":[{"value":"9901","title":"香港特别行政区"}]},{"value":"2002","title":"澳门特别行政区","cities":[{"value":"9902","title":"澳门特别行政区"}]}]; |
| | | laydate.render({ |
| | | elem: '#socialCreditCodeExpires', |
| | | type: "date" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#certIdExpires', |
| | | type: "date" |
| | | }); |
| | | $('.qy').hide(); |
| | | $('#userType').change(function () { |
| | | let userType = $(this).val(); |
| | | if(userType == 0){ |
| | | $('.qy').hide(); |
| | | $('#bankAcctType').html('<option value="2">对私</option>') |
| | | $('#merchantIDCode').parent('div').siblings('label').text('*身份证号') |
| | | $('#merchantName').parent('div').siblings('label').text('*姓名') |
| | | }else{ |
| | | $('.qy').show(); |
| | | $('#bankAcctType').html('<option value="1">对公</option>') |
| | | $('#merchantIDCode').parent('div').siblings('label').text('*法人身份证号') |
| | | $('#merchantName').parent('div').siblings('label').text('*公司名称') |
| | | } |
| | | }) |
| | | function initCity(id) { |
| | | let city = ""; |
| | | for(let i in citys){ |
| | | let p = citys[i]; |
| | | city += '<option value="' + p.value + '">' + p.title+ '</option>' |
| | | } |
| | | $('#' + id).html(city); |
| | | } |
| | | function initArea(e, id) { |
| | | let city = ""; |
| | | let cityCode = $(e).val(); |
| | | for(let i in citys){ |
| | | let p = citys[i]; |
| | | if(p.value == cityCode){ |
| | | let a = p.cities; |
| | | for(let j in a){ |
| | | city += '<option value="' + a[j].value + '">' + a[j].title+ '</option>' |
| | | } |
| | | break; |
| | | } |
| | | } |
| | | $('#' + id).html(city); |
| | | } |
| | | $('#fileNoBtnId').click(function () { |
| | | $('#file').click(); |
| | | }) |
| | | $('#file').change(function () { |
| | | var formData = new FormData(); |
| | | formData.append('file', $('#file')[0].files[0]) |
| | | $.ajax({ |
| | | url : Feng.ctxPath + "/tAgent/uploadFile", |
| | | type : "POST", |
| | | data : formData, |
| | | contentType : false, |
| | | processData : false, |
| | | success : function(data) { |
| | | if("" == data){ |
| | | Feng.error("上传失败"); |
| | | }else{ |
| | | $('#fileNo').val(data); |
| | | $('#file').val(''); |
| | | Feng.success("上传成功!"); |
| | | } |
| | | }, |
| | | error : function() { |
| | | Feng.error("上传失败"); |
| | | } |
| | | }) |
| | | }) |
| | | $(function () { |
| | | initCity('provCodeBank'); |
| | | initCity('provCodeEnterprise'); |
| | | }) |
| | | </script> |
| | | @} |
| | |
| | | <label>${driverCount}</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" id="rules" style="text-align: left" > |
| | | @if(null != array){ |
| | | @for(ChargeStandard in array){ |
| | | <div name="rulesForm"> |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <span class="control-label" >时间段</span> |
| | | <span class="control-label" > ${ChargeStandard.num1} </span> |
| | | <span class="control-label" >—</span> |
| | | <span class="control-label" > ${ChargeStandard.num2} </span> |
| | | <span class="control-label" >代驾里程</span> |
| | | <span class="control-label" > ${ChargeStandard.num3} </span> |
| | | <span class="control-label" >公里,起步价</span> |
| | | <span class="control-label" > ${ChargeStandard.num4} </span> |
| | | <span class="control-label" >元,超出里程每</span> |
| | | <span class="control-label" > ${ChargeStandard.num5} </span> |
| | | <span class="control-label" >公里,收费</span> |
| | | <span class="control-label" > ${ChargeStandard.num6} </span> |
| | | <span class="control-label" >元</span> |
| | | </div> |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <span class="control-label" >长途里程</span> |
| | | <span class="control-label" > ${ChargeStandard.num7} </span> |
| | | <span class="control-label" >—</span> |
| | | <span class="control-label" > ${ChargeStandard.num8} </span> |
| | | <span class="control-label" >公里,收费</span> |
| | | <span class="control-label" > ${ChargeStandard.num9} </span> |
| | | <span class="control-label" >元,超出里程每</span> |
| | | <span class="control-label" > ${ChargeStandard.num10} </span> |
| | | <span class="control-label" >公里,收费</span> |
| | | <span class="control-label" > ${ChargeStandard.num11} </span> |
| | | <span class="control-label" >元</span> |
| | | </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">客服信息</label> |
| | | </div> |
| | | </div> |
| | | <hr/> |
| | | <div class="initialLevel col-sm-12 control-label form-group" style="text-align: left" > |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <span class="control-label" >客服电话</span> |
| | | <span class="control-label" >${serviceTel}</span> |
| | | </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" style="text-align: left" > |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <span class="control-label" >等待</span> |
| | | <span class="control-label" >${ExtraCost.num1}</span> |
| | | <span class="control-label" >分钟,收取</span> |
| | | <span class="control-label" >${ExtraCost.num2}</span> |
| | | <span class="control-label" >元,超出</span> |
| | | <span class="control-label" >${ExtraCost.num3}</span> |
| | | <span class="control-label" >分钟,收取</span> |
| | | <span class="control-label" >${ExtraCost.num4}</span> |
| | | <span class="control-label" >元/分钟</span> |
| | | </div> |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <span class="control-label" >恶劣天气</span> |
| | | <span class="control-label" >${ExtraCost.num5}</span> |
| | | <span class="control-label" >公里以内,加收</span> |
| | | <span class="control-label" >${ExtraCost.num6}</span> |
| | | <span class="control-label" >元,超出</span> |
| | | <span class="control-label" >${ExtraCost.num7}</span> |
| | | <span class="control-label" >公里,收取订单的</span> |
| | | <span class="control-label" >${ExtraCost.num8}</span> |
| | | <span class="control-label" >倍计费,最高收取</span> |
| | | <span class="control-label" >${ExtraCost.num9}</span> |
| | | <span class="control-label" >元</span> |
| | | </div> |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <span class="control-label" >节假日 每单加收</span> |
| | | <span class="control-label" >${ExtraCost.num10}</span> |
| | | <span class="control-label" >元</span> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/static/modular/system/tAgent/tAgent.js"></script> |
| | | <script type="text/javascript"> |
| | | laydate.render({ |
| | | elem: '#createTime', |
| | |
| | | |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="row row-lg"> |
| | | <div class="col-sm-12"> |
| | | <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/> |
| | | <input hidden id="array"> |
| | | <div class="initialLevel col-sm-12 control-label form-group" id="rules" style="text-align: left" > |
| | | <div name="rulesForm"> |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <span class="control-label" >时间段</span> |
| | | <input class="control-label" id="num1" name="num1" type="text" placeholder="00:00" style="height: 30px;width: 80px"> |
| | | <span class="control-label" >——</span> |
| | | <input class="control-label" id="num2" name="num2" type="text" placeholder="00:00" style="height: 30px;width: 80px"> |
| | | <span class="control-label" >代驾里程</span> |
| | | <input class="control-label" id="num3" name="num3" type="number" min="0" style="height: 30px;width: 80px"> |
| | | <span class="control-label" >公里,起步价</span> |
| | | <input class="control-label" id="num4" name="num4" type="number" min="0" style="height: 30px;width: 80px"> |
| | | <span class="control-label" >元,超出里程每</span> |
| | | <input class="control-label" id="num5" name="num5" type="number" min="0" style="height: 30px;width: 80px"> |
| | | <span class="control-label" >公里,收费</span> |
| | | <input class="control-label" id="num6" name="num6" type="number" min="0" style="height: 30px;width: 80px"> |
| | | <span class="control-label" >元</span> |
| | | |
| | | <span class="fa fa-plus" onclick="TBranchOfficeInfoDlg.addBox()"></span> |
| | | </div> |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <span class="control-label" >长途里程</span> |
| | | <input class="control-label" id="num7" name="num7" type="number" min="0" style="height: 30px;width: 80px"> |
| | | <span class="control-label" >——</span> |
| | | <input class="control-label" id="num8" name="num8" type="number" min="0" style="height: 30px;width: 80px"> |
| | | <span class="control-label" >公里,收费</span> |
| | | <input class="control-label" id="num9" name="num9" type="number" min="0" style="height: 30px;width: 80px"> |
| | | <span class="control-label" >元,超出里程每</span> |
| | | <input class="control-label" id="num10" name="num10" type="number" min="0" style="height: 30px;width: 80px"> |
| | | <span class="control-label" >公里,收费</span> |
| | | <input class="control-label" id="num11" name="num11" type="number" min="0" style="height: 30px;width: 80px"> |
| | | <span class="control-label" >元</span> |
| | | </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">客服信息</label> |
| | | </div> |
| | | </div> |
| | | <hr/> |
| | | <div class="initialLevel col-sm-12 control-label form-group" style="text-align: left" > |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <span class="control-label" >客服电话</span> |
| | | <input class="control-label" id="num22" name="num22" style="height: 30px;width: 150px"> |
| | | </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" style="text-align: left" > |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <span class="control-label" >等待</span> |
| | | <input class="control-label" id="num12" name="num12" type="number" min="0" style="height: 30px;width: 80px"> |
| | | <span class="control-label" >分钟,收取</span> |
| | | <input class="control-label" id="num13" name="num13" type="number" min="0" style="height: 30px;width: 80px"> |
| | | <span class="control-label" >元,超出</span> |
| | | <input class="control-label" id="num14" name="num14" type="number" min="0" style="height: 30px;width: 80px"> |
| | | <span class="control-label" >分钟,收取</span> |
| | | <input class="control-label" id="num15" name="num15" type="number" min="0" style="height: 30px;width: 80px"> |
| | | <span class="control-label" >元/分钟</span> |
| | | </div> |
| | | <input hidden id="zcOne" value=""> |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <div class="col-sm-1"> |
| | | <input type="checkbox" class="js-switch1" id="isTaxiCar" checked/> |
| | | </div> |
| | | <div class="initialLevel col-sm-10 control-label form-group" id="isTaxiCar_div"> |
| | | <span class="control-label" >恶劣天气</span> |
| | | <input class="control-label" id="num16" name="num16" type="number" min="0" style="height: 30px;width: 80px"> |
| | | <span class="control-label" >公里以内,加收</span> |
| | | <input class="control-label" id="num17" name="num17" type="number" min="0" style="height: 30px;width: 80px"> |
| | | <span class="control-label" >元,超出</span> |
| | | <input class="control-label" id="num18" name="num18" type="number" min="0" style="height: 30px;width: 80px"> |
| | | <span class="control-label" >公里,收取订单的</span> |
| | | <input class="control-label" id="num19" name="num19" type="number" min="0" style="height: 30px;width: 80px"> |
| | | <span class="control-label" >倍计费,最高收取</span> |
| | | <input class="control-label" id="num20" name="num20" type="number" min="0" style="height: 30px;width: 80px"> |
| | | <span class="control-label" >元</span> |
| | | </div> |
| | | </div> |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <div class="col-sm-1"> |
| | | <input type="checkbox" class="js-switch2" id="holiday" checked/> |
| | | </div> |
| | | <div class="initialLevel col-sm-10 control-label form-group" id="holiday_div" > |
| | | <span class="control-label" >节假日 每单加收</span> |
| | | <input class="control-label" id="num21" name="num21" type="number" min="0" style="height: 30px;width: 80px"> |
| | | <span class="control-label" >元</span> |
| | | </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="TBranchOfficeInfoDlg.close()"/> |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <!--<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="agentId" name="代理商id" underline="true"/> |
| | | <#input id="principal" name="负责人姓名" underline="true"/> |
| | | <#input id="principalPhone" name="负责人电话" underline="true"/> |
| | | <#input id="email" name="邮箱" underline="true"/> |
| | | <#input id="provinceCode" name="代理区域省编号" underline="true"/> |
| | | <#input id="provinceName" name="代理区域省名称"/> |
| | | </div> |
| | | |
| | | <div class="col-sm-6"> |
| | | <#input id="cityCode" name="代理区域市编号" underline="true"/> |
| | | <#input id="cityName" name="代理区域市名称" underline="true"/> |
| | | <#input id="districtCode" name="代理区域区编号" underline="true"/> |
| | | <#input id="districtName" name="代理区域区名称" underline="true"/> |
| | | <#input id="status" name="状态(1=正常,2=冻结,3=删除)" underline="true"/> |
| | | <#input id="createTime" name="添加时间" underline="true"/> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="row btn-group-m-t"> |
| | | <div class="col-sm-10"> |
| | | <#button btnCss="info" name="提交" id="ensure" icon="fa-check" clickFun="TBranchOfficeInfoDlg.addSubmit()"/> |
| | | <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" clickFun="TBranchOfficeInfoDlg.close()"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | </div>--> |
| | | <script src="${ctxPath}/static/modular/system/tBranchOffice/tBranchOffice_info.js"></script> |
| | | <script src="${ctxPath}/static/modular/system/tBranchOffice/tBranchOffice.js"></script> |
| | | <script type="text/javascript"> |
| | | var elem1 = document.querySelector(".js-switch1"); |
| | | var init1 = new Switchery(elem1); |
| | | $('.js-switch1').change(function () { |
| | | if($(this).is(":checked")){ |
| | | $('#isTaxiCar_div').show(); |
| | | }else{ |
| | | $('#isTaxiCar_div').hide() |
| | | } |
| | | }) |
| | | var elem2 = document.querySelector(".js-switch2"); |
| | | var init2 = new Switchery(elem2); |
| | | $('.js-switch2').change(function () { |
| | | if($(this).is(":checked")){ |
| | | $('#holiday_div').show(); |
| | | }else{ |
| | | $('#holiday_div').hide() |
| | | } |
| | | }) |
| | | $("input[name=num3]").bind('input',function(){ |
| | | var value = $(this).val() |
| | | regexp(value) |
| | | }) |
| | | $("input[name=num4]").bind('input',function(){ |
| | | var value = $(this).val() |
| | | regexp(value) |
| | | }) |
| | | $("input[name=num5]").bind('input',function(){ |
| | | var value = $(this).val() |
| | | regexp(value) |
| | | }) |
| | | $("input[name=num6]").bind('input',function(){ |
| | | var value = $(this).val() |
| | | regexp(value) |
| | | }) |
| | | $("input[name=num7]").bind('input',function(){ |
| | | var value = $(this).val() |
| | | regexp(value) |
| | | }) |
| | | $("input[name=num8]").bind('input',function(){ |
| | | var value = $(this).val() |
| | | regexp(value) |
| | | }) |
| | | $("input[name=num9]").bind('input',function(){ |
| | | var value = $(this).val() |
| | | regexp(value) |
| | | }) |
| | | $("input[name=num10]").bind('input',function(){ |
| | | var value = $(this).val() |
| | | regexp(value) |
| | | }) |
| | | $("input[name=num11]").bind('input',function(){ |
| | | var value = $(this).val() |
| | | regexp(value) |
| | | }) |
| | | $("input[name=num12]").bind('input',function(){ |
| | | var value = $(this).val() |
| | | regexp(value) |
| | | }) |
| | | $("input[name=num13]").bind('input',function(){ |
| | | var value = $(this).val() |
| | | regexp(value) |
| | | }) |
| | | $("input[name=num14]").bind('input',function(){ |
| | | var value = $(this).val() |
| | | regexp(value) |
| | | }) |
| | | $("input[name=num15]").bind('input',function(){ |
| | | var value = $(this).val() |
| | | regexp(value) |
| | | }) |
| | | $("input[name=num16]").bind('input',function(){ |
| | | var value = $(this).val() |
| | | regexp(value) |
| | | }) |
| | | $("input[name=num17]").bind('input',function(){ |
| | | var value = $(this).val() |
| | | regexp(value) |
| | | }) |
| | | $("input[name=num18]").bind('input',function(){ |
| | | var value = $(this).val() |
| | | regexp(value) |
| | | }) |
| | | $("input[name=num19]").bind('input',function(){ |
| | | var value = $(this).val() |
| | | regexp(value) |
| | | }) |
| | | $("input[name=num20]").bind('input',function(){ |
| | | var value = $(this).val() |
| | | regexp(value) |
| | | }) |
| | | /*function regexp(value){ |
| | | var reg=/^[1-9]\d*$/;//由 1-9开头 的正则表达式 |
| | | //先判断是否为整数 在判断 是否在 1-总页 整数范围之内 |
| | | if(reg.test(value)){ |
| | | if(parseInt(value) <= 0){ |
| | | Feng.error("请输入大于0的正整数"); |
| | | return; |
| | | } |
| | | }else{ |
| | | Feng.error("请输入大于0的正整数"); |
| | | return; |
| | | } |
| | | }*/ |
| | | function regexp(value){ |
| | | var reg=/^(\d+.?)?\d{0,2}$/;//由 1-9开头 的正则表达式 整数 两位小数 |
| | | //先判断是否为整数 在判断 是否在 1-总页 整数范围之内 |
| | | if(reg.test(value)){ |
| | | if(value == 0){ |
| | | Feng.error("请输入大于0的整数或保留两位小数"); |
| | | return; |
| | | } |
| | | }else{ |
| | | Feng.error("请输入整数或保留两位小数"); |
| | | return; |
| | | } |
| | | } |
| | | </script> |
| | | @} |
| | |
| | | |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="row row-lg"> |
| | | <div class="col-sm-12"> |
| | | <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/> |
| | | <input hidden id="array" value="${array}"> |
| | | <div class="initialLevel col-sm-12 control-label form-group" id="rules" style="text-align: left" > |
| | | @if(null == array){ |
| | | <div name="rulesForm"> |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <span class="control-label" >时间段</span> |
| | | <input class="control-label" id="num1" name="num1" type="text" placeholder="00:00" style="height: 30px;width: 80px"> |
| | | <span class="control-label" >——</span> |
| | | <input class="control-label" id="num2" name="num2" type="text" placeholder="00:00" style="height: 30px;width: 80px"> |
| | | <span class="control-label" >代驾里程</span> |
| | | <input class="control-label" id="num3" name="num3" type="number" min="0" style="height: 30px;width: 80px"> |
| | | <span class="control-label" >公里,起步价</span> |
| | | <input class="control-label" id="num4" name="num4" type="number" min="0" style="height: 30px;width: 80px"> |
| | | <span class="control-label" >元,超出里程每</span> |
| | | <input class="control-label" id="num5" name="num5" type="number" min="0" style="height: 30px;width: 80px"> |
| | | <span class="control-label" >公里,收费</span> |
| | | <input class="control-label" id="num6" name="num6" type="number" min="0" style="height: 30px;width: 80px"> |
| | | <span class="control-label" >元</span> |
| | | |
| | | <span class="fa fa-plus" onclick="TBranchOfficeInfoDlg.addBox()"></span> |
| | | </div> |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <span class="control-label" >长途里程</span> |
| | | <input class="control-label" id="num7" name="num7" type="number" min="0" style="height: 30px;width: 80px"> |
| | | <span class="control-label" >——</span> |
| | | <input class="control-label" id="num8" name="num8" type="number" min="0" style="height: 30px;width: 80px"> |
| | | <span class="control-label" >公里,收费</span> |
| | | <input class="control-label" id="num9" name="num9" type="number" min="0" style="height: 30px;width: 80px"> |
| | | <span class="control-label" >元,超出里程每</span> |
| | | <input class="control-label" id="num10" name="num10" type="number" min="0" style="height: 30px;width: 80px"> |
| | | <span class="control-label" >公里,收费</span> |
| | | <input class="control-label" id="num11" name="num11" type="number" min="0" style="height: 30px;width: 80px"> |
| | | <span class="control-label" >元</span> |
| | | </div> |
| | | </div> |
| | | @} |
| | | @if(null != array){ |
| | | @for(ChargeStandard in array){ |
| | | <div name="rulesForm"> |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <span class="control-label" >时间段</span> |
| | | <input class="control-label" id="num1" name="num1" value="${ChargeStandard.num1}" type="text" placeholder="00:00" style="height: 30px;width: 80px"> |
| | | <span class="control-label" >——</span> |
| | | <input class="control-label" id="num2" name="num2" value="${ChargeStandard.num2}" type="text" placeholder="00:00" style="height: 30px;width: 80px"> |
| | | <span class="control-label" >代驾里程</span> |
| | | <input class="control-label" id="num3" name="num3" value="${ChargeStandard.num3}" type="number" min="0" style="height: 30px;width: 80px"> |
| | | <span class="control-label" >公里,起步价</span> |
| | | <input class="control-label" id="num4" name="num4" value="${ChargeStandard.num4}" type="number" min="0" style="height: 30px;width: 80px"> |
| | | <span class="control-label" >元,超出里程每</span> |
| | | <input class="control-label" id="num5" name="num5" value="${ChargeStandard.num5}" type="number" min="0" style="height: 30px;width: 80px"> |
| | | <span class="control-label" >公里,收费</span> |
| | | <input class="control-label" id="num6" name="num6" value="${ChargeStandard.num6}" type="number" min="0" style="height: 30px;width: 80px"> |
| | | <span class="control-label" >元</span> |
| | | |
| | | @if(ChargeStandard.key == 0){ |
| | | <span class="fa fa-plus" onclick="TSystemConfig.addBox()"></span> |
| | | @} |
| | | @if(ChargeStandard.key == 1){ |
| | | <span class="fa fa-remove" onclick="TSystemConfig.delBox(this)"></span> |
| | | @} |
| | | </div> |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <span class="control-label" >长途里程</span> |
| | | <input class="control-label" id="num7" name="num7" value="${ChargeStandard.num7}" type="number" min="0" style="height: 30px;width: 80px"> |
| | | <span class="control-label" >——</span> |
| | | <input class="control-label" id="num8" name="num8" value="${ChargeStandard.num8}" type="number" min="0" style="height: 30px;width: 80px"> |
| | | <span class="control-label" >公里,收费</span> |
| | | <input class="control-label" id="num9" name="num9" value="${ChargeStandard.num9}" type="number" min="0" style="height: 30px;width: 80px"> |
| | | <span class="control-label" >元,超出里程每</span> |
| | | <input class="control-label" id="num10" name="num10" value="${ChargeStandard.num10}" type="number" min="0" style="height: 30px;width: 80px"> |
| | | <span class="control-label" >公里,收费</span> |
| | | <input class="control-label" id="num11" name="num11" value="${ChargeStandard.num11}" type="number" min="0" style="height: 30px;width: 80px"> |
| | | <span class="control-label" >元</span> |
| | | </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">客服信息</label> |
| | | </div> |
| | | </div> |
| | | <hr/> |
| | | <div class="initialLevel col-sm-12 control-label form-group" style="text-align: left" > |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <span class="control-label" >客服电话</span> |
| | | <input class="control-label" id="num22" name="num22" value="${serviceTel}" style="height: 30px;width: 150px"> |
| | | </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" style="text-align: left" > |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <span class="control-label" >等待</span> |
| | | <input class="control-label" id="num12" name="num12" value="${ExtraCost != null ? ExtraCost.num1 : ''}" type="number" min="0" style="height: 30px;width: 80px"> |
| | | <span class="control-label" >分钟,收取</span> |
| | | <input class="control-label" id="num13" name="num13" value="${ExtraCost != null ? ExtraCost.num2 : ''}" type="number" min="0" style="height: 30px;width: 80px"> |
| | | <span class="control-label" >元,超出</span> |
| | | <input class="control-label" id="num14" name="num14" value="${ExtraCost != null ? ExtraCost.num3 : ''}" type="number" min="0" style="height: 30px;width: 80px"> |
| | | <span class="control-label" >分钟,收取</span> |
| | | <input class="control-label" id="num15" name="num15" value="${ExtraCost != null ? ExtraCost.num4 : ''}" type="number" min="0" style="height: 30px;width: 80px"> |
| | | <span class="control-label" >元/分钟</span> |
| | | </div> |
| | | <input hidden id="zcOne" value="${zcOne}"> |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <div class="col-sm-1"> |
| | | <input type="checkbox" class="js-switch1" id="isTaxiCar" |
| | | @if(isNotEmpty(zcOne)){ |
| | | ${1 == zcOne ? 'checked=checked' : ''} |
| | | @} |
| | | /> |
| | | </div> |
| | | <div class="initialLevel col-sm-10 control-label form-group" id="isTaxiCar_div" ${1 == zcOne ? '' : 'hidden'}> |
| | | <span class="control-label" >恶劣天气</span> |
| | | <input class="control-label" id="num16" name="num16" value="${ExtraCost != null ? ExtraCost.num5 : ''}" type="number" min="0" style="height: 30px;width: 80px"> |
| | | <span class="control-label" >公里以内,加收</span> |
| | | <input class="control-label" id="num17" name="num17" value="${ExtraCost != null ? ExtraCost.num6 : ''}" type="number" min="0" style="height: 30px;width: 80px"> |
| | | <span class="control-label" >元,超出</span> |
| | | <input class="control-label" id="num18" name="num18" value="${ExtraCost != null ? ExtraCost.num7 : ''}" type="number" min="0" style="height: 30px;width: 80px"> |
| | | <span class="control-label" >公里,收取订单的</span> |
| | | <input class="control-label" id="num19" name="num19" value="${ExtraCost != null ? ExtraCost.num8 : ''}" type="number" min="0" style="height: 30px;width: 80px"> |
| | | <span class="control-label" >倍计费,最高收取</span> |
| | | <input class="control-label" id="num20" name="num20" value="${ExtraCost != null ? ExtraCost.num9 : ''}" type="number" min="0" style="height: 30px;width: 80px"> |
| | | <span class="control-label" >元</span> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <div class="col-sm-1"> |
| | | <input type="checkbox" class="js-switch2" id="holiday" |
| | | @if(isNotEmpty(zcTwo)){ |
| | | ${1 == zcTwo ? 'checked=checked' : ''} |
| | | @} |
| | | /> |
| | | </div> |
| | | <div class="initialLevel col-sm-10 control-label form-group" id="holiday_div" ${1 == zcTwo ? '' : 'hidden'}> |
| | | <span class="control-label" >节假日 每单加收</span> |
| | | <input class="control-label" id="num21" name="num21" value="${ExtraCost != null ? ExtraCost.num10 : ''}" type="number" min="0" style="height: 30px;width: 80px"> |
| | | <span class="control-label" >元</span> |
| | | </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="TBranchOfficeInfoDlg.close()"/> |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <!--<div class="ibox float-e-margins"> |
| | | <div class="ibox-content"> |
| | | <div class="form-horizontal"> |
| | | |
| | | <div class="row"> |
| | | <div class="col-sm-6 b-r"> |
| | | <#input id="id" name="主键" value="${item.id}" underline="true"/> |
| | | <#input id="agentId" name="代理商id" value="${item.agentId}" underline="true"/> |
| | | <#input id="principal" name="负责人姓名" value="${item.principal}" underline="true"/> |
| | | <#input id="principalPhone" name="负责人电话" value="${item.principalPhone}" underline="true"/> |
| | | <#input id="email" name="邮箱" value="${item.email}" underline="true"/> |
| | | <#input id="provinceCode" name="代理区域省编号" value="${item.provinceCode}" underline="true"/> |
| | | <#input id="provinceName" name="代理区域省名称" value="${item.provinceName}" /> |
| | | </div> |
| | | |
| | | <div class="col-sm-6"> |
| | | <#input id="cityCode" name="代理区域市编号" value="${item.cityCode}" underline="true"/> |
| | | <#input id="cityName" name="代理区域市名称" value="${item.cityName}" underline="true"/> |
| | | <#input id="districtCode" name="代理区域区编号" value="${item.districtCode}" underline="true"/> |
| | | <#input id="districtName" name="代理区域区名称" value="${item.districtName}" underline="true"/> |
| | | <#input id="status" name="状态(1=正常,2=冻结,3=删除)" value="${item.status}" underline="true"/> |
| | | <#input id="createTime" name="添加时间" value="${item.createTime}" /> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="row btn-group-m-t"> |
| | | <div class="col-sm-10"> |
| | | <#button btnCss="info" name="提交" id="ensure" icon="fa-check" clickFun="TBranchOfficeInfoDlg.editSubmit()"/> |
| | | <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" clickFun="TBranchOfficeInfoDlg.close()"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | </div>--> |
| | | <script src="${ctxPath}/static/modular/system/tBranchOffice/tBranchOffice_info.js"></script> |
| | | <script src="${ctxPath}/static/modular/system/tBranchOffice/tBranchOffice.js"></script> |
| | | <script type="text/javascript"> |
| | | var elem1 = document.querySelector(".js-switch1"); |
| | | var init1 = new Switchery(elem1); |
| | | $('.js-switch1').change(function () { |
| | | if($(this).is(":checked")){ |
| | | $('#isTaxiCar_div').show(); |
| | | }else{ |
| | | $('#isTaxiCar_div').hide() |
| | | } |
| | | }) |
| | | var elem2 = document.querySelector(".js-switch2"); |
| | | var init2 = new Switchery(elem2); |
| | | $('.js-switch2').change(function () { |
| | | if($(this).is(":checked")){ |
| | | $('#holiday_div').show(); |
| | | }else{ |
| | | $('#holiday_div').hide() |
| | | } |
| | | }) |
| | | $("input[name=num3]").bind('input',function(){ |
| | | var value = $(this).val() |
| | | regexp(value) |
| | | }) |
| | | $("input[name=num4]").bind('input',function(){ |
| | | var value = $(this).val() |
| | | regexp(value) |
| | | }) |
| | | $("input[name=num5]").bind('input',function(){ |
| | | var value = $(this).val() |
| | | regexp(value) |
| | | }) |
| | | $("input[name=num6]").bind('input',function(){ |
| | | var value = $(this).val() |
| | | regexp(value) |
| | | }) |
| | | $("input[name=num7]").bind('input',function(){ |
| | | var value = $(this).val() |
| | | regexp(value) |
| | | }) |
| | | $("input[name=num8]").bind('input',function(){ |
| | | var value = $(this).val() |
| | | regexp(value) |
| | | }) |
| | | $("input[name=num9]").bind('input',function(){ |
| | | var value = $(this).val() |
| | | regexp(value) |
| | | }) |
| | | $("input[name=num10]").bind('input',function(){ |
| | | var value = $(this).val() |
| | | regexp(value) |
| | | }) |
| | | $("input[name=num11]").bind('input',function(){ |
| | | var value = $(this).val() |
| | | regexp(value) |
| | | }) |
| | | $("input[name=num12]").bind('input',function(){ |
| | | var value = $(this).val() |
| | | regexp(value) |
| | | }) |
| | | $("input[name=num13]").bind('input',function(){ |
| | | var value = $(this).val() |
| | | regexp(value) |
| | | }) |
| | | $("input[name=num14]").bind('input',function(){ |
| | | var value = $(this).val() |
| | | regexp(value) |
| | | }) |
| | | $("input[name=num15]").bind('input',function(){ |
| | | var value = $(this).val() |
| | | regexp(value) |
| | | }) |
| | | $("input[name=num16]").bind('input',function(){ |
| | | var value = $(this).val() |
| | | regexp(value) |
| | | }) |
| | | $("input[name=num17]").bind('input',function(){ |
| | | var value = $(this).val() |
| | | regexp(value) |
| | | }) |
| | | $("input[name=num18]").bind('input',function(){ |
| | | var value = $(this).val() |
| | | regexp(value) |
| | | }) |
| | | $("input[name=num19]").bind('input',function(){ |
| | | var value = $(this).val() |
| | | regexp(value) |
| | | }) |
| | | $("input[name=num20]").bind('input',function(){ |
| | | var value = $(this).val() |
| | | regexp(value) |
| | | }) |
| | | /*function regexp(value){ |
| | | var reg=/^[1-9]\d*$/;//由 1-9开头 的正则表达式 |
| | | //先判断是否为整数 在判断 是否在 1-总页 整数范围之内 |
| | | if(reg.test(value)){ |
| | | if(parseInt(value) <= 0){ |
| | | Feng.error("请输入大于0的正整数"); |
| | | return; |
| | | } |
| | | }else{ |
| | | Feng.error("请输入大于0的正整数"); |
| | | return; |
| | | } |
| | | }*/ |
| | | function regexp(value){ |
| | | var reg=/^(\d+.?)?\d{0,2}$/;//由 1-9开头 的正则表达式 整数 两位小数 |
| | | //先判断是否为整数 在判断 是否在 1-总页 整数范围之内 |
| | | if(reg.test(value)){ |
| | | if(value == 0){ |
| | | Feng.error("请输入大于0的整数或保留两位小数"); |
| | | return; |
| | | } |
| | | }else{ |
| | | Feng.error("请输入整数或保留两位小数"); |
| | | return; |
| | | } |
| | | } |
| | | </script> |
| | | @} |
| | |
| | | <#button name="查询" icon="fa-search" clickFun="TDriver.search()"/> |
| | | <#button name="重置" icon="fa-trash" clickFun="TDriver.resetSearch()" space="true"/> |
| | | </div> |
| | | <div class="col-sm-12"> |
| | | @if(shiro.hasPermission("/tDriver/auditPage")){ |
| | | <#button name="立即审核" icon="fa-edit" clickFun="TDriver.auditPage()"/> |
| | | @} |
| | | @if(shiro.hasPermission("/tDriver/export")){ |
| | | <#button name="导出" icon="" clickFun="TDriver.export()"/> |
| | | @} |
| | | @if(shiro.hasPermission("/tDriver/tDriver_exception")){ |
| | | <#button name="异常" icon="" clickFun="TDriverException.tDriverException()"/> |
| | | @} |
| | | @if(shiro.hasPermission("/tDriver/rechargeBalancePage")){ |
| | | <#button name="充值" icon="fa-edit" clickFun="TDriver.rechargeBalancePage()"/> |
| | | @} |
| | | @if(shiro.hasPermission("/tDriver/add")){ |
| | | <#button name="添加" icon="fa-plus" clickFun="TDriver.openAddTDriver()"/> |
| | | @} |
| | | </div> |
| | | </div> |
| | | <!--<div class="hidden-xs" id="TDriverTableToolbar" role="group"> |
| | | <div class="hidden-xs" id="TDriverTableToolbar" role="group"> |
| | | @if(shiro.hasPermission("/tDriver/auditPage")){ |
| | | <#button name="立即审核" icon="fa-edit" clickFun="TDriver.auditPage()"/> |
| | | @} |
| | | @if(shiro.hasPermission("/tDriver/export")){ |
| | | <#button name="导出" icon="" clickFun="TDriver.export()" space="true"/> |
| | | @} |
| | | @if(shiro.hasPermission("/tDriver/tDriver_exception")){ |
| | | <#button name="异常" icon="" clickFun="TDriverException.tDriverException()" space="true"/> |
| | | @} |
| | | @if(shiro.hasPermission("/tDriver/rechargeBalancePage")){ |
| | | <#button name="充值" icon="fa-edit" clickFun="TDriver.rechargeBalancePage()" space="true"/> |
| | | @} |
| | | @if(shiro.hasPermission("/tDriver/add")){ |
| | | <#button name="添加" icon="fa-plus" clickFun="TDriver.openAddTDriver()"/> |
| | | <#button name="添加" icon="fa-plus" clickFun="TDriver.openAddTDriver()" space="true"/> |
| | | @} |
| | | @if(shiro.hasPermission("/tDriver/update")){ |
| | | <#button name="修改" icon="fa-edit" clickFun="TDriver.openTDriverDetail()" space="true"/> |
| | | @} |
| | | @if(shiro.hasPermission("/tDriver/delete")){ |
| | | <#button name="删除" icon="fa-remove" clickFun="TDriver.delete()" space="true"/> |
| | | @} |
| | | </div>--> |
| | | </div> |
| | | <#table id="TDriverTable"/> |
| | | </div> |
| | | </div> |
| | |
| | | <hr/> |
| | | |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <div class="initialLevel col-sm-2 control-label form-group" > |
| | | <label class="control-label" >累计订单:</label> |
| | | <label>${cumulativeOrderCount}</label> |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <label class="control-label" >时间筛选:</label> |
| | | <input id="time" placeholder="请选择时间" style="height: 30px"> |
| | | <#button name="查询" icon="fa-search" clickFun="search()"/> |
| | | <label id="balance">钱包余额:¥${balance}</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 id="cumulativeOrderCount">${cumulativeOrderCount}</label> |
| | | </div> |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <label class="control-label" >邀约用户人数:</label> |
| | | <label>${inviterCount}</label> |
| | | <label class="control-label" >邀约司机数:</label> |
| | | <label id="inviterDriverCount">${inviterDriverCount}</label> |
| | | </div> |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <label class="control-label" >累计获得佣金:</label> |
| | | <label>${inviterCommission}</label> |
| | | </div> |
| | | <div class="initialLevel col-sm-2 control-label form-group" > |
| | | <label class="control-label" >当前积分:</label> |
| | | <label>${integral}</label> |
| | | </div> |
| | | <div class="initialLevel col-sm-2 control-label form-group" > |
| | | <label class="control-label" >代驾次数:</label> |
| | | <label>${cumulativeOrderCount}</label> |
| | | <label id="inviterCommission">${inviterCommission}</label> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <div class="initialLevel col-sm-2 control-label form-group" > |
| | | <label class="control-label" >累计获得收入:</label> |
| | | <label>${cumulativeIncome}</label> |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <label class="control-label" >有效订单数:</label> |
| | | <label id="effectiveOrderCount">${effectiveOrderCount}</label> |
| | | </div> |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <label class="control-label" >钱包余额:</label> |
| | | <label>${balance}</label> |
| | | <label class="control-label" >邀约用户数:</label> |
| | | <label id="inviterUserCount">${inviterUserCount}</label> |
| | | </div> |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <label class="control-label" >评论分数:</label> |
| | | <label>${score}</label> |
| | | <label class="control-label" >佣金余额:</label> |
| | | <label id="commission">${commission}</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 id="cumulativeIncome">${cumulativeIncome}</label> |
| | | </div> |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <label class="control-label" >消单次数:</label> |
| | | <label id="cancelOrderCount">${cancelOrderCount}</label> |
| | | </div> |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <label class="control-label" >有效在线时长:</label> |
| | | <label id="onlineTime">${onlineTime}</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> |
| | |
| | | type: 'date', |
| | | range: true |
| | | }); |
| | | laydate.render({ |
| | | elem: '#time', |
| | | type: 'date', |
| | | range: true |
| | | }); |
| | | </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" id="driverInfoForm"> |
| | | <div class="row row-lg"> |
| | | <div class="col-sm-12"> |
| | | <input hidden id="id" value="${item.id}"/> |
| | | <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 class="initialLevel col-sm-3 control-label form-group" > |
| | | <span style="color:red">*</span> |
| | | <label class="control-label" >姓名:</label> |
| | | <input id="name" name="name" value="${item.name}" type="text" maxlength="20" style="height: 30px" required> |
| | | <input id="name" name="name" type="text" value="${driver.name}" style="height: 30px" maxlength="20" placeholder="请输入" required="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" name="phone" value="${item.phone}" type="number" maxlength="11" style="height: 30px" required> |
| | | <input id="phone" name="phone" type="number" value="${driver.phone}" style="height: 30px" maxlength="11" placeholder="请输入" required="required"> |
| | | </div> |
| | | </div> |
| | | |
| | |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <span style="color:red">*</span> |
| | | <label class="control-label" >紧急联系人姓名:</label> |
| | | <input id="emergencyContact" name="emergencyContact" value="${item.emergencyContact}" type="text" maxlength="20" style="height: 30px" required disabled> |
| | | <input id="emergencyContact" name="emergencyContact" value="${driver.emergencyContact}" type="text" maxlength="20" placeholder="请输入" 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" name="emergencyPhone" value="${item.emergencyPhone}" type="number" maxlength="11" style="height: 30px" required disabled> |
| | | <input id="emergencyPhone" name="emergencyPhone" value="${driver.emergencyPhone}" type="number" maxlength="11" placeholder="请输入" 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" maxlength="20" style="height: 30px" disabled> |
| | | <input id="inviterName" type="text" value="${driver.inviterName}" maxlength="20" placeholder="请输入" 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" maxlength="11" style="height: 30px" disabled> |
| | | <input id="inviterPhone" type="number" value="${driver.inviterPhone}" maxlength="11" placeholder="请输入" style="height: 30px"> |
| | | </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.areaUpdate()" name="area" placeholder="请选择" style="height: 30px" readonly required> |
| | | <input id="area" onclick="TDriver.areaAdd()" name="area" value="${item.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="idcard" name="idcard" value="${item.idcard}" type="text" maxlength="20" style="height: 30px" required disabled> |
| | | <input id="idcard" name="idcard" type="text" value="${driver.idcard}" maxlength="20" placeholder="请输入" 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> |
| | | <div class="form-group"> |
| | | <div class="col-sm-4"> |
| | | <div id="idcardFrontPreId"> |
| | | <div><img width="100px" height="100px" src="${item.idcardFront}"> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <label class="control-label" >身份证正面照:</label> |
| | | <#uploadImg id="idcardFront" fileImg="${driver.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 class="initialLevel col-sm-3 control-label form-group"> |
| | | <span style="color:red">*</span> |
| | | <label class="control-label">身份证背面照:</label> |
| | | <div class="form-group"> |
| | | <div class="col-sm-4"> |
| | | <div id="idcardBackPreId"> |
| | | <div><img width="100px" height="100px" src="${item.idcardBack}"> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <label class="control-label" >身份证背面照:</label> |
| | | <#uploadImg id="idcardBack" fileImg="${driver.idcardBack}"/> |
| | | </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="firstCertificateTime" name="firstCertificateTime" value="${item.firstCertificateTimeStr}" type="text" style="height: 30px" disabled> |
| | | <input id="firstCertificateTime" name="firstCertificateTime" value="${item.firstCertificateTimeStr}" type="text" placeholder="请选择时间" 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>--> |
| | | <!-- <#uploadImg id="driverLicense" fileImg="${item.driverLicense}"/>--> |
| | | <!-- </div>--> |
| | | <div class="initialLevel col-sm-3 control-label form-group"> |
| | | <span style="color:red">*</span> |
| | | <label class="control-label">驾驶证:</label> |
| | | <div class="form-group"> |
| | | <div class="col-sm-4"> |
| | | <div id="driverLicensePreId"> |
| | | <div><img width="100px" height="100px" src="${item.driverLicense}"> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <label class="control-label" >驾驶证:</label> |
| | | <#uploadImg id="driverLicense" fileImg="${driver.driverLicense}"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <!--<div class="ibox float-e-margins"> |
| | | <div class="ibox-content"> |
| | | <div class="form-horizontal"> |
| | | |
| | | <div class="row"> |
| | | <div class="col-sm-6 b-r"> |
| | | <#input id="id" name="主键" value="${item.id}" underline="true"/> |
| | | <#input id="code" name="编号" value="${item.code}" underline="true"/> |
| | | <#input id="name" name="姓名" value="${item.name}" underline="true"/> |
| | | <#input id="avatar" name="头像" value="${item.avatar}" underline="true"/> |
| | | <#input id="phone" name="手机号" value="${item.phone}" underline="true"/> |
| | | <#input id="password" name="密码" value="${item.password}" underline="true"/> |
| | | <#input id="sex" name="性别(1=男,2=女)" value="${item.sex}" underline="true"/> |
| | | <#input id="source" name="来源(1=)" value="${item.source}" underline="true"/> |
| | | <#input id="emergencyContact" name="紧急联系人" value="${item.emergencyContact}" underline="true"/> |
| | | <#input id="emergencyPhone" name="紧急联系电话" value="${item.emergencyPhone}" underline="true"/> |
| | | <#input id="driverLicenseNumber" name="驾驶证号码" value="${item.driverLicenseNumber}" underline="true"/> |
| | | <#input id="driverLicense" name="驾驶证照片" value="${item.driverLicense}" underline="true"/> |
| | | <#input id="idcard" name="身份证号码" value="${item.idcard}" underline="true"/> |
| | | <#input id="idcardFront" name="身份证正面照" value="${item.idcardFront}" /> |
| | | </div> |
| | | |
| | | <div class="col-sm-6"> |
| | | <#input id="idcardBack" name="身份证背面照" value="${item.idcardBack}" underline="true"/> |
| | | <#input id="inviterType" name="邀约人类型(1=用户,2=司机)" value="${item.inviterType}" underline="true"/> |
| | | <#input id="inviterId" name="邀约人id" value="${item.inviterId}" underline="true"/> |
| | | <#input id="agentId" name="代理商id" value="${item.agentId}" underline="true"/> |
| | | <#input id="branchOfficeId" name="分公司id" value="${item.branchOfficeId}" underline="true"/> |
| | | <#input id="balance" name="账户余额" value="${item.balance}" underline="true"/> |
| | | <#input id="approvalStatus" name="审核状态(1=待审核,2=已同意,3=已拒绝)" value="${item.approvalStatus}" underline="true"/> |
| | | <#input id="approvalNotes" name="审核注释" value="${item.approvalNotes}" underline="true"/> |
| | | <#input id="approvalUserId" name="审核用户id" value="${item.approvalUserId}" underline="true"/> |
| | | <#input id="approvalTime" name="审核时间" value="${item.approvalTime}" underline="true"/> |
| | | <#input id="serverStatus" name="服务状态(1=空闲,2=服务中)" value="${item.serverStatus}" underline="true"/> |
| | | <#input id="integral" name="剩余积分" value="${item.integral}" underline="true"/> |
| | | <#input id="status" name="状态(1=正常,2=冻结,3=删除)" value="${item.status}" underline="true"/> |
| | | <#input id="createTime" name="添加时间" value="${item.createTime}" /> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="row btn-group-m-t"> |
| | | <div class="col-sm-10"> |
| | | <#button btnCss="info" name="提交" id="ensure" icon="fa-check" clickFun="TDriverInfoDlg.editSubmit()"/> |
| | | <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" clickFun="TDriverInfoDlg.close()"/> |
| | | </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 () { |
| | | if('' == $("#inviterName").val()){ |
| | | $("#inviterName").val('') |
| | | } |
| | | if('' == $("#inviterPhone").val()){ |
| | | $("#inviterPhone").val('') |
| | | } |
| | | |
| | | var idCardPositive = new $WebUpload("idcardFront"); |
| | | idCardPositive.setUploadBarId("progressBar"); |
| | | idCardPositive.init(); |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/static/modular/system/tCoupon/tAgent_info.js"></script> |
| | | <script src="${ctxPath}/static/modular/system/tCoupon/tAgent.js"></script> |
| | | |
| | | <link rel="stylesheet" href="${ctxPath}/static/css/plugins/lineProgressbar/jquery.lineProgressbar.css"> |
| | | <script src="${ctxPath}/static/js/plugins/lineProgressbar/jquery.lineProgressbar.js"></script> |
| | |
| | | <#button name="查询" icon="fa-search" clickFun="TOrder.search()"/> |
| | | <#button name="重置" icon="fa-trash" clickFun="TOrder.resetSearch()" space="true"/> |
| | | </div> |
| | | <div class="col-sm-12"> |
| | | <div class="hidden-xs" id="TOrderTableToolbar" role="group"> |
| | | @if(shiro.hasPermission("/tOrder/cancelOrder")){ |
| | | <#button name="取消订单" icon="" clickFun="TOrder.cancelOrder()"/> |
| | | @} |
| | |
| | | @} |
| | | @if(shiro.hasPermission("/tOrder/cancelOrderUpdate")){ |
| | | <#button name="关闭订单" icon="" clickFun="TOrder.cancelOrderUpdate()"/> |
| | | @} |
| | | </div> |
| | | <div class="hidden-xs" id="TOrderTableToolbar" role="group"> |
| | | @if(shiro.hasPermission("/tOrder/add")){ |
| | | <#button name="添加" icon="fa-plus" clickFun="TOrder.openAddTOrder()"/> |
| | | @} |
| | | @if(shiro.hasPermission("/tOrder/update")){ |
| | | <#button name="修改" icon="fa-edit" clickFun="TOrder.openTOrderDetail()" space="true"/> |
| | | @} |
| | | @if(shiro.hasPermission("/tOrder/delete")){ |
| | | <#button name="删除" icon="fa-remove" clickFun="TOrder.delete()" space="true"/> |
| | | @} |
| | | </div> |
| | | <#table id="TOrderTable"/> |
| | |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <label class="control-label" >上车地点:</label> |
| | | <label>${startAddress}</label> |
| | | <label>${boardingAddress}</label> |
| | | </div> |
| | | <div class="initialLevel col-sm-2 control-label form-group" > |
| | | <label class="control-label">上车时间:</label> |
| | |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <label class="control-label" >下车地点:</label> |
| | | <label>${endAddress}</label> |
| | | <label>${debusAddress}</label> |
| | | </div> |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <label class="control-label" >下车时间:</label> |
| | |
| | | </div> |
| | | </div> |
| | | @} |
| | | |
| | | <div class="row" style="margin-top: 30px;"> |
| | | <div class="col-sm-4"> |
| | | <h2 class="h3Class" style="font-weight: 700;">线路轨迹</h2> |
| | | </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>${actualMileage}KM</label> |
| | | </div> |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <label class="control-label" >行驶时长:</label> |
| | | <label>${time}</label> |
| | | </div> |
| | | </div> |
| | | <div class="row"> |
| | | <div class="col-sm-10"> |
| | | <div class="form-horizontal" id="container" style="margin-left: 50px;width: 100%; height: 500px;"></div> |
| | |
| | | </div> |
| | | |
| | | <div class="initialLevel col-sm-12 control-label form-group" style="text-align: left" > |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <span class="control-label" >抽成,每笔订单满</span> |
| | | <input class="control-label" id="num2" name="num2" value="${num2}" type="number" min="0" style="height: 30px;width: 80px"> |
| | | <span class="control-label" >元/单,抽取</span> |
| | | <input class="control-label" id="num3" name="num3" value="${num3}" type="number" min="0" style="height: 30px;width: 80px"> |
| | | <span class="control-label" >元,平台收取</span> |
| | | <input class="control-label" id="num4" name="num4" value="${num4}" type="number" min="0" style="height: 30px;width: 80px"> |
| | | <span class="control-label" >元</span> |
| | | </div> |
| | | </div> |
| | |
| | | var value = $(this).val() |
| | | regexp(value) |
| | | }) |
| | | $("input[name=num4]").bind('input',function(){ |
| | | var value = $(this).val() |
| | | regexp(value) |
| | | }) |
| | | // function regexp(value){ |
| | | // var reg=/^[1-9]\d*$/;//由 1-9开头 的正则表达式 |
| | | // //先判断是否为整数 在判断 是否在 1-总页 整数范围之内 |
| | |
| | | }}, |
| | | {title: '操作', visible: true, align: 'center', valign: 'middle',width:150, |
| | | formatter: function (value, row) { |
| | | if (row.status === 1){ |
| | | return '<a href="#" onclick="TAgent.updateStatus('+row.id+','+row.status+')" style="color:red">停用</a>' +' ' + |
| | | '<a href="#" onclick="TAgent.searchTAgentDetail('+row.id+')" style="color:green">详情</a>' |
| | | }else if (row.status === 2){ |
| | | return '<a href="#" onclick="TAgent.updateStatus('+row.id+','+row.status+')" style="color:green">解冻</a>' +' ' + |
| | | '<a href="#" onclick="TAgent.searchTAgentDetail('+row.id+')" style="color:green">详情</a>' |
| | | } |
| | | return '<a href="#" onclick="TAgent.searchTAgentDetail('+row.id+')" style="color:green">详情</a>' |
| | | } |
| | | } |
| | | ]; |
| | |
| | | this.layerIndex = index; |
| | | }; |
| | | |
| | | TAgent.openUpdateTAgent = function(){ |
| | | if (this.check()) { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: '编辑', |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tAgent/tAgent_update/' + TAgent.seItem.id |
| | | }); |
| | | this.layerIndex = index; |
| | | } |
| | | } |
| | | TAgent.stop = function(){ |
| | | if(this.check()){ |
| | | var ajax = new $ax(Feng.ctxPath + "/tAgent/update-status", function (data) { |
| | | Feng.success("修改成功!"); |
| | | TAgent.table.refresh(); |
| | | }, function (data) { |
| | | Feng.error("修改失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set("id", TAgent.seItem.id); |
| | | ajax.set("status", 1); |
| | | ajax.start(); |
| | | } |
| | | } |
| | | TAgent.start = function(){ |
| | | if(this.check()){ |
| | | var ajax = new $ax(Feng.ctxPath + "/tAgent/update-status", function (data) { |
| | | Feng.success("修改成功!"); |
| | | TAgent.table.refresh(); |
| | | }, function (data) { |
| | | Feng.error("修改失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set("id", TAgent.seItem.id); |
| | | ajax.set("status", 2); |
| | | ajax.start(); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 提交启用冻结 |
| | | */ |
| | |
| | | this.layerIndex = index; |
| | | }; |
| | | |
| | | /** |
| | | * 打开查看详情 |
| | | */ |
| | | TAgent.openTAgentDetail = function () { |
| | | if (this.check()) { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: '详情', |
| | | area: ['800px', '420px'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tAgent/tAgent_update/' + TAgent.seItem.id |
| | | }); |
| | | this.layerIndex = index; |
| | | } |
| | | }; |
| | | |
| | | /** |
| | | * 打开区域选择页面 |
| | |
| | | if(this.value==""){ |
| | | $("#city").empty();//二级联动设为空设为空 |
| | | $("#city").append('<option value="">请选择</option>'); |
| | | // //region |
| | | // $("#district").empty();//三级联动设为空设为空 |
| | | // $("#district").append('<option value="">请选择</option>'); |
| | | } |
| | | if(this.value!=""){//第一级下拉菜单选择了值 |
| | | $("#city").empty();//先行置空,防止上次选择留下的元素影响效果 |
| | | $("#city").append('<option value="">请选择</option>')//设置初始选项 |
| | | //region |
| | | // $("#district").empty();//三级联动设为空设为空 |
| | | // $("#district").append('<option value="">请选择</option>'); |
| | | var province = document.getElementById('province'); |
| | | var index= province.selectedIndex ; |
| | | var id = province.options[index].id; |
| | |
| | | parent.$("#area").val(provinceName+'/'+cityName) |
| | | parent.$("#areaId").val(provinceId+'/'+cityId) |
| | | TAgentInfoDlg.close(); |
| | | // var province = document.getElementById('province'); |
| | | // var provinceIndex= province.selectedIndex ; |
| | | // var provinceId = province.options[provinceIndex].value; |
| | | // var provinceName = province.options[provinceIndex].innerText; |
| | | // console.log(provinceId) |
| | | // console.log(provinceName) |
| | | // |
| | | // if(provinceName == null || provinceName == ''){ |
| | | // Feng.error("请选择省份!") |
| | | // return; |
| | | // } |
| | | // |
| | | // var city = document.getElementById('city'); |
| | | // var cityIndex= city.selectedIndex ; |
| | | // var cityId = city.options[cityIndex].value; |
| | | // var cityName = city.options[cityIndex].innerText; |
| | | // console.log(cityId) |
| | | // console.log(cityName) |
| | | // if(cityName == null || cityName == '' || cityName =='请选择'){ |
| | | // Feng.error("请选择市区!") |
| | | // return; |
| | | // } |
| | | // |
| | | // var district = document.getElementById('district'); |
| | | // var districtIndex= district.selectedIndex ; |
| | | // var districtId = district.options[districtIndex].value; |
| | | // var districtName = district.options[districtIndex].innerText; |
| | | // console.log(districtId) |
| | | // console.log(districtName) |
| | | // |
| | | // if(districtName == '' || districtName == null || districtName == '请选择'){ |
| | | // parent.$("#area").val(provinceName+'/'+cityName) |
| | | // parent.$("#areaId").val(provinceId+'/'+cityId) |
| | | // }else { |
| | | // parent.$("#area").val(provinceName+'/'+cityName+'/'+districtName) |
| | | // parent.$("#areaId").val(provinceId+'/'+cityId+'/'+districtId) |
| | | // } |
| | | // TAgentInfoDlg.close(); |
| | | } |
| | | |
| | | |
New file |
| | |
| | | /** |
| | | * 初始化详情对话框 |
| | | */ |
| | | var TAgentInfoDlg = { |
| | | tAgentInfoData : {}, |
| | | validateFields: { |
| | | principal: { |
| | | validators: { |
| | | notEmpty: { |
| | | message: '负责人姓名不能为空' |
| | | }, |
| | | regexp: { |
| | | regexp: /^[\u4E00-\u9FA5A-Za-z\s]+$/, |
| | | message: '不能输入特殊字符和数字' |
| | | } |
| | | } |
| | | }, |
| | | principalPhone: { |
| | | validators: { |
| | | notEmpty: { |
| | | message: '联系电话不能为空' |
| | | }, |
| | | regexp: { |
| | | regexp: /^1[3-9]\d{9}$/, |
| | | message: '请输入合法手机号' |
| | | } |
| | | } |
| | | }, |
| | | area: { |
| | | validators: { |
| | | notEmpty: { |
| | | message: '请选择代理区域' |
| | | } |
| | | } |
| | | }, |
| | | account: { |
| | | validators: { |
| | | notEmpty: { |
| | | message: '登录账号不能为空' |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }; |
| | | /** |
| | | * 验证数据是否为空 |
| | | */ |
| | | TAgentInfoDlg.validate = function () { |
| | | $('#tAgentInfoForm').data("bootstrapValidator").resetForm(); |
| | | $('#tAgentInfoForm').bootstrapValidator('validate'); |
| | | return $("#tAgentInfoForm").data('bootstrapValidator').isValid(); |
| | | }; |
| | | /** |
| | | * 清除数据 |
| | | */ |
| | | TAgentInfoDlg.clearData = function() { |
| | | this.tAgentInfoData = {}; |
| | | } |
| | | /** |
| | | * 设置对话框中的数据 |
| | | * |
| | | * @param key 数据的名称 |
| | | * @param val 数据的具体值 |
| | | */ |
| | | TAgentInfoDlg.set = function(key, val) { |
| | | this.tAgentInfoData[key] = (typeof val == "undefined") ? $("#" + key).val() : val; |
| | | return this; |
| | | } |
| | | /** |
| | | * 设置对话框中的数据 |
| | | * |
| | | * @param key 数据的名称 |
| | | * @param val 数据的具体值 |
| | | */ |
| | | TAgentInfoDlg.get = function(key) { |
| | | return $("#" + key).val(); |
| | | } |
| | | /** |
| | | * 关闭此对话框 |
| | | */ |
| | | TAgentInfoDlg.close = function() { |
| | | parent.layer.close(window.parent.TAgent.layerIndex); |
| | | } |
| | | /** |
| | | * 收集数据 |
| | | */ |
| | | TAgentInfoDlg.collectData = function() { |
| | | this |
| | | .set('id') |
| | | .set('principal') |
| | | .set('principalPhone') |
| | | .set('email') |
| | | .set('provinceCode') |
| | | .set('provinceName') |
| | | .set('cityCode') |
| | | .set('cityName') |
| | | .set('status') |
| | | .set('area') |
| | | .set('areaId') |
| | | .set('account') |
| | | .set('password'); |
| | | } |
| | | /** |
| | | * 提交修改 |
| | | */ |
| | | TAgentInfoDlg.editSubmit = function() { |
| | | this.clearData(); |
| | | this.collectData(); |
| | | if(!this.validate()){ |
| | | return ; |
| | | } |
| | | let password = $('#password').val(); |
| | | let rePassword = $('#rePassword').val(); |
| | | if(null != password && '' != password && password != rePassword){ |
| | | Feng.error("两个密码不一致"); |
| | | return |
| | | } |
| | | //提交信息 |
| | | var ajax = new $ax(Feng.ctxPath + "/tAgent/update", function(data){ |
| | | Feng.success("修改成功!"); |
| | | window.parent.TAgent.table.refresh(); |
| | | TAgentInfoDlg.close(); |
| | | },function(data){ |
| | | Feng.error("修改失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set(this.tAgentInfoData); |
| | | ajax.start(); |
| | | } |
| | | $(function() { |
| | | Feng.initValidator("tAgentInfoForm", TAgentInfoDlg.validateFields); |
| | | }); |
| | |
| | | }, |
| | | {title: '操作', visible: true, align: 'center', valign: 'middle',width:150, |
| | | formatter: function (value, row) { |
| | | if(row.userType !== 1){ |
| | | return '<a href="#" onclick="TBranchOffice.searchTBranchOfficeDetail('+row.id+')" style="color:blue">详情</a>' |
| | | }else { |
| | | return '<a href="#" onclick="TBranchOffice.searchTBranchOfficeDetail('+row.id+')" style="color:blue">详情</a>' +' ' + |
| | | '<a href="#" onclick="TBranchOffice.delete('+row.id+')" style="color:red">删除</a>' |
| | | } |
| | | return '<a href="#" onclick="TBranchOffice.searchTBranchOfficeDetail('+row.id+')" style="color:blue">详情</a>' |
| | | } |
| | | } |
| | | ]; |
| | |
| | | } |
| | | } |
| | | }, |
| | | emergencyPhone: { |
| | | num22: { |
| | | validators: { |
| | | notEmpty: { |
| | | message: '代理商抽成不能为空' |
| | | message: '客服电话不能为空' |
| | | } |
| | | } |
| | | }, |
| | | account: { |
| | | validators: { |
| | | notEmpty: { |
| | | message: '登录账号不能为空' |
| | | } |
| | | } |
| | | }, |
| | | password: { |
| | | validators: { |
| | | notEmpty: { |
| | | message: '登录密码不能为空' |
| | | }, |
| | | identical: { |
| | | field: 'rePassword', |
| | | message: '两次密码不一致' |
| | | }, |
| | | } |
| | | }, |
| | | rePassword: { |
| | | validators: { |
| | | notEmpty: { |
| | | message: '密码不能为空' |
| | | }, |
| | | identical: { |
| | | field: 'password', |
| | | message: '两次密码不一致' |
| | | }, |
| | | } |
| | | } |
| | | } |
| | |
| | | if(!this.validate()){ |
| | | return ; |
| | | } |
| | | |
| | | let account = $('#account').val(); |
| | | let password = $('#password').val(); |
| | | let rePassword = $('#rePassword').val(); |
| | | if(null == account || '' == account){ |
| | | Feng.error("账号不能为空"); |
| | | return |
| | | } |
| | | if(null == password || '' == password){ |
| | | Feng.error("密码不能为空"); |
| | | return |
| | | } |
| | | if(null == rePassword || '' == rePassword || password != rePassword){ |
| | | Feng.error("密码不一致"); |
| | | return |
| | | } |
| | | //提交信息 |
| | | var ajax = new $ax(Feng.ctxPath + "/tBranchOffice/add", function(data){ |
| | | if(data.code == 500){ |
| | |
| | | },function(data){ |
| | | Feng.error("添加失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | var json1=[]; |
| | | for (let i = 0; i < $('input[name="num1"]').length; i++) { |
| | | var arr = {} |
| | | arr['num1'] = $($('input[name="num1"]')[i]).val(); |
| | | arr['num2'] = $($('input[name="num2"]')[i]).val(); |
| | | arr['num3'] = Number($($('input[name="num3"]')[i]).val()); |
| | | arr['num4'] = Number($($('input[name="num4"]')[i]).val()); |
| | | arr['num5'] = Number($($('input[name="num5"]')[i]).val()); |
| | | arr['num6'] = Number($($('input[name="num6"]')[i]).val()); |
| | | arr['num7'] = Number($($('input[name="num7"]')[i]).val()); |
| | | arr['num8'] = Number($($('input[name="num8"]')[i]).val()); |
| | | arr['num9'] = Number($($('input[name="num9"]')[i]).val()); |
| | | arr['num10'] = Number($($('input[name="num10"]')[i]).val()); |
| | | arr['num11'] = Number($($('input[name="num11"]')[i]).val()); |
| | | json1.push(arr) |
| | | } |
| | | var ExtraCost = {}; |
| | | ExtraCost['num1'] = Number($('#num12').val()); |
| | | ExtraCost['num2'] = Number($('#num13').val()); |
| | | ExtraCost['num3'] = Number($('#num14').val()); |
| | | ExtraCost['num4'] = Number($('#num15').val()); |
| | | ExtraCost['num5'] = Number($('#num16').val()); |
| | | ExtraCost['num6'] = Number($('#num17').val()); |
| | | ExtraCost['num7'] = Number($('#num18').val()); |
| | | ExtraCost['num8'] = Number($('#num19').val()); |
| | | ExtraCost['num9'] = Number($('#num20').val()); |
| | | ExtraCost['num10'] = Number($('#num21').val()); |
| | | var reqData = {}; |
| | | reqData['ChargeStandard'] = json1; |
| | | reqData['ExtraCost'] = ExtraCost; |
| | | // ajax.set("content",JSON.stringify(reqData)); |
| | | // ajax.set("type",5); |
| | | this.tBranchOfficeInfoData.systemPriceType = 5; |
| | | this.tBranchOfficeInfoData.systemPriceContent = JSON.stringify(reqData); |
| | | this.tBranchOfficeInfoData.holiday = $('#holiday').is(":checked") ? 1 : 0; |
| | | this.tBranchOfficeInfoData.isTaxiCar = $('#isTaxiCar').is(":checked") ? 1 : 0; |
| | | this.tBranchOfficeInfoData.serviceTel = $('#num22').val(); |
| | | ajax.set(this.tBranchOfficeInfoData); |
| | | ajax.start(); |
| | | } |
| | |
| | | },function(data){ |
| | | Feng.error("修改失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | var json1=[]; |
| | | for (let i = 0; i < $('input[name="num1"]').length; i++) { |
| | | var arr = {} |
| | | arr['num1'] = $($('input[name="num1"]')[i]).val(); |
| | | arr['num2'] = $($('input[name="num2"]')[i]).val(); |
| | | arr['num3'] = Number($($('input[name="num3"]')[i]).val()); |
| | | arr['num4'] = Number($($('input[name="num4"]')[i]).val()); |
| | | arr['num5'] = Number($($('input[name="num5"]')[i]).val()); |
| | | arr['num6'] = Number($($('input[name="num6"]')[i]).val()); |
| | | arr['num7'] = Number($($('input[name="num7"]')[i]).val()); |
| | | arr['num8'] = Number($($('input[name="num8"]')[i]).val()); |
| | | arr['num9'] = Number($($('input[name="num9"]')[i]).val()); |
| | | arr['num10'] = Number($($('input[name="num10"]')[i]).val()); |
| | | arr['num11'] = Number($($('input[name="num11"]')[i]).val()); |
| | | json1.push(arr) |
| | | } |
| | | var ExtraCost = {}; |
| | | ExtraCost['num1'] = Number($('#num12').val()); |
| | | ExtraCost['num2'] = Number($('#num13').val()); |
| | | ExtraCost['num3'] = Number($('#num14').val()); |
| | | ExtraCost['num4'] = Number($('#num15').val()); |
| | | ExtraCost['num5'] = Number($('#num16').val()); |
| | | ExtraCost['num6'] = Number($('#num17').val()); |
| | | ExtraCost['num7'] = Number($('#num18').val()); |
| | | ExtraCost['num8'] = Number($('#num19').val()); |
| | | ExtraCost['num9'] = Number($('#num20').val()); |
| | | ExtraCost['num10'] = Number($('#num21').val()); |
| | | var reqData = {}; |
| | | reqData['ChargeStandard'] = json1; |
| | | reqData['ExtraCost'] = ExtraCost; |
| | | // ajax.set("content",JSON.stringify(reqData)); |
| | | // ajax.set("type",5); |
| | | this.tBranchOfficeInfoData.systemPriceType = 5; |
| | | this.tBranchOfficeInfoData.systemPriceContent = JSON.stringify(reqData); |
| | | this.tBranchOfficeInfoData.holiday = $('#holiday').is(":checked") ? 1 : 0; |
| | | this.tBranchOfficeInfoData.isTaxiCar = $('#isTaxiCar').is(":checked") ? 1 : 0; |
| | | this.tBranchOfficeInfoData.serviceTel = $('#num22').val(); |
| | | ajax.set(this.tBranchOfficeInfoData); |
| | | ajax.start(); |
| | | } |
| | | |
| | | |
| | | TBranchOfficeInfoDlg.addBox = function (){ |
| | | var i = $('input[name="num1"]').length + 1; |
| | | var a ="<div>\n" + |
| | | " <div class=\"initialLevel col-sm-12 control-label form-group\" >\n" + |
| | | " <span class=\"control-label\" >时间段</span>\n" + |
| | | " <input class=\"control-label\" id=\"num1-"+i+"\" name=\"num1\" type=\"text\" placeholder=\"00:00\" style=\"height: 30px;width: 80px\">\n" + |
| | | " <span class=\"control-label\" >——</span>\n" + |
| | | " <input class=\"control-label\" id=\"num2-"+i+"\" name=\"num2\" type=\"text\" placeholder=\"00:00\" style=\"height: 30px;width: 80px\">\n" + |
| | | " <span class=\"control-label\" >代驾里程</span>\n" + |
| | | " <input class=\"control-label\" id=\"num3-"+i+"\" name=\"num3\" type=\"number\" style=\"height: 30px;width: 80px\">\n" + |
| | | " <span class=\"control-label\" >公里,起步价</span>\n" + |
| | | " <input class=\"control-label\" id=\"num4-"+i+"\" name=\"num4\" type=\"number\" style=\"height: 30px;width: 80px\">\n" + |
| | | " <span class=\"control-label\" >元,超出里程每</span>\n" + |
| | | " <input class=\"control-label\" id=\"num5-"+i+"\" name=\"num5\" type=\"number\" style=\"height: 30px;width: 80px\">\n" + |
| | | " <span class=\"control-label\" >公里,收费</span>\n" + |
| | | " <input class=\"control-label\" id=\"num6-"+i+"\" name=\"num6\" type=\"number\" style=\"height: 30px;width: 80px\">\n" + |
| | | " <span class=\"control-label\" >元</span>\n" + |
| | | " <span class=\"fa fa-remove\" onclick=\"TBranchOfficeInfoDlg.delBox(this)\"></span>\n" + |
| | | " </div>\n" + |
| | | " <div class=\"initialLevel col-sm-12 control-label form-group\" >\n" + |
| | | " <span class=\"control-label\" >长途里程</span>\n" + |
| | | " <input class=\"control-label\" id=\"num7-"+i+"\" name=\"num7\" type=\"number\" style=\"height: 30px;width: 80px\">\n" + |
| | | " <span class=\"control-label\" >——</span>\n" + |
| | | " <input class=\"control-label\" id=\"num8-"+i+"\" name=\"num8\" type=\"number\" style=\"height: 30px;width: 80px\">\n" + |
| | | " <span class=\"control-label\" >公里,收费</span>\n" + |
| | | " <input class=\"control-label\" id=\"num9-"+i+"\" name=\"num9\" type=\"number\" style=\"height: 30px;width: 80px\">\n" + |
| | | " <span class=\"control-label\" >元,超出里程每</span>\n" + |
| | | " <input class=\"control-label\" id=\"num10-"+i+"\" name=\"num10\" type=\"number\" style=\"height: 30px;width: 80px\">\n" + |
| | | " <span class=\"control-label\" >公里,收费</span>\n" + |
| | | " <input class=\"control-label\" id=\"num11-"+i+"\" name=\"num11\" type=\"number\" style=\"height: 30px;width: 80px\">\n" + |
| | | " <span class=\"control-label\" >元</span>\n" + |
| | | " </div>\n" + |
| | | " </div>" |
| | | $("#rules").append($(a)) |
| | | // laydate.render({ |
| | | // elem: '#num1-'+i, |
| | | // type: 'time', |
| | | // format: 'HH:mm', |
| | | // range: false, |
| | | // lang:'zn' |
| | | // }); |
| | | // laydate.render({ |
| | | // elem: '#num2-'+i, |
| | | // type: 'time', |
| | | // format: 'HH:mm', |
| | | // range: false, |
| | | // lang:'zn' |
| | | // }); |
| | | } |
| | | TBranchOfficeInfoDlg.delBox = function (o) { |
| | | $(o).parent("div").parent("div").remove() |
| | | }; |
| | | |
| | | |
| | | |
| | | $(function() { |
| | | Feng.initValidator("branchOfficeInfoForm", TBranchOfficeInfoDlg.validateFields); |
| | | }); |
| | |
| | | } |
| | | if(this.value == 2){ |
| | | $("#changeCouponSendQuantity").show() |
| | | // $("#couponSendQuantity").bind('input',function(){ |
| | | // var value = $(this).val() |
| | | // |
| | | // if(value>$("#couponCount").val()){ |
| | | // Feng.error("赠送数量必须小于限制数量") |
| | | // return; |
| | | // } |
| | | // }) |
| | | } |
| | | |
| | | }) |
| | |
| | | {title: '操作', visible: true, align: 'center', valign: 'middle',width:'160px',fixed:'true', |
| | | formatter: function (value, row) { |
| | | if (row.status === 1){ |
| | | return '<a href="#" onclick="TDriver.searchTDriverDetail('+row.id+')" style="color:green">详情</a>' +' ' + |
| | | '<a href="#" onclick="TDriver.stop('+row.id+','+row.status+')" style="color:red">冻结</a>' +' ' + |
| | | return '<a href="#" onclick="TDriver.searchTDriverDetail('+row.id+')" style="color:green">详情</a>' +' ' + |
| | | '<a href="#" onclick="TDriver.stop('+row.id+','+row.status+')" style="color:red">冻结</a>' +' ' + |
| | | '<a href="#" onclick="TDriver.updateInfo('+row.id+')" style="color:green">编辑</a>' |
| | | }else if (row.status === 2 || row.approvalStatus === 2){ |
| | | return '<a href="#" onclick="TDriver.searchTDriverDetail('+row.id+')" style="color:green">详情</a>' +' ' + |
| | | return '<a href="#" onclick="TDriver.searchTDriverDetail('+row.id+')" style="color:green">详情</a>' +' ' + |
| | | '<a href="#" onclick="TDriver.start('+row.id+','+row.status+')" style="color:green">解冻</a>' |
| | | } |
| | | } |
| | |
| | | },function(data){ |
| | | Feng.error("添加失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | console.log(this.tDriverInfoData) |
| | | ajax.set(this.tDriverInfoData); |
| | | ajax.start(); |
| | | } |
| | |
| | | ajax.start(); |
| | | } |
| | | |
| | | function search() { |
| | | var ajax = new $ax(Feng.ctxPath + "/tDriver/querySummaryData", function(data){ |
| | | $('#balance').text('钱包余额:¥' + data.balance); |
| | | $('#cumulativeOrderCount').text(data.cumulativeOrderCount); |
| | | $('#inviterDriverCount').text(data.inviterDriverCount); |
| | | $('#inviterCommission').text(data.inviterCommission); |
| | | $('#effectiveOrderCount').text(data.effectiveOrderCount); |
| | | $('#inviterUserCount').text(data.inviterUserCount); |
| | | $('#commission').text(data.commission); |
| | | $('#cumulativeIncome').text(data.cumulativeIncome); |
| | | $('#cancelOrderCount').text(data.cancelOrderCount); |
| | | $('#onlineTime').text(data.onlineTime); |
| | | },function(data){ |
| | | Feng.error("查询失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set('id', $('#driverId').val()); |
| | | ajax.set('time', $('#time').val()) |
| | | ajax.start(); |
| | | } |
| | | |
| | | $(function() { |
| | | Feng.initValidator("driverInfoForm", TDriverInfoDlg.validateFields); |
| | | }); |
| | |
| | | reqData['num1'] = Number($("#num1").val()); |
| | | reqData['num2'] = Number($("#num2").val()); |
| | | reqData['num3'] = $("#num3").val(); |
| | | reqData['num4'] = $("#num4").val(); |
| | | if(reqData.num4 > reqData.num3){ |
| | | Feng.error("平台抽成金额不能大于总抽成金额"); |
| | | return |
| | | } |
| | | ajax.set("content",JSON.stringify(reqData)); |
| | | ajax.set("type",3); |
| | | ajax.start(); |
| | |
| | | import com.supersavedriving.user.core.util.ToolUtil; |
| | | import com.supersavedriving.user.modular.system.model.*; |
| | | import com.supersavedriving.user.modular.system.service.*; |
| | | import com.supersavedriving.user.modular.system.util.GaoDe.MapUtil; |
| | | import com.supersavedriving.user.modular.system.util.GaoDe.model.District; |
| | | import com.supersavedriving.user.modular.system.util.MallBook.model.InterfaceResponse; |
| | | import com.supersavedriving.user.modular.system.util.MallBook.model.Receive; |
| | | import com.supersavedriving.user.modular.system.util.MallBook.model.ReceiveUser; |
| | |
| | | private IDriverService driverService; |
| | | |
| | | @Autowired |
| | | private IBranchOfficeService branchOfficeService; |
| | | |
| | | @Autowired |
| | | private ISystemConfigService systemConfigService; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/api/order/queryServerPrice") |
| | | // @ServiceLog(name = "获取正在进行中的订单id", url = "/api/order/queryServerOrder") |
| | | @ApiOperation(value = "根据定位获取恶劣天气+节假日信息", tags = {"用户端-首页"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."), |
| | | @ApiImplicitParam(value = "纬度", name = "lat", required = true, dataType = "String"), |
| | | @ApiImplicitParam(value = "经度", name = "lon", required = true, dataType = "String"), |
| | | }) |
| | | public ResponseWarpper<Integer> queryServerPrice(String lat,String lon){ |
| | | try { |
| | | Integer i =0; // 0为不能接单 1为恶劣天气 2为节假日 3为恶劣+节假日 |
| | | District geocode = MapUtil.geocode(lon, lat); |
| | | String districtCode = geocode.getDistrictCode(); |
| | | List<BranchOffice> districtCode1 = branchOfficeService.selectList(new EntityWrapper<BranchOffice>().eq("districtCode", districtCode)); |
| | | if(districtCode1.size()>0){ |
| | | BranchOffice branchOffice = districtCode1.get(0); |
| | | Integer id = branchOffice.getId(); |
| | | SystemConfig systemConfig = systemConfigService.selectOne(new EntityWrapper<SystemConfig>().eq("type", 8).eq("companyId", id)); |
| | | SystemConfig systemConfig9 = systemConfigService.selectOne(new EntityWrapper<SystemConfig>().eq("type", 9).eq("companyId", id)); |
| | | if(systemConfig!=null && systemConfig9!=null){ |
| | | String content = systemConfig.getContent(); |
| | | JSONObject jsonObject = JSONObject.parseObject(content); |
| | | String num1 = jsonObject.get("num1").toString(); |
| | | String content9 = systemConfig9.getContent(); |
| | | JSONObject jsonObject9 = JSONObject.parseObject(content9); |
| | | String num9 = jsonObject9.get("num1").toString(); |
| | | if("1".equals(num1)){ |
| | | i=1; |
| | | } |
| | | if("1".equals(num9)){ |
| | | i=2; |
| | | } |
| | | if("1".equals(num1)&&"1".equals(num9)){ |
| | | i=3; |
| | | } |
| | | } |
| | | } |
| | | return ResponseWarpper.success(i); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return new ResponseWarpper(500, e.getMessage()); |
| | | } |
| | | } |
| | | @Autowired |
| | | private IRechargeRecordService rechargeRecordService; |
| | | |
| | | @Autowired |
| | |
| | | |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/api/order/getEstimatedCosts") |
| | | // @ServiceLog(name = "获取预估费用", url = "/api/order/getEstimatedCosts") |
New file |
| | |
| | | package com.supersavedriving.user.modular.system.dao; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.supersavedriving.user.modular.system.model.CompanyFundFlow; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2023/7/30 3:05 |
| | | */ |
| | | public interface CompanyFundFlowMapper extends BaseMapper<CompanyFundFlow> { |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.supersavedriving.user.modular.system.model.Revenue; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @date 2023/3/13 10:03 |
| | | */ |
| | | public interface RevenueMapper extends BaseMapper<Revenue> { |
| | | |
| | | /** |
| | | * 获取代理商账户余额 |
| | | * @param companyId |
| | | * @return |
| | | */ |
| | | Double queryAgentBalance(@Param("companyId") Integer companyId); |
| | | |
| | | |
| | | /** |
| | | * 获取平台账户余额 |
| | | * @return |
| | | */ |
| | | Double queryCompanyBalance(); |
| | | } |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.supersavedriving.user.modular.system.dao.CompanyFundFlowMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.supersavedriving.user.modular.system.model.CompanyFundFlow"> |
| | | <id column="id" property="id"/> |
| | | <result column="type" property="type"/> |
| | | <result column="objectType" property="objectType"/> |
| | | <result column="objectId" property="objectId"/> |
| | | <result column="balance" property="balance"/> |
| | | <result column="money" property="money"/> |
| | | <result column="createTime" property="createTime"/> |
| | | </resultMap> |
| | | </mapper> |
| | |
| | | <result column="createTime" property="createTime"/> |
| | | </resultMap> |
| | | |
| | | |
| | | <select id="queryAgentBalance" resultType="double"> |
| | | select |
| | | sum(aa.income) - sum(aa.disburse) as balance |
| | | from ( |
| | | select sum(amount) as income, 0 as disburse from t_revenue where userType = 3 and userId = #{companyId} |
| | | union all |
| | | select 0 as ncome, sum(amount) as disburse from t_settlement_record where type = 2 and objectId = #{companyId} |
| | | ) as aa |
| | | </select> |
| | | |
| | | |
| | | |
| | | <select id="queryCompanyBalance" resultType="double"> |
| | | select |
| | | sum(aa.income) - sum(aa.disburse) + sum(aa.recharge) as balance |
| | | from ( |
| | | select sum(amount) as income, 0 as disburse, 0 as recharge from t_revenue where userType = 4 |
| | | union all |
| | | select 0 as ncome, sum(amount) as disburse, 0 as recharge from t_settlement_record where type = 1 |
| | | union all |
| | | select 0 as ncome, 0 as disburse, sum(surplusDividedAmount) as recharge from t_recharge_record where type = 4 and payStatus = 2 |
| | | ) as aa |
| | | </select> |
| | | </mapper> |
New file |
| | |
| | | package com.supersavedriving.user.modular.system.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2023/7/30 3:02 |
| | | */ |
| | | @Data |
| | | @TableName("t_company_fund_flow") |
| | | public class CompanyFundFlow { |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | /** |
| | | * 变动类型(1=充值,2=提现,3=佣金收入,4=保险收入) |
| | | */ |
| | | @TableField("type") |
| | | private Integer type; |
| | | /** |
| | | * 对象类型(1=平台,2=代理商) |
| | | */ |
| | | @TableField("objectType") |
| | | private Integer objectType; |
| | | /** |
| | | * 代理商id |
| | | */ |
| | | @TableField("objectId") |
| | | private Integer objectId; |
| | | /** |
| | | * 历史账户余额 |
| | | */ |
| | | @TableField("balance") |
| | | private BigDecimal balance; |
| | | /** |
| | | * 变动金额 |
| | | */ |
| | | @TableField("money") |
| | | private BigDecimal money; |
| | | /** |
| | | * 变动时间 |
| | | */ |
| | | @TableField("createTime") |
| | | private Date createTime; |
| | | } |
| | |
| | | */ |
| | | @TableField("createTime") |
| | | private Date createTime; |
| | | /** |
| | | * 节假日费 |
| | | */ |
| | | @TableField("holidayPrice") |
| | | private Double holidayPrice; |
| | | } |
New file |
| | |
| | | package com.supersavedriving.user.modular.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.supersavedriving.user.modular.system.model.CompanyFundFlow; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2023/7/30 3:09 |
| | | */ |
| | | public interface ICompanyFundFlowService extends IService<CompanyFundFlow> { |
| | | } |
| | |
| | | * @date 2023/3/13 10:09 |
| | | */ |
| | | public interface IRevenueService extends IService<Revenue> { |
| | | |
| | | /** |
| | | * 获取代理商账户余额 |
| | | * @param companyId |
| | | * @return |
| | | */ |
| | | Double queryAgentBalance(Integer companyId); |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取平台账户余额 |
| | | * @return |
| | | */ |
| | | Double queryCompanyBalance(); |
| | | } |
New file |
| | |
| | | package com.supersavedriving.user.modular.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.supersavedriving.user.modular.system.dao.CompanyFundFlowMapper; |
| | | import com.supersavedriving.user.modular.system.model.CompanyFundFlow; |
| | | import com.supersavedriving.user.modular.system.service.ICompanyFundFlowService; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2023/7/30 3:10 |
| | | */ |
| | | public class CompanyFundFlowServiceImpl extends ServiceImpl<CompanyFundFlowMapper, CompanyFundFlow> implements ICompanyFundFlowService { |
| | | } |
| | |
| | | @Autowired |
| | | private IOrderService orderService; |
| | | |
| | | @Autowired |
| | | private ICompanyFundFlowService companyFundFlowService; |
| | | |
| | | @Value("${wx.appletsAppid}") |
| | | private String appletsAppid; |
| | | |
| | |
| | | */ |
| | | public Order getOrderPrice(Integer type, Double distance, Integer waitTime, Order order, String city){ |
| | | order = getOrderInitialPrice(order); |
| | | SystemConfig systemConfig = systemConfigService.selectOne(new EntityWrapper<SystemConfig>().eq("type", 5)); |
| | | Integer driverId = order.getDriverId(); |
| | | Driver driver = driverService.selectById(driverId); |
| | | SystemConfig systemConfig = systemConfigService.selectOne(new EntityWrapper<SystemConfig>().eq("type", 5).eq("companyId",driver.getBranchOfficeId())); |
| | | if(null == systemConfig){ |
| | | if(type == 1){//预估金额 |
| | | order.setEstimatedPrice(0D); |
| | |
| | | Double num7 = extraCost.getDouble("num7");//恶劣天气超出公里 |
| | | Double num8 = extraCost.getDouble("num8");//恶劣天气超出公里单价 X/公里 |
| | | Double num9 = extraCost.getDouble("num9");//恶劣天气最高收取金额 |
| | | Double num10 = extraCost.getDouble("num10");//节假日收费 |
| | | // Double num11 = extraCost.getDouble("num11");//恶劣天气最高收取金额 |
| | | // Double num12 = extraCost.getDouble("num12");//恶劣天气最高收取金额 |
| | | |
| | | //等待费用 |
| | | if(waitTime.compareTo(num1 * 60) >= 0){ |
| | |
| | | } |
| | | |
| | | //恶劣天气 |
| | | systemConfig = systemConfigService.selectOne(new EntityWrapper<SystemConfig>().eq("type", 8)); |
| | | systemConfig = systemConfigService.selectOne(new EntityWrapper<SystemConfig>().eq("type", 8).eq("companyId",driver.getBranchOfficeId())); |
| | | if(null != systemConfig){ |
| | | JSONObject jsonObject1 = JSON.parseObject(systemConfig.getContent()); |
| | | Integer num11 = jsonObject1.getInteger("num1");//开启恶劣天气计价 |
| | | if(1 == num11){ |
| | | boolean badWeather = WeatherUtil.isBadWeather(city); |
| | | if(badWeather){ |
| | | // boolean badWeather = WeatherUtil.isBadWeather(city); |
| | | // if(badWeather){ |
| | | order.setBadWeatherDistance(num5);//恶劣天气公里 |
| | | order.setBadWeatherPrice(num6);//恶劣天气费 |
| | | if(distance.compareTo(num7) > 0){ |
| | |
| | | order.setOverBadWeatherPrice(subtract.doubleValue());//恶劣天气超出公里费 |
| | | } |
| | | } |
| | | } |
| | | // } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | //节假日 |
| | | systemConfig = systemConfigService.selectOne(new EntityWrapper<SystemConfig>().eq("type", 9).eq("companyId",driver.getBranchOfficeId())); |
| | | if(null != systemConfig){ |
| | | JSONObject jsonObject1 = JSON.parseObject(systemConfig.getContent()); |
| | | Integer num11 = jsonObject1.getInteger("num1");//开启恶劣天气计价 |
| | | if(1 == num11){ |
| | | BigDecimal bigDecimal = new BigDecimal(num10); |
| | | order.setHolidayPrice(bigDecimal.doubleValue()); |
| | | } |
| | | } |
| | | |
| | | |
| | | //计算总金额 |
| | | BigDecimal bigDecimal = new BigDecimal(order.getStartPrice() + order.getOverDrivePrice() + order.getLongDistancePrice() + order.getOverLongDistancePrice() + |
| | | order.getWaitTimePrice() + order.getOutWaitTimePrice() + order.getBadWeatherPrice() + order.getOverBadWeatherPrice() - order.getDiscountAmount()).setScale(2, BigDecimal.ROUND_HALF_EVEN); |
| | | order.getWaitTimePrice() + order.getOutWaitTimePrice() + order.getBadWeatherPrice() + order.getOverBadWeatherPrice()+order.getHolidayPrice() - order.getDiscountAmount()).setScale(2, BigDecimal.ROUND_HALF_EVEN); |
| | | |
| | | if(type == 1){//预估价 |
| | | order.setEstimatedPrice(bigDecimal.doubleValue()); |
| | |
| | | order.setCouponId(null);//优惠券 |
| | | order.setDiscountAmount(0D);//折扣优惠金额 |
| | | order.setDiscount(0D);//折扣 |
| | | order.setHolidayPrice(0D); |
| | | return order; |
| | | } |
| | | |
| | |
| | | accountChangeDetailService.saveData(accountChangeDetail); |
| | | |
| | | //补贴中分账 |
| | | Double balance = revenueService.queryCompanyBalance();//平台账户余额 |
| | | Double discountedPrice = order.getDiscountedPrice(); |
| | | List<RechargeRecord> rechargeRecords = rechargeRecordService.selectList(new EntityWrapper<RechargeRecord>().eq("type", 4).eq("payStatus", 2).gt("surplusDividedAmount", 0).orderBy("createTime")); |
| | | for (RechargeRecord rechargeRecord : rechargeRecords) { |
| | |
| | | } |
| | | } |
| | | |
| | | CompanyFundFlow companyFundFlow = new CompanyFundFlow(); |
| | | companyFundFlow.setBalance(new BigDecimal(balance)); |
| | | companyFundFlow.setObjectType(1); |
| | | companyFundFlow.setType(5); |
| | | companyFundFlow.setMoney(new BigDecimal(order.getDiscountedPrice())); |
| | | companyFundFlow.setCreateTime(new Date()); |
| | | companyFundFlowService.insert(companyFundFlow); |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | //处理代理商抽佣 |
| | | if(num3 > 0 && null != driver){ |
| | | Double balance = revenueService.queryAgentBalance(driver.getAgentId()); |
| | | Revenue revenue = new Revenue(); |
| | | revenue.setType(1); |
| | | revenue.setUserType(3); |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | CompanyFundFlow companyFundFlow = new CompanyFundFlow(); |
| | | companyFundFlow.setType(3); |
| | | companyFundFlow.setObjectType(2); |
| | | companyFundFlow.setObjectId(driver.getAgentId()); |
| | | companyFundFlow.setBalance(new BigDecimal(balance)); |
| | | companyFundFlow.setMoney(new BigDecimal(num3)); |
| | | companyFundFlow.setCreateTime(new Date()); |
| | | companyFundFlowService.insert(companyFundFlow); |
| | | } |
| | | } |
| | | } |
| | |
| | | accountChangeDetailService.saveData(accountChangeDetail); |
| | | |
| | | //补贴中分账 |
| | | Double balance = revenueService.queryCompanyBalance(); |
| | | Double discountedPrice = order.getDiscountedPrice(); |
| | | List<RechargeRecord> rechargeRecords1 = rechargeRecordService.selectList(new EntityWrapper<RechargeRecord>().eq("type", 4).eq("payStatus", 2).gt("surplusDividedAmount", 0).orderBy("createTime")); |
| | | for (RechargeRecord rechargeRecord : rechargeRecords1) { |
| | |
| | | } |
| | | } |
| | | } |
| | | CompanyFundFlow companyFundFlow = new CompanyFundFlow(); |
| | | companyFundFlow.setBalance(new BigDecimal(balance)); |
| | | companyFundFlow.setObjectType(1); |
| | | companyFundFlow.setType(5); |
| | | companyFundFlow.setMoney(new BigDecimal(order.getDiscountedPrice())); |
| | | companyFundFlow.setCreateTime(new Date()); |
| | | companyFundFlowService.insert(companyFundFlow); |
| | | |
| | | } |
| | | // TODO: 2023/6/25 折扣优惠由司机承担 |
| | |
| | | driverService.updateById(driver); |
| | | accountChangeDetailService.saveData(accountChangeDetail); |
| | | //补贴中分账 |
| | | Double balance = revenueService.queryCompanyBalance(); |
| | | Double discountedPrice = order.getDiscountedPrice(); |
| | | List<RechargeRecord> rechargeRecords = rechargeRecordService.selectList(new EntityWrapper<RechargeRecord>().eq("type", 4).eq("payStatus", 2).gt("surplusDividedAmount", 0).orderBy("createTime")); |
| | | for (RechargeRecord rechargeRecord : rechargeRecords) { |
| | |
| | | } |
| | | } |
| | | |
| | | CompanyFundFlow companyFundFlow = new CompanyFundFlow(); |
| | | companyFundFlow.setBalance(new BigDecimal(balance)); |
| | | companyFundFlow.setObjectType(1); |
| | | companyFundFlow.setType(5); |
| | | companyFundFlow.setMoney(new BigDecimal(order.getDiscountedPrice())); |
| | | companyFundFlow.setCreateTime(new Date()); |
| | | companyFundFlowService.insert(companyFundFlow); |
| | | |
| | | } |
| | | } |
| | | |
| | |
| | | */ |
| | | @Service |
| | | public class RevenueServiceImpl extends ServiceImpl<RevenueMapper, Revenue> implements IRevenueService { |
| | | |
| | | |
| | | /** |
| | | * 获取代理商账户余额 |
| | | * @param companyId |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Double queryAgentBalance(Integer companyId) { |
| | | return this.baseMapper.queryAgentBalance(companyId); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取平台账户余额 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Double queryCompanyBalance() { |
| | | return this.baseMapper.queryCompanyBalance(); |
| | | } |
| | | } |
| | |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | |
| | | public static void main(String[] args) { |
| | | District geocode = geocode("114.382485", "23.084109"); |
| | | } |
| | | } |
| | |
| | | application: |
| | | name: user-server |
| | | profiles: |
| | | # active: dev |
| | | active: produce |
| | | active: dev |
| | | # active: produce |
| | | mvc: |
| | | static-path-pattern: /static/** |
| | | view: |
| | |
| | | |
| | | |
| | | spring: |
| | | # datasource: |
| | | # url: jdbc:mysql://127.0.0.1:3306/super_save_driving?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=Asia/Shanghai |
| | | # username: root |
| | | # password: f4OfRjqoN3jSiNGiUoiNsQdOBtCOKYRj |
| | | ## password: 123456 |
| | | # db-name: guns #用来搜集数据库的所有表 |
| | | # filters: wall,mergeStat |
| | | datasource: |
| | | url: jdbc:mysql://127.0.0.1:3306/super_save_driving?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=Asia/Shanghai |
| | | url: jdbc:mysql://192.168.110.80:3306/super_save_driving?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=Asia/Shanghai |
| | | username: root |
| | | password: f4OfRjqoN3jSiNGiUoiNsQdOBtCOKYRj |
| | | # password: 123456 |
| | | password: 123456 |
| | | # password: 123456 |
| | | db-name: guns #用来搜集数据库的所有表 |
| | | filters: wall,mergeStat |
| | | |
| | | |
| | | #多数据源情况的配置 |
| | | guns: |
| | |
| | | spring: |
| | | data: |
| | | mongodb: |
| | | uri: mongodb://root:CEtyLdKjPk0yeHNo@127.0.0.1:27017/admin |
| | | # uri: mongodb://127.0.0.1:27017/admin |
| | | # uri: mongodb://root:CEtyLdKjPk0yeHNo@127.0.0.1:27017/admin |
| | | uri: mongodb://127.0.0.1:27017/admin |
| | | |
| | | |
| | | # mallbook 调起接口参数配置 |
| | |
| | | # Redis·þÎñÆ÷µØÖ· |
| | | spring.redis.host=127.0.0.1 |
| | | # Redis·þÎñÆ÷Á¬½Ó¶Ë¿Ú |
| | | spring.redis.port=16379 |
| | | #spring.redis.port=16379 |
| | | # Redis·þÎñÆ÷Á¬½ÓÃÜÂ루ĬÈÏΪ¿Õ£© |
| | | spring.redis.password=cKsEeyffDXG5PzNg8CIbrWxFluXrCprZ |
| | | #spring.redis.password=cKsEeyffDXG5PzNg8CIbrWxFluXrCprZ |
| | | |
| | | ## Redis·þÎñÆ÷µØÖ· |
| | | #spring.redis.host=127.0.0.1 |
| | | ## Redis·þÎñÆ÷Á¬½Ó¶Ë¿Ú |
| | | #spring.redis.port=6379 |
| | | spring.redis.port=6379 |
| | | ## Redis·þÎñÆ÷Á¬½ÓÃÜÂ루ĬÈÏΪ¿Õ£© |
| | | #spring.redis.password=123456 |
| | | spring.redis.password=123456 |
| | | |
| | | # Á¬½Ó³Ø×î´óÁ¬½ÓÊý£¨Ê¹ÓøºÖµ±íʾûÓÐÏÞÖÆ£© |
| | | spring.redis.jedis.pool.max-active=1024 |