| | |
| | | <artifactId>lombok</artifactId> |
| | | <scope>provided</scope> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.stylefeng</groupId> |
| | | <artifactId>guns-admin</artifactId> |
| | | <version>1.0.0</version> |
| | | <scope>compile</scope> |
| | | </dependency> |
| | | </dependencies> |
| | | |
| | | <build> |
| | |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.util.StringUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | |
| | | @Autowired |
| | | private IOrderLogisticsService orderLogisticsService; |
| | | @Autowired |
| | | private IInviteService inviteService; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取用户邀请二维码 |
| | | * @param request |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/api/user/getCode") |
| | | @ApiOperation(value = "获取用户邀请二维码", tags = {"司机端-2.0新增"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil<String> getCode(HttpServletRequest request){ |
| | | try { |
| | | Integer uid = driverService.getUserIdFormRedis(request); |
| | | if(null == uid){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | Driver userInfo = driverService.selectById(uid); |
| | | if (userInfo.getCode()==null){ |
| | | userInfo = driverService.generateCode(userInfo); |
| | | } |
| | | return ResultUtil.success(userInfo.getCode()); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | /** |
| | | * 获取用户邀请二维码 |
| | | * @param request |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/api/user/inviteList") |
| | | @ApiOperation(value = "获取司机邀请记录", tags = {"司机端-2.0新增"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "开始时间 yyyy-MM-dd", name = "startTime", required = false, dataType = "String"), |
| | | @ApiImplicitParam(value = "结束时间 yyyy-MM-dd", name = "endTime", required = false, dataType = "String"), |
| | | @ApiImplicitParam(value = "页码(首页1)", name = "pageNum", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "页条数", name = "size", required = true, dataType = "int"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil inviteList(String startTime,String endTime,Integer pageNum,Integer size,HttpServletRequest request){ |
| | | try { |
| | | Integer uid = driverService.getUserIdFormRedis(request); |
| | | if(null == uid){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | if (StringUtils.hasLength(startTime)){ |
| | | startTime = startTime + " 00:00:00"; |
| | | endTime = endTime + " 23:59:59"; |
| | | } |
| | | List<Invite> invites = inviteService.inviteList(uid,startTime,endTime,pageNum,size); |
| | | return ResultUtil.success(invites); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | /** |
| | | * 获取短信验证码 |
| | | * @param phone |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.dao; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.stylefeng.guns.modular.system.model.Invite; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface InviteMapper extends BaseMapper<Invite> { |
| | | |
| | | |
| | | List<Invite> inviteList(@Param("uid")Integer uid,@Param("uid") String startTime, @Param("uid")String endTime, |
| | | @Param("pageNum")Integer pageNum, @Param("size")Integer size); |
| | | } |
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.InviteMapper"> |
| | | |
| | | |
| | | <select id="inviteList" resultType="com.stylefeng.guns.modular.system.model.Invite"> |
| | | select t1.*,t2.phone,t2.avatar from t_invite t1 |
| | | left join t_user t2 on t2.id = t1.userId |
| | | where 1=1 |
| | | <if test="null != uid"> |
| | | and t1.inviteUserId = #{uid} |
| | | </if> |
| | | <if test="null != startTime and null != endTime"> |
| | | and t1.registerTime between #{startTime} and #{endTime} |
| | | </if> |
| | | order by t1.registerTime desc |
| | | limit #{pageNum}, #{size} |
| | | </select> |
| | | </mapper> |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.model; |
| | | |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.io.*; |
| | | |
| | | public class CustomMultipartFile implements MultipartFile { |
| | | private final byte[] content; |
| | | private final String name; |
| | | private final String originalFilename; |
| | | private final String contentType; |
| | | |
| | | public CustomMultipartFile(byte[] content, String name, String contentType) { |
| | | this.content = content; |
| | | this.name = name; |
| | | this.originalFilename = name; |
| | | this.contentType = contentType; |
| | | } |
| | | |
| | | @Override |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | @Override |
| | | public String getOriginalFilename() { |
| | | return originalFilename; |
| | | } |
| | | |
| | | @Override |
| | | public String getContentType() { |
| | | return contentType; |
| | | } |
| | | |
| | | @Override |
| | | public boolean isEmpty() { |
| | | return content.length == 0; |
| | | } |
| | | |
| | | @Override |
| | | public long getSize() { |
| | | return content.length; |
| | | } |
| | | |
| | | @Override |
| | | public byte[] getBytes() throws IOException { |
| | | return content; |
| | | } |
| | | |
| | | @Override |
| | | public InputStream getInputStream() throws IOException { |
| | | return new ByteArrayInputStream(content); |
| | | } |
| | | |
| | | @Override |
| | | public void transferTo(File dest) throws IOException, IllegalStateException { |
| | | try (FileOutputStream fos = new FileOutputStream(dest)) { |
| | | fos.write(content); |
| | | } |
| | | } |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | |
| | | * 司机 |
| | | */ |
| | | @TableName("t_driver") |
| | | @Data |
| | | public class Driver extends BaseBean{ |
| | | /** |
| | | * 主键 |
| | |
| | | */ |
| | | @TableField("appletsOpenId") |
| | | private String appletsOpenId; |
| | | /** |
| | | * 邀请码 |
| | | */ |
| | | @TableField("code") |
| | | private String code; |
| | | |
| | | @Override |
| | | public Integer getId() { |
| | |
| | | public void setId(Integer id) { |
| | | this.id = id; |
| | | } |
| | | public String getCode() { |
| | | return code; |
| | | } |
| | | |
| | | public void setCode(String code) { |
| | | this.code = code; |
| | | } |
| | | |
| | | public String getAccount() { |
| | | return account; |
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 io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 平台协议 |
| | | */ |
| | | @TableName("t_invite") |
| | | @Data |
| | | public class Invite { |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | @TableField("id") |
| | | private Integer id; |
| | | // 邀请人id |
| | | @TableField("inviteUserId") |
| | | private Integer inviteUserId; |
| | | // 被邀请人id |
| | | @TableField("userId") |
| | | private Integer userId; |
| | | /** |
| | | * 添加时间 |
| | | */ |
| | | @TableField("registerTime") |
| | | @ApiModelProperty("注册时间") |
| | | private Date registerTime; |
| | | /** |
| | | * 使用范围(1=用户,2=司机) |
| | | */ |
| | | @TableField("useType") |
| | | private Integer useType; |
| | | |
| | | @TableField(exist = false) |
| | | @ApiModelProperty("头像") |
| | | private String avatar; |
| | | |
| | | @ApiModelProperty("手机号") |
| | | @TableField(exist = false) |
| | | private String phone; |
| | | } |
| | |
| | | * @throws Exception |
| | | */ |
| | | ResultUtil loginOut(Integer id) throws Exception; |
| | | |
| | | Driver generateCode(Driver userInfo); |
| | | |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.stylefeng.guns.modular.system.model.Invite; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface IInviteService extends IService<Invite> { |
| | | |
| | | List<Invite> inviteList(Integer uid, String startTime, String endTime, Integer pageNum, Integer size); |
| | | } |
| | |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.alipay.api.internal.util.codec.Base64; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.stylefeng.guns.core.common.constant.JwtConstants; |
| | |
| | | import org.apache.shiro.util.ByteSource; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.http.HttpEntity; |
| | | import org.springframework.http.HttpMethod; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.LinkedMultiValueMap; |
| | | import org.springframework.util.MultiValueMap; |
| | | import org.springframework.web.client.RestTemplate; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.io.*; |
| | | import java.math.BigDecimal; |
| | | import java.security.SecureRandom; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | |
| | |
| | | redisUtil.remove("DEVICE_" + id);//清除车载端登录的标识 |
| | | return ResultUtil.success(); |
| | | } |
| | | @Autowired |
| | | private WeChatUtil weChatUtil; |
| | | @Autowired |
| | | private RestTemplate restTemplate; |
| | | @Override |
| | | public Driver generateCode(Driver userInfo) { |
| | | generateQrCode(userInfo); |
| | | return userInfo; |
| | | } |
| | | public MultipartFile convertInputStreamToMultipartFile(InputStream inputStream, String fileName, String contentType) throws IOException { |
| | | ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); |
| | | byte[] buffer = new byte[1024]; |
| | | int bytesRead; |
| | | while ((bytesRead = inputStream.read(buffer)) != -1) { |
| | | byteArrayOutputStream.write(buffer, 0, bytesRead); |
| | | } |
| | | byte[] data = byteArrayOutputStream.toByteArray(); |
| | | return new CustomMultipartFile(data, fileName, contentType); |
| | | } |
| | | private void generateQrCode(Driver userInfo) { |
| | | if (userInfo.getCode()!=null){ |
| | | return; |
| | | } |
| | | String accessToken = weChatUtil.getAccessToken(); |
| | | InputStream inputStream = null; |
| | | OutputStream outputStream = null; |
| | | try { |
| | | String url = "https://api.weixin.qq.com/wxa/getwxacodeunlimit?access_token=" + accessToken; |
| | | Map<String, Object> param = new HashMap<>(); |
| | | // param.put("page", "pageA/houseDetail"); |
| | | param.put("check_path", false); |
| | | // 用户id 用于分享 |
| | | param.put("scene", "uid="+userInfo.getId()+"userType=1"); |
| | | param.put("env_version", "trial"); |
| | | param.put("width", 200); //二维码尺寸 |
| | | param.put("is_hyaline", true); // 是否需要透明底色, is_hyaline 为true时,生成透明底色的小程序码 参数仅对小程序码生效 |
| | | param.put("auto_color", true); // 自动配置线条颜色,如果颜色依然是黑色,则说明不建议配置主色调 参数仅对小程序码生效 |
| | | Map<String, Object> line_color = new HashMap<>(); |
| | | line_color.put("r", 0); |
| | | line_color.put("g", 0); |
| | | line_color.put("b", 0); |
| | | param.put("line_color", line_color); |
| | | System.err.println("调用生成微信URL接口传参:" + param); |
| | | MultiValueMap<String, String> headers = new LinkedMultiValueMap<>(); |
| | | HttpEntity requestEntity = new HttpEntity(param, headers); |
| | | ResponseEntity<byte[]> entity = restTemplate.exchange(url, HttpMethod.POST, requestEntity, byte[].class, new Object[0]); |
| | | System.err.println("调用小程序生成微信永久小程序码URL接口返回结果:" + entity.getBody()); |
| | | byte[] result = entity.getBody(); |
| | | System.err.println(Base64.encodeBase64String(result)); |
| | | |
| | | inputStream = new ByteArrayInputStream(result); |
| | | String finalFileName = System.currentTimeMillis() + "" + new SecureRandom().nextInt(0x0400) + ".jpeg"; |
| | | MultipartFile multipartFile = convertInputStreamToMultipartFile(inputStream, finalFileName, "image/jpeg"); |
| | | String pictureName = OssUploadUtil.ossUploadCode(multipartFile); |
| | | System.err.println(pictureName); |
| | | userInfo.setCode(pictureName); |
| | | this.updateById(userInfo); |
| | | |
| | | } catch (Exception e) { |
| | | System.err.println("调用小程序生成微信永久小程序码URL接口异常" + e); |
| | | } finally { |
| | | if (inputStream != null) { |
| | | try { |
| | | inputStream.close(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | if (outputStream != null) { |
| | | try { |
| | | outputStream.close(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 获取编号 |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.stylefeng.guns.modular.system.dao.InviteMapper; |
| | | import com.stylefeng.guns.modular.system.model.Invite; |
| | | import com.stylefeng.guns.modular.system.service.IInviteService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | |
| | | @Service |
| | | public class InviteServiceImpl extends ServiceImpl<InviteMapper, Invite> implements IInviteService { |
| | | |
| | | |
| | | @Override |
| | | public List<Invite> inviteList(Integer uid, String startTime, String endTime, Integer pageNum, Integer size) { |
| | | return this.baseMapper.inviteList(uid,startTime,endTime,pageNum,size); |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.util; |
| | | |
| | | import com.aliyun.oss.OSSClient; |
| | | import com.aliyun.oss.model.ObjectMetadata; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | | import java.util.UUID; |
| | | |
| | | public class OssUploadUtil { |
| | | //OSS图片访问域名 |
| | | public static String oss_domain = "https://xv95128.oss-cn-wuhan-lr.aliyuncs.com/"; |
| | | public static String oss_domain_cdn = "http://cdn.xn95128.cn/"; |
| | | public static String accessKeyId = "LTAI5tEQarpMqRDNnSuj2mCE"; |
| | | public static String accessKeySecret = "6lBQHFh4XRaIytR5mQ6wDjAbIWmDok"; |
| | | public static String bucketName="xv95128"; |
| | | public static String endpoint = "oss-cn-wuhan-lr.aliyuncs.com"; |
| | | |
| | | public static OSSClient ossClient = new OSSClient(endpoint, accessKeyId,accessKeySecret); |
| | | |
| | | public static String ossUpload(HttpServletRequest request, MultipartFile file) throws IOException{ |
| | | //CommonsMultipartFile file = (CommonsMultipartFile)multipartFile; |
| | | String fileName = ""; |
| | | if(file!=null && !"".equals(file.getOriginalFilename()) && file.getOriginalFilename()!=null){ |
| | | InputStream content = file.getInputStream();//获得指定文件的输入流 |
| | | ObjectMetadata meta = new ObjectMetadata();// 创建上传Object的Metadata |
| | | meta.setContentLength(file.getSize()); // 必须设置ContentLength |
| | | String originalFilename = file.getOriginalFilename(); |
| | | fileName = UUID.randomUUID().toString().replaceAll("-","") + originalFilename.subSequence(originalFilename.lastIndexOf("."), originalFilename.length()); |
| | | ossClient.putObject(bucketName,"img/"+fileName,content,meta);// 上传Object. |
| | | if(fileName != null && !"".equals(fileName)){ |
| | | System.out.println(fileName); |
| | | fileName = oss_domain_cdn+"img/"+fileName; |
| | | } |
| | | } |
| | | return fileName; |
| | | } |
| | | public static String ossUploadCode( MultipartFile file) throws IOException{ |
| | | //CommonsMultipartFile file = (CommonsMultipartFile)multipartFile; |
| | | String fileName = ""; |
| | | if(file!=null && !"".equals(file.getOriginalFilename()) && file.getOriginalFilename()!=null){ |
| | | InputStream content = file.getInputStream();//获得指定文件的输入流 |
| | | ObjectMetadata meta = new ObjectMetadata();// 创建上传Object的Metadata |
| | | meta.setContentLength(file.getSize()); // 必须设置ContentLength |
| | | String originalFilename = file.getOriginalFilename(); |
| | | fileName = UUID.randomUUID().toString().replaceAll("-","") + originalFilename.subSequence(originalFilename.lastIndexOf("."), originalFilename.length()); |
| | | ossClient.putObject(bucketName,"img/"+fileName,content,meta);// 上传Object. |
| | | if(fileName != null && !"".equals(fileName)){ |
| | | System.out.println(fileName); |
| | | fileName = oss_domain_cdn+"img/"+fileName; |
| | | } |
| | | } |
| | | return fileName; |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.util; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import org.apache.commons.codec.digest.DigestUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.web.client.RestTemplate; |
| | | |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.net.URLDecoder; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 微信工具类 |
| | | */ |
| | | @Component |
| | | public class WeChatUtil { |
| | | |
| | | @Value("${wx.appletsAppid}") |
| | | private String wxAppletsAppid; |
| | | |
| | | @Value("${wx.appletsAppSecret}") |
| | | private String wxAppletsAppSecret; |
| | | |
| | | @Autowired |
| | | private RestTemplate restTemplate; |
| | | |
| | | |
| | | /** |
| | | * 小程序使用jscode获取openid |
| | | * @param jscode |
| | | * @return |
| | | */ |
| | | public Map<String, String> code2Session(String jscode){ |
| | | String url = "https://api.weixin.qq.com/sns/jscode2session?appid=" + wxAppletsAppid + "&secret=" + wxAppletsAppSecret |
| | | + "&js_code=" + jscode + "&grant_type=authorization_code"; |
| | | String forObject = restTemplate.getForObject(url, String.class); |
| | | JSONObject jsonObject = JSON.parseObject(forObject); |
| | | int errcode = jsonObject.getIntValue("errcode"); |
| | | Map<String, String> map = new HashMap<>(); |
| | | if(errcode == 0){//成功 |
| | | map.put("openid", jsonObject.getString("openid")); |
| | | map.put("sessionKey", jsonObject.getString("session_key")); |
| | | map.put("unionid", jsonObject.getString("unionid")); |
| | | return map; |
| | | } |
| | | if(errcode == -1){//系统繁忙,此时请开发者稍候再试 |
| | | map.put("msg", jsonObject.getString("errmsg")); |
| | | return map; |
| | | } |
| | | if(errcode == 40029){//code 无效 |
| | | map.put("msg", jsonObject.getString("errmsg")); |
| | | return map; |
| | | } |
| | | if(errcode == 45011){//频率限制,每个用户每分钟100次 |
| | | map.put("msg", jsonObject.getString("errmsg")); |
| | | return map; |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 通过config接口注入权限验证配置(公众号) |
| | | * 附录1-JS-SDK使用权限签名算法, |
| | | * @return |
| | | */ |
| | | public Map<String,Object> getSignatureConfig(String url){ |
| | | //获取token |
| | | try { |
| | | url = URLDecoder.decode(url, "UTF-8"); |
| | | } catch (UnsupportedEncodingException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | String ticket = getJSApiTicket(); |
| | | String noncestr = UUIDUtil.getRandomCode(); |
| | | Long timestamp = System.currentTimeMillis(); |
| | | String content = "jsapi_ticket=" + ticket + "&noncestr=" + noncestr + "×tamp=" + timestamp + "&url=" + url; |
| | | String signature = DigestUtils.sha1Hex(content); |
| | | Map<String,Object> map=new HashMap<>(); |
| | | map.put("appId", "wx0e72f86394831b34"); |
| | | map.put("timestamp", timestamp); |
| | | map.put("nonceStr", noncestr); |
| | | map.put("signature", signature); |
| | | return map; |
| | | } |
| | | |
| | | |
| | | |
| | | /*** |
| | | * 获取jsapiTicket(公众号) |
| | | * 来源 www.vxzsk.com |
| | | * @return |
| | | */ |
| | | public String getJSApiTicket(){ |
| | | //获取token |
| | | String acess_token= this.getAccessToken(); |
| | | String urlStr = "https://api.weixin.qq.com/cgi-bin/ticket/getticket?access_token=" + acess_token + "&type=jsapi"; |
| | | String backData = restTemplate.getForObject(urlStr, String.class); |
| | | System.out.println(backData); |
| | | String ticket = JSONObject.parseObject(backData).getString("ticket"); |
| | | return ticket; |
| | | } |
| | | |
| | | |
| | | /*** |
| | | * 获取acess_token (公众号) |
| | | * 来源www.vxzsk.com |
| | | * @return |
| | | */ |
| | | public String getAccessToken(){ |
| | | String url = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=wx0e72f86394831b34&secret=930f857abc74f7bb5cbd89e1544c5669"; |
| | | String backData = restTemplate.getForObject(url, String.class); |
| | | String accessToken = JSONObject.parseObject(backData).getString("access_token"); |
| | | return accessToken; |
| | | } |
| | | } |
| | |
| | | private boolean pushMinistryOfTransport; |
| | | |
| | | |
| | | |
| | | @RequestMapping(value = "/inviteList") |
| | | @ResponseBody |
| | | public Object list(Integer uid,String userName,String time) { |
| | | if (uid==null)return null; |
| | | String startTime = null; |
| | | String endTime = null; |
| | | if (SinataUtil.isNotEmpty(time)){ |
| | | String[] timeArray = time.split(" - "); |
| | | startTime = timeArray[0]+" 00:00:00"; |
| | | endTime = timeArray[1]+" 23:59:59"; |
| | | } |
| | | Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); |
| | | List<Map<String, Object>> userList = tDriverService.inviteList(page, startTime,endTime,userName,uid); |
| | | for (Map<String, Object> stringObjectMap : userList) { |
| | | String string = stringObjectMap.get("inviteUserId").toString(); |
| | | TDriver tUser = tDriverService.selectById(string); |
| | | stringObjectMap.put("inviteUserName",tUser.getName()); |
| | | } |
| | | page.setRecords(userList); |
| | | return super.packForBT(page); |
| | | } |
| | | /** |
| | | * 跳转到司机审核列表首页 |
| | | */ |
| | |
| | | public String index() { |
| | | return PREFIX + "tDriver.html"; |
| | | } |
| | | |
| | | @RequestMapping("/invite/{id}") |
| | | public String inviteList(@PathVariable("id")Integer id, Model model) { |
| | | model.addAttribute("id",id); |
| | | return PREFIX + "tDriver_invite.html"; |
| | | } |
| | | /** |
| | | * 跳转到审核通过司机首页 |
| | | */ |
| | |
| | | |
| | | @Autowired |
| | | private ITOrderEvaluateService itOrderEvaluateService; |
| | | @Autowired |
| | | private IInviteService inviteService; |
| | | /** |
| | | * 获取审核通过的司机列表 |
| | | */ |
| | |
| | | .eq("orderType", 2)); |
| | | SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); |
| | | for (Map<String, Object> stringObjectMap : driverList) { |
| | | String string = stringObjectMap.get("id").toString(); |
| | | int i = inviteService.selectCount(new EntityWrapper<Invite>() |
| | | .eq("inviteUserId", string) |
| | | .eq("userType",2)); |
| | | stringObjectMap.put("inviteNumber", i); |
| | | // 司机id |
| | | Integer id = Integer.valueOf(stringObjectMap.get("id").toString()); |
| | | List<TOrderEvaluate> driverId = itOrderEvaluateService.selectList(new EntityWrapper<TOrderEvaluate>() |
| | |
| | | import com.stylefeng.guns.core.util.*; |
| | | import com.stylefeng.guns.core.util.DateUtil; |
| | | import com.stylefeng.guns.modular.system.model.*; |
| | | import com.stylefeng.guns.modular.system.service.IInviteService; |
| | | import com.stylefeng.guns.modular.system.service.ITCompanyService; |
| | | import com.stylefeng.guns.modular.system.util.HttpRequestUtil; |
| | | import com.stylefeng.guns.modular.system.util.PushURL; |
| | |
| | | public String index() { |
| | | return PREFIX + "tUser.html"; |
| | | } |
| | | @RequestMapping("/invite/{id}") |
| | | public String inviteList(@PathVariable("id")Integer id, Model model) { |
| | | model.addAttribute("id",id); |
| | | return PREFIX + "tUser_invite.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到修改用户管理 |
| | |
| | | return PREFIX + "tUser_optUser.html"; |
| | | } |
| | | |
| | | @Autowired |
| | | private IInviteService inviteService; |
| | | /** |
| | | * 获取用户管理列表 |
| | | */ |
| | |
| | | endTime = timeArray[1]; |
| | | } |
| | | Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); |
| | | page.setRecords(tUserService.getUserList(page,beginTime,endTime,ShiroKit.getUser().getRoleType(),ShiroKit.getUser().getObjectId(),isAuth,state,id,nickName,phone,companyName)); |
| | | List<Map<String, Object>> userList = tUserService.getUserList(page, beginTime, endTime, ShiroKit.getUser().getRoleType(), ShiroKit.getUser().getObjectId(), isAuth, state, id, nickName, phone, companyName); |
| | | for (Map<String, Object> stringObjectMap : userList) { |
| | | String string = stringObjectMap.get("id").toString(); |
| | | int i = inviteService.selectCount(new EntityWrapper<Invite>() |
| | | .eq("inviteUserId", string) |
| | | .eq("userType",1) |
| | | ); |
| | | stringObjectMap.put("inviteNumber", i); |
| | | } |
| | | page.setRecords(userList); |
| | | return super.packForBT(page); |
| | | } |
| | | /** |
| | | * 获取用户管理列表-邀请列表 |
| | | */ |
| | | @RequestMapping(value = "/inviteList") |
| | | @ResponseBody |
| | | public Object list(Integer uid,String userName,String time) { |
| | | if (uid==null)return null; |
| | | String startTime = null; |
| | | String endTime = null; |
| | | if (SinataUtil.isNotEmpty(time)){ |
| | | String[] timeArray = time.split(" - "); |
| | | startTime = timeArray[0]+" 00:00:00"; |
| | | endTime = timeArray[1]+" 23:59:59"; |
| | | } |
| | | Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); |
| | | List<Map<String, Object>> userList = tUserService.inviteList(page, startTime,endTime,userName,uid); |
| | | for (Map<String, Object> stringObjectMap : userList) { |
| | | String string = stringObjectMap.get("inviteUserId").toString(); |
| | | TUser tUser = tUserService.selectById(string); |
| | | stringObjectMap.put("inviteUserName",tUser.getNickName()); |
| | | } |
| | | page.setRecords(userList); |
| | | return super.packForBT(page); |
| | | } |
| | | |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.dao; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.stylefeng.guns.modular.system.model.Invite; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface InviteMapper extends BaseMapper<Invite> { |
| | | |
| | | |
| | | List<Invite> inviteList(@Param("uid")Integer uid,@Param("uid") String startTime, @Param("uid")String endTime, |
| | | @Param("pageNum")Integer pageNum, @Param("size")Integer size); |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | List<TDriver> queryIdleDriver(@Param("type") Integer type, @Param("companyId") Integer companyId); |
| | | |
| | | List<Map<String, Object>> inviteList(@Param("page")Page<Map<String, Object>> page, |
| | | @Param("startTime")String startTime, |
| | | @Param("endTime")String endTime, |
| | | @Param("inviteName")String inviteName, |
| | | @Param("uid")Integer uid); |
| | | } |
| | |
| | | List<Map<String,Object>> getUserListNoPage(@Param("roleType") Integer roleType, |
| | | @Param("nowUserId") Integer nowUserId); |
| | | |
| | | List<Map<String, Object>> inviteList(@Param("page")Page<Map<String, Object>> page, |
| | | @Param("startTime")String startTime, |
| | | @Param("endTime")String endTime, |
| | | @Param("inviteName")String inviteName, |
| | | @Param("uid")Integer uid); |
| | | } |
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.InviteMapper"> |
| | | |
| | | |
| | | <select id="inviteList" resultType="com.stylefeng.guns.modular.system.model.Invite"> |
| | | select t1.*,t2.phone,t2.avatar from t_invite t1 |
| | | left join t_user t2 on t2.id = t1.userId |
| | | where 1=1 |
| | | <if test="null != uid"> |
| | | and t1.inviteUserId = #{uid} |
| | | </if> |
| | | <if test="null != startTime and null != endTime"> |
| | | and t1.registerTime between #{startTime} and #{endTime} |
| | | </if> |
| | | order by t1.registerTime desc |
| | | limit #{pageNum}, #{size} |
| | | </select> |
| | | </mapper> |
| | |
| | | ) |
| | | and id in (select driverId from t_driver_orders where `type` = #{type}) |
| | | </select> |
| | | <select id="inviteList" resultType="java.util.Map"> |
| | | select t1.*,t2.phone,t2.avatar,t2.nickName from t_invite t1 |
| | | left join t_user t2 on t2.id = t1.userId |
| | | where 1=1 |
| | | <if test="null != uid"> |
| | | and t1.inviteUserId = #{uid} |
| | | </if> |
| | | <if test="inviteName != null and inviteName != ''"> |
| | | and t2.nickName LIKE CONCAT('%',#{inviteName},'%') |
| | | </if> |
| | | <if test="null != startTime and null != endTime"> |
| | | and t1.registerTime between #{startTime} and #{endTime} |
| | | </if> |
| | | order by t1.registerTime desc |
| | | </select> |
| | | </mapper> |
| | |
| | | </where> |
| | | order by o.id desc |
| | | </select> |
| | | <select id="inviteList" resultType="java.util.Map"> |
| | | select t1.*,t2.phone,t2.avatar,t2.nickName from t_invite t1 |
| | | left join t_user t2 on t2.id = t1.userId |
| | | where 1=1 |
| | | <if test="null != uid"> |
| | | and t1.inviteUserId = #{uid} |
| | | </if> |
| | | <if test="inviteName != null and inviteName != ''"> |
| | | and t2.nickName LIKE CONCAT('%',#{inviteName},'%') |
| | | </if> |
| | | <if test="null != startTime and null != endTime"> |
| | | and t1.registerTime between #{startTime} and #{endTime} |
| | | </if> |
| | | order by t1.registerTime desc |
| | | </select> |
| | | |
| | | |
| | | </mapper> |
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 io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 平台协议 |
| | | */ |
| | | @TableName("t_invite") |
| | | @Data |
| | | public class Invite { |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | @TableField("id") |
| | | private Integer id; |
| | | // 邀请人id |
| | | @TableField("inviteUserId") |
| | | private Integer inviteUserId; |
| | | // 被邀请人id |
| | | @TableField("userId") |
| | | private Integer userId; |
| | | /** |
| | | * 添加时间 |
| | | */ |
| | | @TableField("registerTime") |
| | | @ApiModelProperty("注册时间") |
| | | private Date registerTime; |
| | | /** |
| | | * 使用范围(1=用户,2=司机) |
| | | */ |
| | | @TableField("useType") |
| | | private Integer useType; |
| | | |
| | | @TableField(exist = false) |
| | | @ApiModelProperty("头像") |
| | | private String avatar; |
| | | |
| | | @ApiModelProperty("手机号") |
| | | @TableField(exist = false) |
| | | private String phone; |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.stylefeng.guns.modular.system.model.Invite; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface IInviteService extends IService<Invite> { |
| | | |
| | | List<Invite> inviteList(Integer uid, String startTime, String endTime, Integer pageNum, Integer size); |
| | | } |
| | |
| | | * @throws Exception |
| | | */ |
| | | List<TDriver> queryIdleDriver(Integer type, Double lon, Double lat, Double distance, Integer companyId) throws Exception; |
| | | |
| | | List<Map<String, Object>> inviteList(Page<Map<String, Object>> page, String startTime, String endTime, String userName, Integer uid); |
| | | } |
| | |
| | | */ |
| | | List<Map<String,Object>> getUserListNoPage(@Param("roleType") Integer roleType, |
| | | @Param("nowUserId") Integer nowUserId); |
| | | |
| | | List<Map<String, Object>> inviteList(Page<Map<String, Object>> page, String startTime, String endTime, String inviteName, Integer uid); |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.stylefeng.guns.modular.system.dao.InviteMapper; |
| | | import com.stylefeng.guns.modular.system.model.Invite; |
| | | import com.stylefeng.guns.modular.system.service.IInviteService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | |
| | | @Service |
| | | public class InviteServiceImpl extends ServiceImpl<InviteMapper, Invite> implements IInviteService { |
| | | |
| | | |
| | | @Override |
| | | public List<Invite> inviteList(Integer uid, String startTime, String endTime, Integer pageNum, Integer size) { |
| | | return this.baseMapper.inviteList(uid,startTime,endTime,pageNum,size); |
| | | } |
| | | } |
| | |
| | | System.err.println("满足条件司机=="+list); |
| | | return list; |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> inviteList(Page<Map<String, Object>> page, String startTime, String endTime, String userName, Integer uid) { |
| | | return this.baseMapper.inviteList(page, startTime, endTime,userName,uid); |
| | | } |
| | | } |
| | |
| | | public List<Map<String, Object>> getUserListNoPage(Integer roleType, Integer nowUserId) { |
| | | return this.baseMapper.getUserListNoPage(roleType, nowUserId); |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> inviteList(Page<Map<String, Object>> page, String startTime, String endTime, String inviteName, Integer uid) { |
| | | return this.baseMapper.inviteList(page, startTime, endTime,inviteName,uid); |
| | | } |
| | | } |
| | |
| | | } |
| | | return fileName; |
| | | } |
| | | public static String ossUploadCode( MultipartFile file) throws IOException{ |
| | | //CommonsMultipartFile file = (CommonsMultipartFile)multipartFile; |
| | | String fileName = ""; |
| | | if(file!=null && !"".equals(file.getOriginalFilename()) && file.getOriginalFilename()!=null){ |
| | | InputStream content = file.getInputStream();//获得指定文件的输入流 |
| | | ObjectMetadata meta = new ObjectMetadata();// 创建上传Object的Metadata |
| | | meta.setContentLength(file.getSize()); // 必须设置ContentLength |
| | | String originalFilename = file.getOriginalFilename(); |
| | | fileName = UUID.randomUUID().toString().replaceAll("-","") + originalFilename.subSequence(originalFilename.lastIndexOf("."), originalFilename.length()); |
| | | ossClient.putObject(bucketName,"img/"+fileName,content,meta);// 上传Object. |
| | | if(fileName != null && !"".equals(fileName)){ |
| | | System.out.println(fileName); |
| | | fileName = oss_domain_cdn+"img/"+fileName; |
| | | } |
| | | } |
| | | return fileName; |
| | | } |
| | | } |
| | |
| | | <div class="col-sm-3"> |
| | | <#SelectCon id="couponUseType" name="优惠券类型" > |
| | | <option value="">全部</option> |
| | | <option value="0">通用券</option> |
| | | <option value="1">专车券</option> |
| | | <option value="2">出租车券</option> |
| | | <option value="3">跨城出行券</option> |
| | | </#SelectCon> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | |
| | | <div class="col-sm-3"> |
| | | <#SelectCon id="couponUseType" name="优惠券类型" > |
| | | <option value="">全部</option> |
| | | <option value="0">通用券</option> |
| | | <option value="1">专车券</option> |
| | | <option value="2">出租车券</option> |
| | | <option value="3">跨城出行券</option> |
| | | </#SelectCon> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | |
| | | </div> |
| | | </div> |
| | | <#select id="couponUseType" name="服务类型" underline="true"> |
| | | <option value="1">专车券</option> |
| | | <option value="2">出租车券</option> |
| | | <option value="3">跨城出行券</option> |
| | | <option value="0">通用券</option> |
| | | </#select> |
| | | <#input id="money" name="金额" underline="true" placeholder="最多4位数字"/> |
| | | <div class="form-group" id="fullMoneys" style="display: none"> |
New file |
| | |
| | | @layout("/common/_container.html"){ |
| | | <div class="row"> |
| | | <div class="col-sm-12"> |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-title"> |
| | | <h5>邀请明细</h5> |
| | | </div> |
| | | <input type="hidden" id="id" name="id" value="${id}"> |
| | | |
| | | <div class="ibox-content"> |
| | | <div class="row row-lg"> |
| | | <div class="col-sm-12"> |
| | | <div class="row"> |
| | | |
| | | <div class="col-sm-3"> |
| | | <#NameCon id="userName" name="被邀请人" /> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <#TimeCon id="time" name="邀请日期范围" isTime="false"/> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <#button name="搜索" icon="fa-search" clickFun="TUser.search()"/> |
| | | <#button name="重置" icon="fa-trash" clickFun="TUser.resetSearch()" space="true"/> |
| | | </div> |
| | | |
| | | </div> |
| | | <#table id="TUserTable"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/static/modular/system/tDriver/tDriverInvite.js"></script> |
| | | <script> |
| | | laydate.render({ |
| | | elem: '#time' |
| | | ,range: true |
| | | }); |
| | | |
| | | </script> |
| | | @} |
| | |
| | | <#label id="payMoney" name="订单总价" value="${item.payMoney}"/> |
| | | <#label id="companyMoney" name="平台收益" value="${companyMoney}"/> |
| | | @} |
| | | @if(item.payManner == 1){ |
| | | <#label id="payMoney" name="订单总价" value="${item.payMoney}"/> |
| | | <#label id="payMoney" name="订单总价" value="${item.payMoney}"/> |
| | | <#label id="companyMoney" name="起步价" value="${item.startMoney}"/> |
| | | <#label id="companyMoney" name="等待费" value="${item.waitMoney}"/> |
| | | <#label id="companyMoney" name="时长费" value="${item.durationMoney}"/> |
| | |
| | | <#label id="companyMoney" name="过路费" value="${item.roadTollMoney}"/> |
| | | <#label id="companyMoney" name="停车费" value="${item.parkMoney}"/> |
| | | <#label id="companyMoney" name="平台抽成" value="${companyMoney}"/> |
| | | @} |
| | | </div> |
| | | |
| | | <div class="col-sm-6"> |
New file |
| | |
| | | @layout("/common/_container.html"){ |
| | | <div class="row"> |
| | | <div class="col-sm-12"> |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-title"> |
| | | <h5>邀请明细</h5> |
| | | </div> |
| | | <input type="hidden" id="id" name="id" value="${id}"> |
| | | |
| | | <div class="ibox-content"> |
| | | <div class="row row-lg"> |
| | | <div class="col-sm-12"> |
| | | <div class="row"> |
| | | |
| | | <div class="col-sm-3"> |
| | | <#NameCon id="userName" name="被邀请人" /> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <#TimeCon id="time" name="邀请日期范围" isTime="false"/> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <#button name="搜索" icon="fa-search" clickFun="TUser.search()"/> |
| | | <#button name="重置" icon="fa-trash" clickFun="TUser.resetSearch()" space="true"/> |
| | | </div> |
| | | |
| | | </div> |
| | | <#table id="TUserTable"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/static/modular/system/tUser/tUserInvite.js"></script> |
| | | <script> |
| | | laydate.render({ |
| | | elem: '#time' |
| | | ,range: true |
| | | }); |
| | | |
| | | </script> |
| | | @} |
| | |
| | | <h4><a href="#" onclick="driverActivityHistory(2,${userActivityInviteId})">领取列表</a></h4> |
| | | </div> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-title"> |
| | | <h3>打折活动</h3> |
| | | </div> |
| | | <div class="ibox-content"> |
| | | <h1 class="no-margins text-navy">使用人数:<span id="userActivityDiscount1Number"></span></h1> |
| | | <h1 class="no-margins text-navy">折扣总金额:<span id="userActivityDiscount1Money"></span></h1> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-title"> |
| | | <h3>红包活动</h3> |
| | | </div> |
| | | <div class="ibox-content"> |
| | | <h1 class="no-margins text-navy">领取人数:<span id="userActivityRedenvelopeNumber"></span></h1> |
| | | <h1 class="no-margins text-navy">领取总金额:<span id="userActivityRedenvelopeMoney"></span></h1> |
| | | <h1 class="no-margins text-navy">使用总金额:<span id="userActivityRedenvelopeUseMoney"></span></h1> |
| | | </div> |
| | | <h4><a href="#" onclick="driverActivityHistory(4,${userActivityRedenvelopeId})">领取列表</a></h4> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <!-- <div class="col-sm-3">--> |
| | | <!-- <div class="ibox float-e-margins">--> |
| | | <!-- <div class="ibox-title">--> |
| | | <!-- <h3>打折活动</h3>--> |
| | | <!-- </div>--> |
| | | <!-- <div class="ibox-content">--> |
| | | <!-- <h1 class="no-margins text-navy">使用人数:<span id="userActivityDiscount1Number"></span></h1>--> |
| | | <!-- <h1 class="no-margins text-navy">折扣总金额:<span id="userActivityDiscount1Money"></span></h1>--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- <div class="col-sm-3">--> |
| | | <!-- <div class="ibox float-e-margins">--> |
| | | <!-- <div class="ibox-title">--> |
| | | <!-- <h3>红包活动</h3>--> |
| | | <!-- </div>--> |
| | | <!-- <div class="ibox-content">--> |
| | | <!-- <h1 class="no-margins text-navy">领取人数:<span id="userActivityRedenvelopeNumber"></span></h1>--> |
| | | <!-- <h1 class="no-margins text-navy">领取总金额:<span id="userActivityRedenvelopeMoney"></span></h1>--> |
| | | <!-- <h1 class="no-margins text-navy">使用总金额:<span id="userActivityRedenvelopeUseMoney"></span></h1>--> |
| | | <!-- </div>--> |
| | | <!-- <h4><a href="#" onclick="driverActivityHistory(4,${userActivityRedenvelopeId})">领取列表</a></h4>--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!--</div>--> |
| | | |
| | | <div class="row"> |
| | | <div class="col-sm-12"> |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-title"> |
| | | <h5>充值活动</h5> |
| | | </div> |
| | | <div class="ibox-content"> |
| | | <div class="row row-lg"> |
| | | <div class="col-sm-12"> |
| | | <#table id="DriverActivityTable"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <!-- <div class="col-sm-12">--> |
| | | <!-- <div class="ibox float-e-margins">--> |
| | | <!-- <div class="ibox-title">--> |
| | | <!-- <h5>充值活动</h5>--> |
| | | <!-- </div>--> |
| | | <!-- <div class="ibox-content">--> |
| | | <!-- <div class="row row-lg">--> |
| | | <!-- <div class="col-sm-12">--> |
| | | <!-- <#table id="DriverActivityTable"/>--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | </div> |
| | | <!-- ChartJS--> |
| | | <script type="text/javascript"> |
| | |
| | | /** |
| | | * 管理初始化 |
| | | */ |
| | | var DriverActivity = { |
| | | id: "DriverActivityTable", //表格id |
| | | seItem: null, //选中的条目 |
| | | table: null, |
| | | layerIndex: -1 |
| | | }; |
| | | // var DriverActivity = { |
| | | // id: "DriverActivityTable", //表格id |
| | | // seItem: null, //选中的条目 |
| | | // table: null, |
| | | // layerIndex: -1 |
| | | // }; |
| | | |
| | | /** |
| | | * 初始化表格的列 |
| | | */ |
| | | DriverActivity.initColumn = function () { |
| | | return [ |
| | | {field: 'selectItem', radio: true}, |
| | | {title: '', field: 'id', visible: false, align: 'center', valign: 'middle'}, |
| | | {title: '充值金额', field: 'money', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '通用券领取总数', field: 'number', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '通用券使用总数', field: 'useNumber', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '通用券使用总金额', field: 'useMoney', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '专车券领取总数', field: 'speNumber', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '专车券使用总数', field: 'speUseNumber', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '专车券使用总金额', field: 'speUserMoney', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '出租车券领取总数', field: 'taxiNumber', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '出租车券使用总数', field: 'taxiUseNumber', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '出租车券使用总金额', field: 'taxiUserMoney', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '城际券领取总数', field: 'intercityNumber', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '城际券使用总数', field: 'intercityUseNumber', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '城际券使用总金额', field: 'intercityUserMoney', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '', field: 'insertTime', visible: true, align: 'center', valign: 'middle', |
| | | formatter: function (value, row) { |
| | | var btn = ''; |
| | | btn+='<a href="javascript:void(0);" onclick="driverActivityHistory(5,'+row.id+')">领取记录</a>' |
| | | return [btn]; |
| | | } |
| | | }, |
| | | ]; |
| | | }; |
| | | // DriverActivity.initColumn = function () { |
| | | // return [ |
| | | // {field: 'selectItem', radio: true}, |
| | | // {title: '', field: 'id', visible: false, align: 'center', valign: 'middle'}, |
| | | // {title: '充值金额', field: 'money', visible: true, align: 'center', valign: 'middle'}, |
| | | // {title: '通用券领取总数', field: 'number', visible: true, align: 'center', valign: 'middle'}, |
| | | // {title: '通用券使用总数', field: 'useNumber', visible: true, align: 'center', valign: 'middle'}, |
| | | // {title: '通用券使用总金额', field: 'useMoney', visible: true, align: 'center', valign: 'middle'}, |
| | | // {title: '专车券领取总数', field: 'speNumber', visible: true, align: 'center', valign: 'middle'}, |
| | | // {title: '专车券使用总数', field: 'speUseNumber', visible: true, align: 'center', valign: 'middle'}, |
| | | // {title: '专车券使用总金额', field: 'speUserMoney', visible: true, align: 'center', valign: 'middle'}, |
| | | // {title: '出租车券领取总数', field: 'taxiNumber', visible: true, align: 'center', valign: 'middle'}, |
| | | // {title: '出租车券使用总数', field: 'taxiUseNumber', visible: true, align: 'center', valign: 'middle'}, |
| | | // {title: '出租车券使用总金额', field: 'taxiUserMoney', visible: true, align: 'center', valign: 'middle'}, |
| | | // {title: '城际券领取总数', field: 'intercityNumber', visible: true, align: 'center', valign: 'middle'}, |
| | | // {title: '城际券使用总数', field: 'intercityUseNumber', visible: true, align: 'center', valign: 'middle'}, |
| | | // {title: '城际券使用总金额', field: 'intercityUserMoney', visible: true, align: 'center', valign: 'middle'}, |
| | | // {title: '', field: 'insertTime', visible: true, align: 'center', valign: 'middle', |
| | | // formatter: function (value, row) { |
| | | // var btn = ''; |
| | | // btn+='<a href="javascript:void(0);" onclick="driverActivityHistory(5,'+row.id+')">领取记录</a>' |
| | | // return [btn]; |
| | | // } |
| | | // }, |
| | | // ]; |
| | | // }; |
| | | </script> |
| | | @} |
| | |
| | | <style> |
| | | .table1{ |
| | | display: inline; |
| | | width: 16.6666666%; |
| | | width: 33.33%; |
| | | float:left; |
| | | text-align:center; |
| | | border-collapse:collapse; |
| | |
| | | <div id="div1" class='table1' onclick="getContent(1)" style="border-right: 1px solid #333;background-color: rgb(26, 179, 148);color: white;">活动设置</div> |
| | | <div id="div2" class='table1' onclick="getContent(2)" style="border-right: 1px solid #333;">注册奖励</div> |
| | | <div id="div3" class='table1' onclick="getContent(3)" style="border-right: 1px solid #333;">邀请奖励</div> |
| | | <div id="div4" class='table1' onclick="getContent(4)" style="border-right: 1px solid #333;">充值赠送</div> |
| | | <div id="div5" class='table1' onclick="getContent(5)" style="border-right: 1px solid #333;">打折活动</div> |
| | | <div id="div6" class='table1' onclick="getContent(6)" style="border-right: 1px solid #333;">红包活动</div> |
| | | <!-- <div id="div4" class='table1' onclick="getContent(4)" style="border-right: 1px solid #333;">充值赠送</div>--> |
| | | <!-- <div id="div5" class='table1' onclick="getContent(5)" style="border-right: 1px solid #333;">打折活动</div>--> |
| | | <!-- <div id="div6" class='table1' onclick="getContent(6)" style="border-right: 1px solid #333;">红包活动</div>--> |
| | | </div> |
| | | <div class="row" id="content1" style="margin-left: 100px;"> |
| | | <div class="col-sm-11"> |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="row" id="content4" style="margin-left: 100px;"> |
| | | <div class="col-sm-11"> |
| | | <h1>充值赠送奖励</h1> |
| | | <br/> |
| | | <br/> |
| | | <div class="form-group"> |
| | | <div class="col-sm-10"> |
| | | <#button name="添加" icon="fa-plus" clickFun="UserActivityInfoDlg.toAddRegistOpt()"/> 启用: <input type="checkbox" id="content4Check" class="js-switch4" checked=""> |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <div class="col-sm-15"> |
| | | <div style="height: 200px; border: 1px solid #e5e6e7;overflow-y: auto;"> |
| | | <table class="table table-striped table-bordered table-hover table-condensed"> |
| | | <thead> |
| | | <tr> |
| | | <th style="width: 250px;">充值金额</th> |
| | | <th style="width: 250px;">有效天数</th> |
| | | <th style="width: 300px;">最高金额</th> |
| | | <th style="width: 300px;">通用券金额</th> |
| | | <th style="width: 300px;">通用券数量</th> |
| | | <th style="width: 300px;">专车券金额</th> |
| | | <th style="width: 300px;">专车券数量</th> |
| | | <th style="width: 400px;">出租车券金额</th> |
| | | <th style="width: 400px;">出租车券数量</th> |
| | | <th style="width: 300px;">城际金额</th> |
| | | <th style="width: 300px;">城际券数量</th> |
| | | <th style="width: 100px;">操作</th> |
| | | </tr> |
| | | </thead> |
| | | <tbody id="coun"> |
| | | <!-- <div class="row" id="content4" style="margin-left: 100px;">--> |
| | | <!-- <div class="col-sm-11">--> |
| | | <!-- <h1>充值赠送奖励</h1>--> |
| | | <!-- <br/>--> |
| | | <!-- <br/>--> |
| | | <!-- <div class="form-group">--> |
| | | <!-- <div class="col-sm-10">--> |
| | | <!-- <#button name="添加" icon="fa-plus" clickFun="UserActivityInfoDlg.toAddRegistOpt()"/> 启用: <input type="checkbox" id="content4Check" class="js-switch4" checked="">--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- <div class="form-group">--> |
| | | <!-- <div class="col-sm-15">--> |
| | | <!-- <div style="height: 200px; border: 1px solid #e5e6e7;overflow-y: auto;">--> |
| | | <!-- <table class="table table-striped table-bordered table-hover table-condensed">--> |
| | | <!-- <thead>--> |
| | | <!-- <tr>--> |
| | | <!-- <th style="width: 250px;">充值金额</th>--> |
| | | <!-- <th style="width: 250px;">有效天数</th>--> |
| | | <!-- <th style="width: 300px;">最高金额</th>--> |
| | | <!-- <th style="width: 300px;">通用券金额</th>--> |
| | | <!-- <th style="width: 300px;">通用券数量</th>--> |
| | | <!-- <th style="width: 300px;">专车券金额</th>--> |
| | | <!-- <th style="width: 300px;">专车券数量</th>--> |
| | | <!-- <th style="width: 400px;">出租车券金额</th>--> |
| | | <!-- <th style="width: 400px;">出租车券数量</th>--> |
| | | <!-- <th style="width: 300px;">城际金额</th>--> |
| | | <!-- <th style="width: 300px;">城际券数量</th>--> |
| | | <!-- <th style="width: 100px;">操作</th>--> |
| | | <!-- </tr>--> |
| | | <!-- </thead>--> |
| | | <!-- <tbody id="coun">--> |
| | | |
| | | </tbody> |
| | | </table> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="row" id="content5" style="margin-left: 100px;"> |
| | | <div class="col-sm-11"> |
| | | <div class="form-group"> |
| | | <div class="col-sm-10"> |
| | | <h1>打折活动奖励</h1> |
| | | <br/> |
| | | <br/> |
| | | 启用: <input type="checkbox" id="content5Check" class="js-switch2" checked=""> |
| | | <br/> |
| | | <br/> |
| | | 专车活动打折: |
| | | |
| | | <input type="text" name="zc1" id="content5Num1" class="form-control newWidth" /> 折 |
| | | <br/> |
| | | <br/> |
| | | 出租车活动打折: |
| | | |
| | | <input type="text" name="zc1" id="content5Num2" class="form-control newWidth" /> 折 |
| | | <br/> |
| | | <br/> |
| | | 小件物流活动打折: |
| | | <input type="text" name="zc1" id="content5Num3" class="form-control newWidth" /> 折 |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <!-- </tbody>--> |
| | | <!-- </table>--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- <div class="row" id="content5" style="margin-left: 100px;">--> |
| | | <!-- <div class="col-sm-11">--> |
| | | <!-- <div class="form-group">--> |
| | | <!-- <div class="col-sm-10">--> |
| | | <!-- <h1>打折活动奖励</h1>--> |
| | | <!-- <br/>--> |
| | | <!-- <br/>--> |
| | | <!-- 启用: <input type="checkbox" id="content5Check" class="js-switch2" checked="">--> |
| | | <!-- <br/>--> |
| | | <!-- <br/>--> |
| | | <!-- 专车活动打折:--> |
| | | <!-- --> |
| | | <!-- <input type="text" name="zc1" id="content5Num1" class="form-control newWidth" /> 折--> |
| | | <!-- <br/>--> |
| | | <!-- <br/>--> |
| | | <!-- 出租车活动打折:--> |
| | | <!-- --> |
| | | <!-- <input type="text" name="zc1" id="content5Num2" class="form-control newWidth" /> 折--> |
| | | <!-- <br/>--> |
| | | <!-- <br/>--> |
| | | <!-- 小件物流活动打折:--> |
| | | <!-- <input type="text" name="zc1" id="content5Num3" class="form-control newWidth" /> 折--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | |
| | | <div class="row" id="content6" style="margin-left: 100px;"> |
| | | <div class="col-sm-11"> |
| | | <div class="form-group"> |
| | | <div class="col-sm-10"> |
| | | <input type="hidden" id="content6RedId"> |
| | | <h1>红包活动奖励</h1> |
| | | <br/> |
| | | <br/> |
| | | 启用: <input type="checkbox" id="content6Check" class="js-switch3" checked=""> |
| | | <br/> |
| | | <br/> |
| | | <#button name="选择红包" icon="fa-plus" clickFun="UserActivityInfoDlg.toSelectRedOpt()"/> |
| | | <br/> |
| | | <br/> |
| | | 红包类型: |
| | | |
| | | |
| | | <input type="text" name="zc1" id="content6Num1" class="form-control newWidth" readonly/> |
| | | <br/> |
| | | <br/> |
| | | 总金额: |
| | | |
| | | |
| | | <input type="text" name="zc1" id="content6Num2" class="form-control newWidth" readonly/> |
| | | <br/> |
| | | <br/> |
| | | 每个红包金额: <input type="text" name="zc1" id="content6Num3" class="form-control newWidth" readonly/> |
| | | <br/> |
| | | <br/> |
| | | 有效期: |
| | | |
| | | <input type="text" name="zc1" id="content6Num4" class="form-control newWidth" readonly/> 天 |
| | | <br/> |
| | | <br/> |
| | | 最高金额: <input type="text" name="zc1" id="content6Num5" class="form-control newWidth" /> |
| | | <br/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <!-- <div class="row" id="content6" style="margin-left: 100px;">--> |
| | | <!-- <div class="col-sm-11">--> |
| | | <!-- <div class="form-group">--> |
| | | <!-- <div class="col-sm-10">--> |
| | | <!-- <input type="hidden" id="content6RedId">--> |
| | | <!-- <h1>红包活动奖励</h1>--> |
| | | <!-- <br/>--> |
| | | <!-- <br/>--> |
| | | <!-- 启用: <input type="checkbox" id="content6Check" class="js-switch3" checked="">--> |
| | | <!-- <br/>--> |
| | | <!-- <br/>--> |
| | | <!-- <#button name="选择红包" icon="fa-plus" clickFun="UserActivityInfoDlg.toSelectRedOpt()"/>--> |
| | | <!-- <br/>--> |
| | | <!-- <br/>--> |
| | | <!-- 红包类型:--> |
| | | <!-- --> |
| | | <!-- --> |
| | | <!-- <input type="text" name="zc1" id="content6Num1" class="form-control newWidth" readonly/> --> |
| | | <!-- <br/>--> |
| | | <!-- <br/>--> |
| | | <!-- 总金额:--> |
| | | <!-- --> |
| | | <!-- --> |
| | | <!-- <input type="text" name="zc1" id="content6Num2" class="form-control newWidth" readonly/> --> |
| | | <!-- <br/>--> |
| | | <!-- <br/>--> |
| | | <!-- 每个红包金额: <input type="text" name="zc1" id="content6Num3" class="form-control newWidth" readonly/> --> |
| | | <!-- <br/>--> |
| | | <!-- <br/>--> |
| | | <!-- 有效期:--> |
| | | <!-- --> |
| | | <!-- <input type="text" name="zc1" id="content6Num4" class="form-control newWidth" readonly/> 天--> |
| | | <!-- <br/>--> |
| | | <!-- <br/>--> |
| | | <!-- 最高金额: <input type="text" name="zc1" id="content6Num5" class="form-control newWidth" /> --> |
| | | <!-- <br/>--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | </div> |
| | | </div> |
| | | |
| | |
| | | }); |
| | | function getContent(type){ |
| | | //设置点击字体颜色效果 |
| | | for(var i=1;i<7;i++){ |
| | | for(var i=1;i<4;i++){ |
| | | document.getElementById("div"+i).style.color="#888888";// |
| | | document.getElementById("div"+i).style.backgroundColor =""; |
| | | $("#content"+i).hide(); |
| | |
| | | document.getElementById("div"+type).style.backgroundColor ="rgb(26, 179, 148)"; |
| | | $("#type").val(type); |
| | | $("#content"+type).show(); |
| | | if(type!=6){ |
| | | if(type!=3){ |
| | | $("#ensure").hide(); |
| | | $("#nextB").show(); |
| | | }else{ |
| | |
| | | function nextContent(){ |
| | | var type = $("#type").val(); |
| | | getContent(parseInt(type)+1); |
| | | if(parseInt(type)+1==6){ |
| | | if(parseInt(type)+1==3){ |
| | | $("#ensure").show(); |
| | | $("#nextB").hide(); |
| | | } |
| | |
| | | <style> |
| | | .table1{ |
| | | display: inline; |
| | | width: 16.6666666%; |
| | | width: 33.33%; |
| | | float:left; |
| | | text-align:center; |
| | | border-collapse:collapse; |
| | |
| | | <div id="div1" class='table1' onclick="getContent(1)" style="border-right: 1px solid #333;background-color: rgb(26, 179, 148);color: white;">活动设置</div> |
| | | <div id="div2" class='table1' onclick="getContent(2)" style="border-right: 1px solid #333;">注册奖励</div> |
| | | <div id="div3" class='table1' onclick="getContent(3)" style="border-right: 1px solid #333;">邀请奖励</div> |
| | | <div id="div4" class='table1' onclick="getContent(4)" style="border-right: 1px solid #333;">充值赠送</div> |
| | | <div id="div5" class='table1' onclick="getContent(5)" style="border-right: 1px solid #333;">打折活动</div> |
| | | <div id="div6" class='table1' onclick="getContent(6)" style="border-right: 1px solid #333;">红包活动</div> |
| | | <!-- <div id="div4" class='table1' onclick="getContent(4)" style="border-right: 1px solid #333;">充值赠送</div>--> |
| | | <!-- <div id="div5" class='table1' onclick="getContent(5)" style="border-right: 1px solid #333;">打折活动</div>--> |
| | | <!-- <div id="div6" class='table1' onclick="getContent(6)" style="border-right: 1px solid #333;">红包活动</div>--> |
| | | </div> |
| | | <div class="row" id="content1" style="margin-left: 100px;"> |
| | | <div class="col-sm-11"> |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="row" id="content4" style="margin-left: 100px;"> |
| | | <div class="col-sm-11"> |
| | | <h1>充值赠送奖励</h1> |
| | | <br/> |
| | | <br/> |
| | | <div class="form-group"> |
| | | <div class="col-sm-10"> |
| | | 启用: |
| | | <input type="checkbox" |
| | | @if(isNotEmpty(balanceInfoList) && balanceInfoList[0].enable==2){ |
| | | checked="" |
| | | @} |
| | | id="content4Check" class="js-switch4"> |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <div class="col-sm-15"> |
| | | <div style="height: 200px; border: 1px solid #e5e6e7;overflow-y: auto;"> |
| | | <table class="table table-striped table-bordered table-hover table-condensed"> |
| | | <thead> |
| | | <tr> |
| | | <th style="width: 250px;">充值金额</th> |
| | | <th style="width: 250px;">有效天数</th> |
| | | <th style="width: 300px;">最高金额</th> |
| | | <th style="width: 300px;">通用券金额</th> |
| | | <th style="width: 300px;">通用券数量</th> |
| | | <th style="width: 300px;">专车券金额</th> |
| | | <th style="width: 300px;">专车券数量</th> |
| | | <th style="width: 400px;">出租车券金额</th> |
| | | <th style="width: 400px;">出租车券数量</th> |
| | | <th style="width: 300px;">城际金额</th> |
| | | <th style="width: 300px;">城际券数量</th> |
| | | </tr> |
| | | </thead> |
| | | <tbody id="coun"> |
| | | @for(obj in balanceInfoList){ |
| | | <tr class="timeClass">' + |
| | | <td><input type="hidden" id="num1" name="num1" value="${obj.money}">${obj.money}</td> |
| | | <td><input type="hidden" id="num10" name="num10" value="${obj.effective}">${obj.effective}</td> |
| | | <td><input type="hidden" id="num11" name="num3" value="${obj.totalPrice}">${obj.totalPrice}</td> |
| | | <td><input type="hidden" id="num3" name="num3" value="${obj.generalCouponMoney}">${obj.generalCouponMoney}</td> |
| | | <td><input type="hidden" id="num2" name="num2" value="${obj.generalNum}">${obj.generalNum}</td> |
| | | <!-- <div class="row" id="content4" style="margin-left: 100px;">--> |
| | | <!-- <div class="col-sm-11">--> |
| | | <!-- <h1>充值赠送奖励</h1>--> |
| | | <!-- <br/>--> |
| | | <!-- <br/>--> |
| | | <!-- <div class="form-group">--> |
| | | <!-- <div class="col-sm-10">--> |
| | | <!-- 启用: --> |
| | | <!-- <input type="checkbox"--> |
| | | <!-- @if(isNotEmpty(balanceInfoList) && balanceInfoList[0].enable==2){--> |
| | | <!-- checked=""--> |
| | | <!-- @}--> |
| | | <!-- id="content4Check" class="js-switch4">--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- <div class="form-group">--> |
| | | <!-- <div class="col-sm-15">--> |
| | | <!-- <div style="height: 200px; border: 1px solid #e5e6e7;overflow-y: auto;">--> |
| | | <!-- <table class="table table-striped table-bordered table-hover table-condensed">--> |
| | | <!-- <thead>--> |
| | | <!-- <tr>--> |
| | | <!-- <th style="width: 250px;">充值金额</th>--> |
| | | <!-- <th style="width: 250px;">有效天数</th>--> |
| | | <!-- <th style="width: 300px;">最高金额</th>--> |
| | | <!-- <th style="width: 300px;">通用券金额</th>--> |
| | | <!-- <th style="width: 300px;">通用券数量</th>--> |
| | | <!-- <th style="width: 300px;">专车券金额</th>--> |
| | | <!-- <th style="width: 300px;">专车券数量</th>--> |
| | | <!-- <th style="width: 400px;">出租车券金额</th>--> |
| | | <!-- <th style="width: 400px;">出租车券数量</th>--> |
| | | <!-- <th style="width: 300px;">城际金额</th>--> |
| | | <!-- <th style="width: 300px;">城际券数量</th>--> |
| | | <!-- </tr>--> |
| | | <!-- </thead>--> |
| | | <!-- <tbody id="coun">--> |
| | | <!-- @for(obj in balanceInfoList){--> |
| | | <!-- <tr class="timeClass">' +--> |
| | | <!-- <td><input type="hidden" id="num1" name="num1" value="${obj.money}">${obj.money}</td>--> |
| | | <!-- <td><input type="hidden" id="num10" name="num10" value="${obj.effective}">${obj.effective}</td>--> |
| | | <!-- <td><input type="hidden" id="num11" name="num3" value="${obj.totalPrice}">${obj.totalPrice}</td>--> |
| | | <!-- <td><input type="hidden" id="num3" name="num3" value="${obj.generalCouponMoney}">${obj.generalCouponMoney}</td>--> |
| | | <!-- <td><input type="hidden" id="num2" name="num2" value="${obj.generalNum}">${obj.generalNum}</td>--> |
| | | |
| | | <td><input type="hidden" id="num5" name="num5" value="${obj.specialCouponMoney}">${obj.specialCouponMoney}</td> |
| | | <td><input type="hidden" id="num4" name="num4" value="${obj.specialNum}">${obj.specialNum}</td> |
| | | <!-- <td><input type="hidden" id="num5" name="num5" value="${obj.specialCouponMoney}">${obj.specialCouponMoney}</td>--> |
| | | <!-- <td><input type="hidden" id="num4" name="num4" value="${obj.specialNum}">${obj.specialNum}</td>--> |
| | | |
| | | <td><input type="hidden" id="num7" name="num7" value="${obj.taxiCouponMoney}">${obj.taxiCouponMoney}</td> |
| | | <td><input type="hidden" id="num6" name="num6" value="${obj.taxiNum}">${obj.taxiNum}</td> |
| | | <!-- <td><input type="hidden" id="num7" name="num7" value="${obj.taxiCouponMoney}">${obj.taxiCouponMoney}</td>--> |
| | | <!-- <td><input type="hidden" id="num6" name="num6" value="${obj.taxiNum}">${obj.taxiNum}</td>--> |
| | | |
| | | <td><input type="hidden" id="num9" name="num9" value="${obj.intercityCouponMoney}">${obj.intercityCouponMoney}</td> |
| | | <td><input type="hidden" id="num8" name="num8" value="${obj.intercityNum}">${obj.intercityNum}</td> |
| | | </tr> |
| | | @} |
| | | </tbody> |
| | | </table> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="row" id="content5" style="margin-left: 100px;"> |
| | | <div class="col-sm-11"> |
| | | <div class="form-group"> |
| | | <div class="col-sm-10"> |
| | | <h1>打折活动奖励</h1> |
| | | <br/> |
| | | <br/> |
| | | 启用: <input |
| | | @if(isNotEmpty(item4) && item4.enable==2){ |
| | | checked="" |
| | | @} |
| | | type="checkbox" id="content5Check" class="js-switch2"> |
| | | <br/> |
| | | <br/> |
| | | 专车活动打折: |
| | | |
| | | <input type="text" |
| | | @if(isNotEmpty(item4)){ |
| | | value="${item4.special}" |
| | | @}else{ |
| | | value="" |
| | | @} |
| | | name="zc1" id="content5Num1" class="form-control newWidth" readonly/> |
| | | <br/> |
| | | <br/> |
| | | 出租车活动打折: |
| | | |
| | | <input type="text" |
| | | @if(isNotEmpty(item4)){ |
| | | value="${item4.taxi}" |
| | | @}else{ |
| | | value="" |
| | | @} |
| | | name="zc1" id="content5Num2" class="form-control newWidth" readonly/> |
| | | <br/> |
| | | <br/> |
| | | 小件物流活动打折: |
| | | <input type="text" |
| | | @if(isNotEmpty(item4)){ |
| | | value="${item4.logistics}" |
| | | @}else{ |
| | | value="" |
| | | @} |
| | | name="zc1" id="content5Num3" class="form-control newWidth" readonly /> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <!-- <td><input type="hidden" id="num9" name="num9" value="${obj.intercityCouponMoney}">${obj.intercityCouponMoney}</td>--> |
| | | <!-- <td><input type="hidden" id="num8" name="num8" value="${obj.intercityNum}">${obj.intercityNum}</td>--> |
| | | <!-- </tr>--> |
| | | <!-- @}--> |
| | | <!-- </tbody>--> |
| | | <!-- </table>--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- <div class="row" id="content5" style="margin-left: 100px;">--> |
| | | <!-- <div class="col-sm-11">--> |
| | | <!-- <div class="form-group">--> |
| | | <!-- <div class="col-sm-10">--> |
| | | <!-- <h1>打折活动奖励</h1>--> |
| | | <!-- <br/>--> |
| | | <!-- <br/>--> |
| | | <!-- 启用: <input--> |
| | | <!-- @if(isNotEmpty(item4) && item4.enable==2){--> |
| | | <!-- checked=""--> |
| | | <!-- @}--> |
| | | <!-- type="checkbox" id="content5Check" class="js-switch2">--> |
| | | <!-- <br/>--> |
| | | <!-- <br/>--> |
| | | <!-- 专车活动打折:--> |
| | | <!-- --> |
| | | <!-- <input type="text"--> |
| | | <!-- @if(isNotEmpty(item4)){--> |
| | | <!-- value="${item4.special}"--> |
| | | <!-- @}else{--> |
| | | <!-- value=""--> |
| | | <!-- @}--> |
| | | <!-- name="zc1" id="content5Num1" class="form-control newWidth" readonly/> --> |
| | | <!-- <br/>--> |
| | | <!-- <br/>--> |
| | | <!-- 出租车活动打折:--> |
| | | <!-- --> |
| | | <!-- <input type="text"--> |
| | | <!-- @if(isNotEmpty(item4)){--> |
| | | <!-- value="${item4.taxi}"--> |
| | | <!-- @}else{--> |
| | | <!-- value=""--> |
| | | <!-- @}--> |
| | | <!-- name="zc1" id="content5Num2" class="form-control newWidth" readonly/> --> |
| | | <!-- <br/>--> |
| | | <!-- <br/>--> |
| | | <!-- 小件物流活动打折:--> |
| | | <!-- <input type="text"--> |
| | | <!-- @if(isNotEmpty(item4)){--> |
| | | <!-- value="${item4.logistics}"--> |
| | | <!-- @}else{--> |
| | | <!-- value=""--> |
| | | <!-- @}--> |
| | | <!-- name="zc1" id="content5Num3" class="form-control newWidth" readonly /> --> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | |
| | | <div class="row" id="content6" style="margin-left: 100px;"> |
| | | <div class="col-sm-11"> |
| | | <div class="form-group"> |
| | | <div class="col-sm-10"> |
| | | <input type="hidden" |
| | | @if(isNotEmpty(item5)){ |
| | | value="${item5.redEnvelopeId}" |
| | | @}else{ |
| | | value="" |
| | | @} |
| | | id="content6RedId"> |
| | | <!-- <div class="row" id="content6" style="margin-left: 100px;">--> |
| | | <!-- <div class="col-sm-11">--> |
| | | <!-- <div class="form-group">--> |
| | | <!-- <div class="col-sm-10">--> |
| | | <!-- <input type="hidden"--> |
| | | <!-- @if(isNotEmpty(item5)){--> |
| | | <!-- value="${item5.redEnvelopeId}"--> |
| | | <!-- @}else{--> |
| | | <!-- value=""--> |
| | | <!-- @}--> |
| | | <!-- id="content6RedId">--> |
| | | |
| | | <h1>红包活动奖励</h1> |
| | | <br/> |
| | | <br/> |
| | | 启用: <input type="checkbox" |
| | | @if(isNotEmpty(item5) && item5.enable==2){ |
| | | checked="" |
| | | @} |
| | | id="content6Check" class="js-switch3"> |
| | | <br/> |
| | | <br/> |
| | | 红包类型: |
| | | |
| | | |
| | | <input type="text" |
| | | @if(isNotEmpty(item5Red)){ |
| | | value="${item5Red.type==1?'固定金额':'随机金额'}" |
| | | @}else{ |
| | | value="" |
| | | @} |
| | | name="zc1" id="content6Num1" class="form-control newWidth" readonly/> |
| | | <br/> |
| | | <br/> |
| | | 总金额: |
| | | |
| | | |
| | | <input type="text" |
| | | <!-- <h1>红包活动奖励</h1>--> |
| | | <!-- <br/>--> |
| | | <!-- <br/>--> |
| | | <!-- 启用: <input type="checkbox"--> |
| | | <!-- @if(isNotEmpty(item5) && item5.enable==2){--> |
| | | <!-- checked=""--> |
| | | <!-- @}--> |
| | | <!-- id="content6Check" class="js-switch3">--> |
| | | <!-- <br/>--> |
| | | <!-- <br/>--> |
| | | <!-- 红包类型:--> |
| | | <!-- --> |
| | | <!-- --> |
| | | <!-- <input type="text"--> |
| | | <!-- @if(isNotEmpty(item5Red)){--> |
| | | <!-- value="${item5Red.type==1?'固定金额':'随机金额'}"--> |
| | | <!-- @}else{--> |
| | | <!-- value=""--> |
| | | <!-- @}--> |
| | | <!-- name="zc1" id="content6Num1" class="form-control newWidth" readonly/> --> |
| | | <!-- <br/>--> |
| | | <!-- <br/>--> |
| | | <!-- 总金额:--> |
| | | <!-- --> |
| | | <!-- --> |
| | | <!-- <input type="text"--> |
| | | |
| | | @if(isNotEmpty(item5Red)){ |
| | | value="${item5Red.totalMoney}" |
| | | @}else{ |
| | | value="" |
| | | @} |
| | | name="zc1" id="content6Num2" class="form-control newWidth" readonly/> |
| | | <br/> |
| | | <br/> |
| | | 每个红包金额: <input type="text" |
| | | @if(isNotEmpty(item5Red)){ |
| | | value="${item5Red.type==1?item5Red.money:item5Red.startMoney+'-'+item5Red.endMoney}" |
| | | @}else{ |
| | | value="" |
| | | @} |
| | | name="zc1" id="content6Num3" class="form-control newWidth" readonly/> |
| | | <br/> |
| | | <br/> |
| | | 有效期: |
| | | |
| | | <input type="text" |
| | | <!-- @if(isNotEmpty(item5Red)){--> |
| | | <!-- value="${item5Red.totalMoney}"--> |
| | | <!-- @}else{--> |
| | | <!-- value=""--> |
| | | <!-- @}--> |
| | | <!-- name="zc1" id="content6Num2" class="form-control newWidth" readonly/> --> |
| | | <!-- <br/>--> |
| | | <!-- <br/>--> |
| | | <!-- 每个红包金额: <input type="text"--> |
| | | <!-- @if(isNotEmpty(item5Red)){--> |
| | | <!-- value="${item5Red.type==1?item5Red.money:item5Red.startMoney+'-'+item5Red.endMoney}"--> |
| | | <!-- @}else{--> |
| | | <!-- value=""--> |
| | | <!-- @}--> |
| | | <!-- name="zc1" id="content6Num3" class="form-control newWidth" readonly/> --> |
| | | <!-- <br/>--> |
| | | <!-- <br/>--> |
| | | <!-- 有效期:--> |
| | | <!-- --> |
| | | <!-- <input type="text"--> |
| | | |
| | | @if(isNotEmpty(item5Red)){ |
| | | value="${item5Red.effective}" |
| | | @}else{ |
| | | value="" |
| | | @} |
| | | name="zc1" id="content6Num4" class="form-control newWidth" readonly/> 天, |
| | | 最高金额: <input type="text" |
| | | @if(isNotEmpty(item5)){ |
| | | value="${item5.totalPrice}" |
| | | @}else{ |
| | | value="" |
| | | @} |
| | | name="zc1" id="content6Num5" class="form-control newWidth" readonly/> |
| | | <br/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <!-- @if(isNotEmpty(item5Red)){--> |
| | | <!-- value="${item5Red.effective}"--> |
| | | <!-- @}else{--> |
| | | <!-- value=""--> |
| | | <!-- @}--> |
| | | <!-- name="zc1" id="content6Num4" class="form-control newWidth" readonly/> 天,--> |
| | | <!-- 最高金额: <input type="text"--> |
| | | <!-- @if(isNotEmpty(item5)){--> |
| | | <!-- value="${item5.totalPrice}"--> |
| | | <!-- @}else{--> |
| | | <!-- value=""--> |
| | | <!-- @}--> |
| | | <!-- name="zc1" id="content6Num5" class="form-control newWidth" readonly/> --> |
| | | <!-- <br/>--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | </div> |
| | | </div> |
| | | |
| | |
| | | }); |
| | | function getContent(type){ |
| | | //设置点击字体颜色效果 |
| | | for(var i=1;i<7;i++){ |
| | | for(var i=1;i<4;i++){ |
| | | document.getElementById("div"+i).style.color="#888888";// |
| | | document.getElementById("div"+i).style.backgroundColor =""; |
| | | $("#content"+i).hide(); |
| | |
| | | document.getElementById("div"+type).style.backgroundColor ="rgb(26, 179, 148)"; |
| | | $("#type").val(type); |
| | | $("#content"+type).show(); |
| | | if(type!=6){ |
| | | if(type!=3){ |
| | | $("#ensure").hide(); |
| | | $("#nextB").show(); |
| | | }else{ |
| | |
| | | function nextContent(){ |
| | | var type = $("#type").val(); |
| | | getContent(parseInt(type)+1); |
| | | if(parseInt(type)+1==6){ |
| | | if(parseInt(type)+1==3){ |
| | | $("#ensure").show(); |
| | | $("#nextB").hide(); |
| | | } |
| | |
| | | <style> |
| | | .table1{ |
| | | display: inline; |
| | | width: 16.6666666%; |
| | | width: 33.33%; |
| | | float:left; |
| | | text-align:center; |
| | | border-collapse:collapse; |
| | |
| | | <div id="div1" class='table1' onclick="getContent(1)" style="border-right: 1px solid #333;background-color: rgb(26, 179, 148);color: white;">活动设置</div> |
| | | <div id="div2" class='table1' onclick="getContent(2)" style="border-right: 1px solid #333;">注册奖励</div> |
| | | <div id="div3" class='table1' onclick="getContent(3)" style="border-right: 1px solid #333;">邀请奖励</div> |
| | | <div id="div4" class='table1' onclick="getContent(4)" style="border-right: 1px solid #333;">充值赠送</div> |
| | | <div id="div5" class='table1' onclick="getContent(5)" style="border-right: 1px solid #333;">打折活动</div> |
| | | <div id="div6" class='table1' onclick="getContent(6)" style="border-right: 1px solid #333;">红包活动</div> |
| | | <!-- <div id="div4" class='table1' onclick="getContent(4)" style="border-right: 1px solid #333;">充值赠送</div>--> |
| | | <!-- <div id="div5" class='table1' onclick="getContent(5)" style="border-right: 1px solid #333;">打折活动</div>--> |
| | | <!-- <div id="div6" class='table1' onclick="getContent(6)" style="border-right: 1px solid #333;">红包活动</div>--> |
| | | </div> |
| | | <div class="row" id="content1" style="margin-left: 100px;"> |
| | | <div class="col-sm-11"> |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="row" id="content4" style="margin-left: 100px;"> |
| | | <div class="col-sm-11"> |
| | | <h1>充值赠送奖励</h1> |
| | | <br/> |
| | | <br/> |
| | | <!-- <div class="row" id="content4" style="margin-left: 100px;">--> |
| | | <!-- <div class="col-sm-11">--> |
| | | <!-- <h1>充值赠送奖励</h1>--> |
| | | <!-- <br/>--> |
| | | <!-- <br/>--> |
| | | |
| | | <div class="form-group"> |
| | | <div class="col-sm-10"> |
| | | <#button name="添加" icon="fa-plus" clickFun="UserActivityInfoDlg.toAddRegistOpt()"/> |
| | | 启用: |
| | | <input type="checkbox" |
| | | @if(isNotEmpty(balanceInfoList) && balanceInfoList[0].enable==2){ |
| | | checked="" |
| | | @} |
| | | id="content4Check" class="js-switch4"> |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <div class="col-sm-15"> |
| | | <div style="height: 200px; border: 1px solid #e5e6e7;overflow-y: auto;"> |
| | | <table class="table table-striped table-bordered table-hover table-condensed"> |
| | | <thead> |
| | | <tr> |
| | | <th style="width: 250px;">充值金额</th> |
| | | <th style="width: 250px;">有效天数</th> |
| | | <th style="width: 300px;">最高金额</th> |
| | | <th style="width: 300px;">通用券金额</th> |
| | | <th style="width: 300px;">通用券数量</th> |
| | | <th style="width: 300px;">专车券金额</th> |
| | | <th style="width: 300px;">专车券数量</th> |
| | | <th style="width: 400px;">出租车券金额</th> |
| | | <th style="width: 400px;">出租车券数量</th> |
| | | <th style="width: 300px;">城际金额</th> |
| | | <th style="width: 300px;">城际券数量</th> |
| | | <th style="width: 100px;">操作</th> |
| | | </tr> |
| | | </thead> |
| | | <tbody id="coun"> |
| | | @for(obj in balanceInfoList){ |
| | | <tr class="timeClass">' + |
| | | <td><input type="hidden" id="id1" name="id1" value="${obj.generalCouponId}"><input type="hidden" id="num1" name="num1" value="${obj.money}">${obj.money}</td> |
| | | <td><input type="hidden" id="id2" name="id2" value="${obj.specialCouponId}"><input type="hidden" id="num10" name="num10" value="${obj.effective}">${obj.effective}</td> |
| | | <td><input type="hidden" id="num11" name="num11" value="${obj.totalPrice}">${obj.totalPrice}</td> |
| | | <td><input type="hidden" id="id3" name="id3" value="${obj.taxiCouponId}"><input type="hidden" id="num3" name="num3" value="${obj.generalCouponMoney}">${obj.generalCouponMoney}</td> |
| | | <td><input type="hidden" id="id4" name="id4" value="${obj.intercityCouponId}"><input type="hidden" id="num2" name="num2" value="${obj.generalNum}">${obj.generalNum}</td> |
| | | <!-- <div class="form-group">--> |
| | | <!-- <div class="col-sm-10">--> |
| | | <!-- <#button name="添加" icon="fa-plus" clickFun="UserActivityInfoDlg.toAddRegistOpt()"/>--> |
| | | <!-- 启用: --> |
| | | <!-- <input type="checkbox"--> |
| | | <!-- @if(isNotEmpty(balanceInfoList) && balanceInfoList[0].enable==2){--> |
| | | <!-- checked=""--> |
| | | <!-- @}--> |
| | | <!-- id="content4Check" class="js-switch4">--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- <div class="form-group">--> |
| | | <!-- <div class="col-sm-15">--> |
| | | <!-- <div style="height: 200px; border: 1px solid #e5e6e7;overflow-y: auto;">--> |
| | | <!-- <table class="table table-striped table-bordered table-hover table-condensed">--> |
| | | <!-- <thead>--> |
| | | <!-- <tr>--> |
| | | <!-- <th style="width: 250px;">充值金额</th>--> |
| | | <!-- <th style="width: 250px;">有效天数</th>--> |
| | | <!-- <th style="width: 300px;">最高金额</th>--> |
| | | <!-- <th style="width: 300px;">通用券金额</th>--> |
| | | <!-- <th style="width: 300px;">通用券数量</th>--> |
| | | <!-- <th style="width: 300px;">专车券金额</th>--> |
| | | <!-- <th style="width: 300px;">专车券数量</th>--> |
| | | <!-- <th style="width: 400px;">出租车券金额</th>--> |
| | | <!-- <th style="width: 400px;">出租车券数量</th>--> |
| | | <!-- <th style="width: 300px;">城际金额</th>--> |
| | | <!-- <th style="width: 300px;">城际券数量</th>--> |
| | | <!-- <th style="width: 100px;">操作</th>--> |
| | | <!-- </tr>--> |
| | | <!-- </thead>--> |
| | | <!-- <tbody id="coun">--> |
| | | <!-- @for(obj in balanceInfoList){--> |
| | | <!-- <tr class="timeClass">' +--> |
| | | <!-- <td><input type="hidden" id="id1" name="id1" value="${obj.generalCouponId}"><input type="hidden" id="num1" name="num1" value="${obj.money}">${obj.money}</td>--> |
| | | <!-- <td><input type="hidden" id="id2" name="id2" value="${obj.specialCouponId}"><input type="hidden" id="num10" name="num10" value="${obj.effective}">${obj.effective}</td>--> |
| | | <!-- <td><input type="hidden" id="num11" name="num11" value="${obj.totalPrice}">${obj.totalPrice}</td>--> |
| | | <!-- <td><input type="hidden" id="id3" name="id3" value="${obj.taxiCouponId}"><input type="hidden" id="num3" name="num3" value="${obj.generalCouponMoney}">${obj.generalCouponMoney}</td>--> |
| | | <!-- <td><input type="hidden" id="id4" name="id4" value="${obj.intercityCouponId}"><input type="hidden" id="num2" name="num2" value="${obj.generalNum}">${obj.generalNum}</td>--> |
| | | |
| | | <td><input type="hidden" id="num5" name="num5" value="${obj.specialCouponMoney}">${obj.specialCouponMoney}</td> |
| | | <td><input type="hidden" id="num4" name="num4" value="${obj.specialNum}">${obj.specialNum}</td> |
| | | <!-- <td><input type="hidden" id="num5" name="num5" value="${obj.specialCouponMoney}">${obj.specialCouponMoney}</td>--> |
| | | <!-- <td><input type="hidden" id="num4" name="num4" value="${obj.specialNum}">${obj.specialNum}</td>--> |
| | | |
| | | <td><input type="hidden" id="num7" name="num7" value="${obj.taxiCouponMoney}">${obj.taxiCouponMoney}</td> |
| | | <td><input type="hidden" id="num6" name="num6" value="${obj.taxiNum}">${obj.taxiNum}</td> |
| | | <!-- <td><input type="hidden" id="num7" name="num7" value="${obj.taxiCouponMoney}">${obj.taxiCouponMoney}</td>--> |
| | | <!-- <td><input type="hidden" id="num6" name="num6" value="${obj.taxiNum}">${obj.taxiNum}</td>--> |
| | | |
| | | <td><input type="hidden" id="num9" name="num9" value="${obj.intercityCouponMoney}">${obj.intercityCouponMoney}</td> |
| | | <td><input type="hidden" id="num8" name="num8" value="${obj.intercityNum}">${obj.intercityNum}</td> |
| | | <td><button onclick="deleteSub(this)">移除</button></td> |
| | | </tr> |
| | | @} |
| | | </tbody> |
| | | </table> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="row" id="content5" style="margin-left: 100px;"> |
| | | <div class="col-sm-11"> |
| | | <div class="form-group"> |
| | | <div class="col-sm-10"> |
| | | <h1>打折活动奖励</h1> |
| | | <br/> |
| | | <br/> |
| | | 启用: <input |
| | | @if(isNotEmpty(item4) && item4.enable==2){ |
| | | checked="" |
| | | @} |
| | | type="checkbox" id="content5Check" class="js-switch2"> |
| | | <br/> |
| | | <br/> |
| | | 专车活动打折: |
| | | |
| | | <input type="text" |
| | | @if(isNotEmpty(item4)){ |
| | | value="${item4.special}" |
| | | @}else{ |
| | | value="" |
| | | @} |
| | | name="zc1" id="content5Num1" class="form-control newWidth" /> |
| | | <br/> |
| | | <br/> |
| | | 出租车活动打折: |
| | | |
| | | <input type="text" |
| | | @if(isNotEmpty(item4)){ |
| | | value="${item4.taxi}" |
| | | @}else{ |
| | | value="" |
| | | @} |
| | | name="zc1" id="content5Num2" class="form-control newWidth" /> |
| | | <br/> |
| | | <br/> |
| | | 小件物流活动打折: |
| | | <input type="text" |
| | | @if(isNotEmpty(item4)){ |
| | | value="${item4.logistics}" |
| | | @}else{ |
| | | value="" |
| | | @} |
| | | name="zc1" id="content5Num3" class="form-control newWidth" /> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <!-- <td><input type="hidden" id="num9" name="num9" value="${obj.intercityCouponMoney}">${obj.intercityCouponMoney}</td>--> |
| | | <!-- <td><input type="hidden" id="num8" name="num8" value="${obj.intercityNum}">${obj.intercityNum}</td>--> |
| | | <!-- <td><button onclick="deleteSub(this)">移除</button></td>--> |
| | | <!-- </tr>--> |
| | | <!-- @}--> |
| | | <!-- </tbody>--> |
| | | <!-- </table>--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- <div class="row" id="content5" style="margin-left: 100px;">--> |
| | | <!-- <div class="col-sm-11">--> |
| | | <!-- <div class="form-group">--> |
| | | <!-- <div class="col-sm-10">--> |
| | | <!-- <h1>打折活动奖励</h1>--> |
| | | <!-- <br/>--> |
| | | <!-- <br/>--> |
| | | <!-- 启用: <input--> |
| | | <!-- @if(isNotEmpty(item4) && item4.enable==2){--> |
| | | <!-- checked=""--> |
| | | <!-- @}--> |
| | | <!-- type="checkbox" id="content5Check" class="js-switch2">--> |
| | | <!-- <br/>--> |
| | | <!-- <br/>--> |
| | | <!-- 专车活动打折:--> |
| | | <!-- --> |
| | | <!-- <input type="text"--> |
| | | <!-- @if(isNotEmpty(item4)){--> |
| | | <!-- value="${item4.special}"--> |
| | | <!-- @}else{--> |
| | | <!-- value=""--> |
| | | <!-- @}--> |
| | | <!-- name="zc1" id="content5Num1" class="form-control newWidth" /> --> |
| | | <!-- <br/>--> |
| | | <!-- <br/>--> |
| | | <!-- 出租车活动打折:--> |
| | | <!-- --> |
| | | <!-- <input type="text"--> |
| | | <!-- @if(isNotEmpty(item4)){--> |
| | | <!-- value="${item4.taxi}"--> |
| | | <!-- @}else{--> |
| | | <!-- value=""--> |
| | | <!-- @}--> |
| | | <!-- name="zc1" id="content5Num2" class="form-control newWidth" /> --> |
| | | <!-- <br/>--> |
| | | <!-- <br/>--> |
| | | <!-- 小件物流活动打折:--> |
| | | <!-- <input type="text"--> |
| | | <!-- @if(isNotEmpty(item4)){--> |
| | | <!-- value="${item4.logistics}"--> |
| | | <!-- @}else{--> |
| | | <!-- value=""--> |
| | | <!-- @}--> |
| | | <!-- name="zc1" id="content5Num3" class="form-control newWidth" /> --> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | |
| | | <div class="row" id="content6" style="margin-left: 100px;"> |
| | | <div class="col-sm-11"> |
| | | <div class="form-group"> |
| | | <div class="col-sm-10"> |
| | | <input type="hidden" |
| | | @if(isNotEmpty(item5)){ |
| | | value="${item5.redEnvelopeId}" |
| | | @}else{ |
| | | value="" |
| | | @} |
| | | id="content6RedId"> |
| | | <!-- <div class="row" id="content6" style="margin-left: 100px;">--> |
| | | <!-- <div class="col-sm-11">--> |
| | | <!-- <div class="form-group">--> |
| | | <!-- <div class="col-sm-10">--> |
| | | <!-- <input type="hidden"--> |
| | | <!-- @if(isNotEmpty(item5)){--> |
| | | <!-- value="${item5.redEnvelopeId}"--> |
| | | <!-- @}else{--> |
| | | <!-- value=""--> |
| | | <!-- @}--> |
| | | <!-- id="content6RedId">--> |
| | | |
| | | <h1>红包活动奖励</h1> |
| | | <br/> |
| | | <br/> |
| | | 启用: <input type="checkbox" |
| | | @if(isNotEmpty(item5) && item5.enable==2){ |
| | | checked="" |
| | | @} |
| | | id="content6Check" class="js-switch3"> |
| | | <br/> |
| | | <br/> |
| | | <#button name="选择红包" icon="fa-plus" clickFun="UserActivityInfoDlg.toSelectRedOpt()"/> |
| | | <br/> |
| | | <br/> |
| | | 红包类型: |
| | | |
| | | |
| | | <input type="text" |
| | | @if(isNotEmpty(item5Red)){ |
| | | value="${item5Red.type==1?'固定金额':'随机金额'}" |
| | | @}else{ |
| | | value="" |
| | | @} |
| | | name="zc1" id="content6Num1" class="form-control newWidth" readonly/> |
| | | <br/> |
| | | <br/> |
| | | 总金额: |
| | | |
| | | |
| | | <input type="text" |
| | | <!-- <h1>红包活动奖励</h1>--> |
| | | <!-- <br/>--> |
| | | <!-- <br/>--> |
| | | <!-- 启用: <input type="checkbox"--> |
| | | <!-- @if(isNotEmpty(item5) && item5.enable==2){--> |
| | | <!-- checked=""--> |
| | | <!-- @}--> |
| | | <!-- id="content6Check" class="js-switch3">--> |
| | | <!-- <br/>--> |
| | | <!-- <br/>--> |
| | | <!-- <#button name="选择红包" icon="fa-plus" clickFun="UserActivityInfoDlg.toSelectRedOpt()"/>--> |
| | | <!-- <br/>--> |
| | | <!-- <br/>--> |
| | | <!-- 红包类型:--> |
| | | <!-- --> |
| | | <!-- --> |
| | | <!-- <input type="text"--> |
| | | <!-- @if(isNotEmpty(item5Red)){--> |
| | | <!-- value="${item5Red.type==1?'固定金额':'随机金额'}"--> |
| | | <!-- @}else{--> |
| | | <!-- value=""--> |
| | | <!-- @}--> |
| | | <!-- name="zc1" id="content6Num1" class="form-control newWidth" readonly/> --> |
| | | <!-- <br/>--> |
| | | <!-- <br/>--> |
| | | <!-- 总金额:--> |
| | | <!-- --> |
| | | <!-- --> |
| | | <!-- <input type="text"--> |
| | | |
| | | @if(isNotEmpty(item5Red)){ |
| | | value="${item5Red.totalMoney}" |
| | | @}else{ |
| | | value="" |
| | | @} |
| | | name="zc1" id="content6Num2" class="form-control newWidth" readonly/> |
| | | <br/> |
| | | <br/> |
| | | 每个红包金额: <input type="text" |
| | | @if(isNotEmpty(item5Red)){ |
| | | value="${item5Red.type==1?item5Red.money:item5Red.startMoney+'-'+item5Red.endMoney}" |
| | | @}else{ |
| | | value="" |
| | | @} |
| | | name="zc1" id="content6Num3" class="form-control newWidth" readonly/> |
| | | <br/> |
| | | <br/> |
| | | 有效期: |
| | | |
| | | <input type="text" |
| | | <!-- @if(isNotEmpty(item5Red)){--> |
| | | <!-- value="${item5Red.totalMoney}"--> |
| | | <!-- @}else{--> |
| | | <!-- value=""--> |
| | | <!-- @}--> |
| | | <!-- name="zc1" id="content6Num2" class="form-control newWidth" readonly/> --> |
| | | <!-- <br/>--> |
| | | <!-- <br/>--> |
| | | <!-- 每个红包金额: <input type="text"--> |
| | | <!-- @if(isNotEmpty(item5Red)){--> |
| | | <!-- value="${item5Red.type==1?item5Red.money:item5Red.startMoney+'-'+item5Red.endMoney}"--> |
| | | <!-- @}else{--> |
| | | <!-- value=""--> |
| | | <!-- @}--> |
| | | <!-- name="zc1" id="content6Num3" class="form-control newWidth" readonly/> --> |
| | | <!-- <br/>--> |
| | | <!-- <br/>--> |
| | | <!-- 有效期:--> |
| | | <!-- --> |
| | | <!-- <input type="text"--> |
| | | |
| | | @if(isNotEmpty(item5Red)){ |
| | | value="${item5Red.effective}" |
| | | @}else{ |
| | | value="" |
| | | @} |
| | | name="zc1" id="content6Num4" class="form-control newWidth" readonly/> 天 |
| | | 最高金额: <input type="text" |
| | | @if(isNotEmpty(item5)){ |
| | | value="${item5.totalPrice}" |
| | | @}else{ |
| | | value="" |
| | | @} |
| | | name="zc1" id="content6Num5" class="form-control newWidth" /> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <!-- @if(isNotEmpty(item5Red)){--> |
| | | <!-- value="${item5Red.effective}"--> |
| | | <!-- @}else{--> |
| | | <!-- value=""--> |
| | | <!-- @}--> |
| | | <!-- name="zc1" id="content6Num4" class="form-control newWidth" readonly/> 天--> |
| | | <!-- 最高金额: <input type="text"--> |
| | | <!-- @if(isNotEmpty(item5)){--> |
| | | <!-- value="${item5.totalPrice}"--> |
| | | <!-- @}else{--> |
| | | <!-- value=""--> |
| | | <!-- @}--> |
| | | <!-- name="zc1" id="content6Num5" class="form-control newWidth" /> --> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | </div> |
| | | </div> |
| | | |
| | |
| | | var elem1 = document.querySelector('.js-switch1'); |
| | | var switchery1 = new Switchery(elem1,{size:"large"}); |
| | | var elem2 = document.querySelector('.js-switch2'); |
| | | var switchery2 = new Switchery(elem2,{size:"large"}); |
| | | var elem3 = document.querySelector('.js-switch3'); |
| | | var switchery3 = new Switchery(elem3,{size:"large"}); |
| | | var elem4 = document.querySelector('.js-switch4'); |
| | | var switchery4 = new Switchery(elem4,{size:"large"}); |
| | | // var switchery2 = new Switchery(elem2,{size:"large"}); |
| | | // var elem3 = document.querySelector('.js-switch3'); |
| | | // var switchery3 = new Switchery(elem3,{size:"large"}); |
| | | // var elem4 = document.querySelector('.js-switch4'); |
| | | // var switchery4 = new Switchery(elem4,{size:"large"}); |
| | | |
| | | laydate.render({ |
| | | elem: '#startTime' |
| | |
| | | }); |
| | | function getContent(type){ |
| | | //设置点击字体颜色效果 |
| | | for(var i=1;i<7;i++){ |
| | | for(var i=1;i<4;i++){ |
| | | document.getElementById("div"+i).style.color="#888888";// |
| | | document.getElementById("div"+i).style.backgroundColor =""; |
| | | $("#content"+i).hide(); |
| | |
| | | document.getElementById("div"+type).style.backgroundColor ="rgb(26, 179, 148)"; |
| | | $("#type").val(type); |
| | | $("#content"+type).show(); |
| | | if(type!=6){ |
| | | if(type!=3){ |
| | | $("#ensure").hide(); |
| | | $("#nextB").show(); |
| | | }else{ |
| | |
| | | function nextContent(){ |
| | | var type = $("#type").val(); |
| | | getContent(parseInt(type)+1); |
| | | if(parseInt(type)+1==6){ |
| | | if(parseInt(type)+1==3){ |
| | | $("#ensure").show(); |
| | | $("#nextB").hide(); |
| | | } |
New file |
| | |
| | | /** |
| | | * 用户管理管理初始化 |
| | | */ |
| | | var TUser = { |
| | | id: "TUserTable", //表格id |
| | | seItem: null, //选中的条目 |
| | | table: null, |
| | | layerIndex: -1 |
| | | }; |
| | | |
| | | /** |
| | | * 鼠标悬停提示框 class .toolTip 为无效样式,作用于个别选择器使用 |
| | | */ |
| | | TUser.tooltip = function(){ |
| | | $(".toolTip").tooltip(); |
| | | }; |
| | | |
| | | /** |
| | | * 初始化表格的列 |
| | | */ |
| | | TUser.initColumn = function () { |
| | | return [ |
| | | {field: 'selectItem', radio: true}, |
| | | {title: '邀请人', field: 'inviteUserName', visible: false, align: 'center', valign: 'middle',width:'8%'}, |
| | | {title: '被邀请用户', field: 'nickName', visible: true, align: 'center', valign: 'middle',width:'8%'}, |
| | | {title: '被邀请用户手机号', field: 'phone', visible: true, align: 'center', valign: 'middle',width:'8%'}, |
| | | {title: '被邀请用户ID', field: 'userId', visible: true, align: 'center', valign: 'middle',width:'8%'}, |
| | | {title: '注册时间', field: 'registerTime', visible: true, align: 'center', valign: 'middle',width:'10%', |
| | | formatter: function (value, row) { |
| | | var btn = ""; |
| | | if(row.insertTime != '' && row.insertTime != null) { |
| | | var time = row.insertTime.replace(" ",'<br>'); |
| | | btn = ['<p class="toolTip" style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;" title="' + row.registerTime + '" onfocus="TUser.tooltip()">' + time + '</p>'] |
| | | } |
| | | return btn; |
| | | } |
| | | }, |
| | | ]; |
| | | }; |
| | | |
| | | /** |
| | | * 检查是否选中 |
| | | */ |
| | | TUser.check = function () { |
| | | var selected = $('#' + this.id).bootstrapTable('getSelections'); |
| | | if(selected.length == 0){ |
| | | Feng.info("请先选中表格中的某一记录!"); |
| | | return false; |
| | | }else{ |
| | | TUser.seItem = selected[0]; |
| | | return true; |
| | | } |
| | | }; |
| | | |
| | | /** |
| | | * 查询用户管理列表 |
| | | */ |
| | | TUser.search = function () { |
| | | var queryData = {}; |
| | | queryData['time'] = $("#time").val(); |
| | | queryData['uid'] = $("#id").val(); |
| | | queryData['userName'] = $("#userName").val(); |
| | | TUser.table.refresh({query: queryData}); |
| | | }; |
| | | TUser.resetSearch = function () { |
| | | $("#time").val(""); |
| | | $("#userName").val(""); |
| | | TUser.search(); |
| | | }; |
| | | $(function () { |
| | | var defaultColunms = TUser.initColumn(); |
| | | var table = new BSTable(TUser.id, "/tDriver/inviteList", defaultColunms); |
| | | // 设置物理分页server(逻辑分页client) |
| | | table.setPaginationType("server"); |
| | | TUser.table = table.init(); |
| | | TUser.search(); |
| | | }); |
| | |
| | | } |
| | | }, |
| | | {title: '评分', field: 'fraction', visible: true, align: 'center', valign: 'middle',width:'8%'}, |
| | | |
| | | {title: '邀请次数', field: 'inviteNumber', visible: true, align: 'center', valign: 'middle',width:'5%', |
| | | formatter: function (value, row) { |
| | | var temp = row.id |
| | | var btn = ""; |
| | | if(row.inviteNumber != '' && row.inviteNumber != null) { |
| | | btn = ['<p class="toolTip" style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;color: #00b7ee" title="' + row.inviteNumber + '" onfocus="TUser.tooltip()" onclick="YesDriver.inviteList('+temp+')">' + row.inviteNumber + '</p>'] |
| | | }else { |
| | | btn = ['<p class="toolTip" style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;color: #00b7ee" title="0" onfocus="TUser.tooltip()" onclick="YesDriver.inviteList('+temp+')">0</p>'] |
| | | } |
| | | return btn; |
| | | } |
| | | }, |
| | | {title: '历史<br/>接单数', field: 'historyNum', visible: true, align: 'center', valign: 'middle',width:'7%', |
| | | formatter: function (value, row) { |
| | | var btn = ""; |
| | |
| | | } |
| | | ]; |
| | | }; |
| | | |
| | | YesDriver.inviteList = function (id) { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: '邀请明细', |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tDriver/invite/'+ id |
| | | }); |
| | | this.layerIndex = index; |
| | | }; |
| | | /** |
| | | * 余额修改 |
| | | */ |
| | |
| | | return btn; |
| | | } |
| | | }, |
| | | {title: '邀请次数', field: 'inviteNumber', visible: true, align: 'center', valign: 'middle',width:'5%', |
| | | formatter: function (value, row) { |
| | | var temp = row.id |
| | | var btn = ""; |
| | | if(row.inviteNumber != '' && row.inviteNumber != null) { |
| | | btn = ['<p class="toolTip" style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;color: #00b7ee" title="' + row.inviteNumber + '" onfocus="TUser.tooltip()" onclick="TUser.inviteList('+temp+')">' + row.inviteNumber + '</p>'] |
| | | }else { |
| | | btn = ['<p class="toolTip" style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;color: #00b7ee" title="0" onfocus="TUser.tooltip()" onclick="TUser.inviteList('+temp+')">0</p>'] |
| | | } |
| | | return btn; |
| | | } |
| | | }, |
| | | {title: '备注', field: 'remark', visible: true, align: 'center', valign: 'middle',width:'10%', |
| | | formatter: function (value, row) { |
| | | var btn = ""; |
| | |
| | | } |
| | | }; |
| | | /** |
| | | * 邀请明细 |
| | | */ |
| | | TUser.inviteList = function (id) { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: '邀请明细', |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tUser/invite/'+ id |
| | | }); |
| | | this.layerIndex = index; |
| | | }; |
| | | /** |
| | | * 修改密码 |
| | | */ |
| | | TUser.updatePassword = function () { |
New file |
| | |
| | | /** |
| | | * 用户管理管理初始化 |
| | | */ |
| | | var TUser = { |
| | | id: "TUserTable", //表格id |
| | | seItem: null, //选中的条目 |
| | | table: null, |
| | | layerIndex: -1 |
| | | }; |
| | | |
| | | /** |
| | | * 鼠标悬停提示框 class .toolTip 为无效样式,作用于个别选择器使用 |
| | | */ |
| | | TUser.tooltip = function(){ |
| | | $(".toolTip").tooltip(); |
| | | }; |
| | | |
| | | /** |
| | | * 初始化表格的列 |
| | | */ |
| | | TUser.initColumn = function () { |
| | | return [ |
| | | {field: 'selectItem', radio: true}, |
| | | {title: '邀请人', field: 'inviteUserName', visible: false, align: 'center', valign: 'middle',width:'8%'}, |
| | | {title: '被邀请用户', field: 'nickName', visible: true, align: 'center', valign: 'middle',width:'8%'}, |
| | | {title: '被邀请用户手机号', field: 'phone', visible: true, align: 'center', valign: 'middle',width:'8%'}, |
| | | {title: '被邀请用户ID', field: 'userId', visible: true, align: 'center', valign: 'middle',width:'8%'}, |
| | | {title: '注册时间', field: 'registerTime', visible: true, align: 'center', valign: 'middle',width:'10%', |
| | | formatter: function (value, row) { |
| | | var btn = ""; |
| | | if(row.insertTime != '' && row.insertTime != null) { |
| | | var time = row.insertTime.replace(" ",'<br>'); |
| | | btn = ['<p class="toolTip" style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;" title="' + row.registerTime + '" onfocus="TUser.tooltip()">' + time + '</p>'] |
| | | } |
| | | return btn; |
| | | } |
| | | }, |
| | | ]; |
| | | }; |
| | | |
| | | /** |
| | | * 检查是否选中 |
| | | */ |
| | | TUser.check = function () { |
| | | var selected = $('#' + this.id).bootstrapTable('getSelections'); |
| | | if(selected.length == 0){ |
| | | Feng.info("请先选中表格中的某一记录!"); |
| | | return false; |
| | | }else{ |
| | | TUser.seItem = selected[0]; |
| | | return true; |
| | | } |
| | | }; |
| | | |
| | | /** |
| | | * 查询用户管理列表 |
| | | */ |
| | | TUser.search = function () { |
| | | var queryData = {}; |
| | | queryData['time'] = $("#time").val(); |
| | | queryData['uid'] = $("#id").val(); |
| | | queryData['userName'] = $("#userName").val(); |
| | | TUser.table.refresh({query: queryData}); |
| | | }; |
| | | TUser.resetSearch = function () { |
| | | $("#time").val(""); |
| | | $("#userName").val(""); |
| | | TUser.search(); |
| | | }; |
| | | $(function () { |
| | | var defaultColunms = TUser.initColumn(); |
| | | var table = new BSTable(TUser.id, "/tUser/inviteList", defaultColunms); |
| | | // 设置物理分页server(逻辑分页client) |
| | | table.setPaginationType("server"); |
| | | TUser.table = table.init(); |
| | | TUser.search(); |
| | | }); |
| | |
| | | var content6RedId = $("#content6RedId").val(); |
| | | var elem1 = document.querySelector('.js-switch'); |
| | | var elem2 = document.querySelector('.js-switch1'); |
| | | var elem4 = document.querySelector('.js-switch2'); |
| | | var elem5 = document.querySelector('.js-switch3'); |
| | | var elem3 = document.querySelector('.js-switch4'); |
| | | // var elem4 = document.querySelector('.js-switch2'); |
| | | // var elem5 = document.querySelector('.js-switch3'); |
| | | // var elem3 = document.querySelector('.js-switch4'); |
| | | console.log(JSON.stringify(subArr)) |
| | | //提交信息 |
| | | var ajax = new $ax(Feng.ctxPath + "/userActivity/add", function(data){ |
| | |
| | | ajax.set("inviteNumber",$("#content3Num6").val()); |
| | | ajax.set("inviteEffective",$("#content3Num5").val()); |
| | | ajax.set("invitationPrice",$("#content3Num7").val()); |
| | | ajax.set("balanceEnable",elem3.checked==true?2:1); |
| | | // ajax.set("balanceEnable",elem3.checked==true?2:1); |
| | | ajax.set("balanceInfo",JSON.stringify(subArr)); |
| | | ajax.set("discountEnable",elem4.checked==true?2:1); |
| | | // ajax.set("discountEnable",elem4.checked==true?2:1); |
| | | ajax.set("discountSpecial",content5Num1); |
| | | ajax.set("discountTaxi",content5Num2); |
| | | ajax.set("discountLogistics",content5Num3); |
| | | ajax.set("redenvelopeId",$("#content6RedId").val()); |
| | | ajax.set("redenvelopeEnable",elem5.checked==true?2:1); |
| | | // ajax.set("redenvelopeEnable",elem5.checked==true?2:1); |
| | | ajax.set('redPrice', $('#content6Num5').val()); |
| | | ajax.start(); |
| | | } |
| | |
| | | |
| | | <dependencies> |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-test</artifactId> |
| | | <scope>test</scope> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springframework.cloud</groupId> |
| | | <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId> |
| | | </dependency> |
| | |
| | | package com.stylefeng.guns.modular.api; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | | import com.stylefeng.guns.core.common.constant.JwtConstants; |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | import com.stylefeng.guns.modular.system.model.Invite; |
| | | import com.stylefeng.guns.modular.system.model.UserInfo; |
| | | import com.stylefeng.guns.modular.system.service.IInviteService; |
| | | import com.stylefeng.guns.modular.system.service.ISmsrecordService; |
| | | import com.stylefeng.guns.modular.system.service.IUserInfoService; |
| | | import com.stylefeng.guns.modular.system.service.IVerifiedService; |
| | |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.util.StringUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | |
| | | |
| | | @Autowired |
| | | private WeChatUtil weChatUtil; |
| | | @Autowired |
| | | private IInviteService inviteService; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取用户邀请二维码 |
| | | * @param request |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/api/user/getCode") |
| | | @ApiOperation(value = "获取用户邀请二维码", tags = {"用户端-2.0新增"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil<String> getCode(HttpServletRequest request){ |
| | | try { |
| | | Integer uid = userInfoService.getUserIdFormRedis(request); |
| | | if(null == uid){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | UserInfo userInfo = userInfoService.selectById(uid); |
| | | if (userInfo.getCode()==null){ |
| | | userInfo = userInfoService.generateCode(userInfo); |
| | | } |
| | | return ResultUtil.success(userInfo.getCode()); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | /** |
| | | * 获取用户邀请二维码 |
| | | * @param request |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/api/user/inviteList") |
| | | @ApiOperation(value = "获取用户邀请记录", tags = {"用户端-2.0新增"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "开始时间 yyyy-MM-dd", name = "startTime", required = false, dataType = "String"), |
| | | @ApiImplicitParam(value = "结束时间 yyyy-MM-dd", name = "endTime", required = false, dataType = "String"), |
| | | @ApiImplicitParam(value = "页码(首页1)", name = "pageNum", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "页条数", name = "size", required = true, dataType = "int"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil inviteList(String startTime,String endTime,Integer pageNum,Integer size,HttpServletRequest request){ |
| | | try { |
| | | Integer uid = userInfoService.getUserIdFormRedis(request); |
| | | if(null == uid){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | if (StringUtils.hasLength(startTime)){ |
| | | startTime = startTime + " 00:00:00"; |
| | | endTime = endTime + " 23:59:59"; |
| | | } |
| | | List<Invite> invites = inviteService.inviteList(uid,startTime,endTime,pageNum,size); |
| | | return ResultUtil.success(invites); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | |
| | | @ApiImplicitParam(value = "手机号码", name = "phone", required = true, dataType = "String"), |
| | | @ApiImplicitParam(value = "短信验证码", name = "code", required = true, dataType = "String"), |
| | | @ApiImplicitParam(value = "ip地址", name = "registIp", required = false, dataType = "String"), |
| | | @ApiImplicitParam(value = "分享人用户id-扫码分享传 ", name = "uid", required = false, dataType = "int"), |
| | | @ApiImplicitParam(value = "分享人类型1用户2司机-扫码分享传 ", name = "userType", required = false, dataType = "int"), |
| | | @ApiImplicitParam(value = "登录端口-小程序传Applets", name = "loginType", required = false, dataType = "String"), |
| | | @ApiImplicitParam(value = "当前定位区县行政编号", name = "registAreaCode", required = false, dataType = "String") |
| | | }) |
| | | public ResultUtil<LoginWarpper> captchaLogin(String phone, String code, String registIp, String registAreaCode,String loginType){ |
| | | public ResultUtil<LoginWarpper> captchaLogin(String phone, String code, String registIp, String registAreaCode,String loginType |
| | | ,Integer uid,Integer userType){ |
| | | try { |
| | | return userInfoService.captchaLogin(phone, code, registIp, registAreaCode,loginType); |
| | | return userInfoService.captchaLogin(phone, code, registIp, registAreaCode,loginType,uid,userType); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "登录端口(1:APP,2:小程序)", name = "type", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "微信openid(APP登录上传)", name = "openid", required = false, dataType = "String"), |
| | | @ApiImplicitParam(value = "分享人用户id-扫码分享传 ", name = "uid", required = false, dataType = "int"), |
| | | @ApiImplicitParam(value = "分享人类型1用户2司机-扫码分享传 ", name = "userType", required = false, dataType = "int"), |
| | | @ApiImplicitParam(value = "微信unionid(APP登录上传)", name = "unionid", required = false, dataType = "String"), |
| | | @ApiImplicitParam(value = "微信jscode(小程序登录上传)", name = "jscode", required = false, dataType = "String"), |
| | | @ApiImplicitParam(value = "ip地址", name = "registIp", required = false, dataType = "String"), |
| | |
| | | @ApiImplicitParam(value = "登录端口-小程序传Applets", name = "loginType", required = false, dataType = "String"), |
| | | @ApiImplicitParam(value = "性别(1=男,2=女)", name = "sex", required = false, dataType = "int") |
| | | }) |
| | | public ResultUtil<LoginWarpper> wxLogin(Integer type, String openid, String unionid, String jscode, String registIp, String registAreaCode, Integer sex, String nickName, String avatar,String loginType){ |
| | | public ResultUtil<LoginWarpper> wxLogin(Integer type, String openid, String unionid, String jscode, String registIp, String registAreaCode, Integer sex, String nickName, String avatar,String loginType |
| | | ,Integer uid,Integer userType){ |
| | | try { |
| | | return userInfoService.wxLogin(type, openid, unionid, jscode, registIp, registAreaCode, sex, nickName, avatar,loginType); |
| | | return userInfoService.wxLogin(type, openid, unionid, jscode, registIp, registAreaCode, sex, nickName, avatar,loginType,uid,userType); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.dao; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.stylefeng.guns.modular.system.model.Advertisement; |
| | | import com.stylefeng.guns.modular.system.model.Invite; |
| | | import com.stylefeng.guns.modular.system.warpper.AdvertisementWarpper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface InviteMapper extends BaseMapper<Invite> { |
| | | |
| | | |
| | | List<Invite> inviteList(@Param("uid")Integer uid,@Param("uid") String startTime, @Param("uid")String endTime, |
| | | @Param("pageNum")Integer pageNum, @Param("size")Integer size); |
| | | } |
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.InviteMapper"> |
| | | |
| | | |
| | | <select id="inviteList" resultType="com.stylefeng.guns.modular.system.model.Invite"> |
| | | select t1.*,t2.phone,t2.avatar from t_invite t1 |
| | | left join t_user t2 on t2.id = t1.userId |
| | | where 1=1 |
| | | <if test="null != uid"> |
| | | and t1.inviteUserId = #{uid} |
| | | </if> |
| | | <if test="null != startTime and null != endTime"> |
| | | and t1.registerTime between #{startTime} and #{endTime} |
| | | </if> |
| | | order by t1.registerTime desc |
| | | limit #{pageNum}, #{size} |
| | | </select> |
| | | </mapper> |
| | |
| | | avatar as avatar, |
| | | birthday as birthday, |
| | | sex as sex, |
| | | code as code, |
| | | emergencyContact as emergencyContact, |
| | | emergencyContactNumber as emergencyContactNumber, |
| | | isAuth as isAuth, |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.model; |
| | | |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.io.*; |
| | | |
| | | public class CustomMultipartFile implements MultipartFile { |
| | | private final byte[] content; |
| | | private final String name; |
| | | private final String originalFilename; |
| | | private final String contentType; |
| | | |
| | | public CustomMultipartFile(byte[] content, String name, String contentType) { |
| | | this.content = content; |
| | | this.name = name; |
| | | this.originalFilename = name; |
| | | this.contentType = contentType; |
| | | } |
| | | |
| | | @Override |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | @Override |
| | | public String getOriginalFilename() { |
| | | return originalFilename; |
| | | } |
| | | |
| | | @Override |
| | | public String getContentType() { |
| | | return contentType; |
| | | } |
| | | |
| | | @Override |
| | | public boolean isEmpty() { |
| | | return content.length == 0; |
| | | } |
| | | |
| | | @Override |
| | | public long getSize() { |
| | | return content.length; |
| | | } |
| | | |
| | | @Override |
| | | public byte[] getBytes() throws IOException { |
| | | return content; |
| | | } |
| | | |
| | | @Override |
| | | public InputStream getInputStream() throws IOException { |
| | | return new ByteArrayInputStream(content); |
| | | } |
| | | |
| | | @Override |
| | | public void transferTo(File dest) throws IOException, IllegalStateException { |
| | | try (FileOutputStream fos = new FileOutputStream(dest)) { |
| | | fos.write(content); |
| | | } |
| | | } |
| | | } |
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 io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 平台协议 |
| | | */ |
| | | @TableName("t_invite") |
| | | @Data |
| | | public class Invite{ |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | @TableField("id") |
| | | private Integer id; |
| | | // 邀请人id |
| | | @TableField("inviteUserId") |
| | | private Integer inviteUserId; |
| | | // 被邀请人id |
| | | @TableField("userId") |
| | | private Integer userId; |
| | | /** |
| | | * 添加时间 |
| | | */ |
| | | @TableField("registerTime") |
| | | @ApiModelProperty("注册时间") |
| | | private Date registerTime; |
| | | /** |
| | | * 使用范围(1=用户,2=司机) |
| | | */ |
| | | @TableField("useType") |
| | | private Integer useType; |
| | | |
| | | @TableField(exist = false) |
| | | @ApiModelProperty("头像") |
| | | private String avatar; |
| | | |
| | | @ApiModelProperty("手机号") |
| | | @TableField(exist = false) |
| | | private String phone; |
| | | } |
| | |
| | | @TableField("remark") |
| | | private String remark; |
| | | /** |
| | | * 邀请码 |
| | | * @return |
| | | */ |
| | | @TableField("code") |
| | | private String code; |
| | | /** |
| | | * 状态(1=正常,2=冻结) |
| | | * @return |
| | | */ |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.stylefeng.guns.modular.system.model.Invite; |
| | | import com.stylefeng.guns.modular.system.model.UserInfo; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | | import com.stylefeng.guns.modular.system.warpper.LoginWarpper; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | public interface IInviteService extends IService<Invite> { |
| | | |
| | | List<Invite> inviteList(Integer uid, String startTime, String endTime, Integer pageNum, Integer size); |
| | | } |
| | |
| | | * @param code |
| | | * @return |
| | | */ |
| | | ResultUtil<LoginWarpper> captchaLogin(String phone, String code, String registIp, String registAreaCode,String loginType) throws Exception; |
| | | ResultUtil<LoginWarpper> captchaLogin(String phone, String code, String registIp, String registAreaCode,String loginType |
| | | ,Integer uid,Integer userType) throws Exception; |
| | | |
| | | /** |
| | | * 手机一键登录 |
| | |
| | | * @param registAreaCode 当前定位区县行政编号(6位) |
| | | * @return |
| | | */ |
| | | ResultUtil<LoginWarpper> wxLogin(Integer type, String openid, String unionid, String jscode, String registIp, String registAreaCode, Integer sex, String nickName, String avatar,String loginType) throws Exception; |
| | | ResultUtil<LoginWarpper> wxLogin(Integer type, String openid, String unionid, String jscode, String registIp, String registAreaCode, Integer sex, String nickName, String avatar,String loginType |
| | | ,Integer uid ,Integer userType |
| | | ) throws Exception; |
| | | |
| | | |
| | | /** |
| | |
| | | * @throws Exception |
| | | */ |
| | | ResultUtil phoneLoginBindingWeChat(Integer userId, String jscode) throws Exception; |
| | | |
| | | UserInfo generateCode(UserInfo userInfo); |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.stylefeng.guns.modular.system.dao.AdvertisementMapper; |
| | | import com.stylefeng.guns.modular.system.dao.InviteMapper; |
| | | import com.stylefeng.guns.modular.system.model.Advertisement; |
| | | import com.stylefeng.guns.modular.system.model.Invite; |
| | | import com.stylefeng.guns.modular.system.service.IAdvertisementService; |
| | | import com.stylefeng.guns.modular.system.service.IInviteService; |
| | | import com.stylefeng.guns.modular.system.warpper.AdvertisementWarpper; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | |
| | | @Service |
| | | public class InviteServiceImpl extends ServiceImpl<InviteMapper, Invite> implements IInviteService { |
| | | |
| | | |
| | | @Override |
| | | public List<Invite> inviteList(Integer uid, String startTime, String endTime, Integer pageNum, Integer size) { |
| | | return this.baseMapper.inviteList(uid,startTime,endTime,pageNum,size); |
| | | } |
| | | } |
| | |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.alipay.api.internal.util.codec.Base64; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.stylefeng.guns.core.common.constant.JwtConstants; |
| | |
| | | import org.apache.shiro.util.ByteSource; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.http.HttpEntity; |
| | | import org.springframework.http.HttpMethod; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.LinkedMultiValueMap; |
| | | import org.springframework.util.MultiValueMap; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | import org.springframework.web.client.RestTemplate; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.io.*; |
| | | import java.math.BigDecimal; |
| | | import java.security.SecureRandom; |
| | | import java.util.*; |
| | | |
| | | |
| | |
| | | |
| | | @Resource |
| | | private DriverMapper driverMapper; |
| | | @Autowired |
| | | private RestTemplate restTemplate; |
| | | @Resource |
| | | private InviteMapper inviteMapper; |
| | | |
| | | @Resource |
| | | private DriverActivityRegisteredMapper driverActivityRegisteredMapper; |
| | |
| | | * @return |
| | | */ |
| | | @Override |
| | | public ResultUtil<LoginWarpper> captchaLogin(String phone, String code, String registIp, String registAreaCode,String loginType) throws Exception { |
| | | public ResultUtil<LoginWarpper> captchaLogin(String phone, String code, String registIp, String registAreaCode,String loginType |
| | | ,Integer uid,Integer userType |
| | | ) throws Exception { |
| | | boolean b = this.checkCaptcha(phone, code); |
| | | if(!b){ |
| | | return ResultUtil.error("验证码无效"); |
| | |
| | | userInfo.setRegistAreaCode(registAreaCode); |
| | | } |
| | | this.insert(userInfo); |
| | | |
| | | this.addCoupon(userInfo);//添加优惠券 |
| | | |
| | | UserInfo finalUserInfo = userInfo; |
| | |
| | | } |
| | | } |
| | | }).start(); |
| | | |
| | | if (uid!=null&&userType!=null){ |
| | | // 生成邀请记录 |
| | | Invite invite = new Invite(); |
| | | invite.setInviteUserId(uid); |
| | | invite.setUserId(userInfo.getId()); |
| | | invite.setRegisterTime(new Date()); |
| | | invite.setUseType(userType); |
| | | inviteMapper.insert(invite); |
| | | if (userType==1){ |
| | | // 只有用户邀请用户会获得优惠券 |
| | | List<Map<String, Object>> query = userActivityInviteMapper.query(userInfo.getCompanyId()); |
| | | Date date = new Date(); |
| | | for(Map<String, Object> map : query){ |
| | | Double lavePrice = Double.valueOf(map.get("lavePrice").toString()); |
| | | for(int i = Integer.valueOf(String.valueOf(map.get("totalNum"))); i > 0; i--){ |
| | | //判断当前优惠券金额是否大于可发放剩余总金额 |
| | | if(Double.valueOf(String.valueOf(map.get("money"))).compareTo(lavePrice) > 0){ |
| | | break; |
| | | } |
| | | UserCouponRecord userCouponRecord = new UserCouponRecord(); |
| | | userCouponRecord.setActivityType(3); |
| | | userCouponRecord.setCouponActivityId(Integer.valueOf(String.valueOf(map.get("id")))); |
| | | userCouponRecord.setCouponId(Integer.valueOf(String.valueOf(map.get("couponId")))); |
| | | userCouponRecord.setState(1); |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.setTime(date); |
| | | calendar.set(Calendar.DAY_OF_MONTH, calendar.get(Calendar.DAY_OF_MONTH) + Integer.valueOf(String.valueOf(map.get("effective")))); |
| | | userCouponRecord.setExpirationTime(calendar.getTime()); |
| | | userCouponRecord.setCouponType(Integer.valueOf(String.valueOf(map.get("couponType")))); |
| | | userCouponRecord.setCouponUseType(Integer.valueOf(String.valueOf(map.get("couponUseType")))); |
| | | userCouponRecord.setInsertTime(date); |
| | | userCouponRecord.setFullMoney(Double.valueOf(String.valueOf(map.get("fullMoney")))); |
| | | userCouponRecord.setMoney(Double.valueOf(String.valueOf(map.get("money")))); |
| | | userCouponRecord.setCompanyId(userInfo.getCompanyId()); |
| | | userCouponRecord.setUserId(uid); |
| | | userCouponRecordService.insert(userCouponRecord); |
| | | //修改剩余可发放总金额 |
| | | lavePrice -= Double.valueOf(String.valueOf(map.get("money"))); |
| | | } |
| | | UserActivityInvite uai = userActivityInviteMapper.selectById(Integer.valueOf(map.get("id").toString())); |
| | | uai.setLavePrice(new BigDecimal(lavePrice).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | userActivityInviteMapper.updateById(uai); |
| | | } |
| | | } |
| | | } |
| | | this.addCoupon(userInfo);//添加优惠券 |
| | | } |
| | | if(userInfo.getState() == 2){ |
| | | return ResultUtil.error("账号被冻结"); |
| | | } |
| | | |
| | | |
| | | //调用单点登录的逻辑 |
| | | this.singlePointLogin(userInfo.getId(),loginType); |
| | |
| | | } |
| | | @Override |
| | | public synchronized ResultUtil<LoginWarpper> captchaLogin(String phone, String code, Integer uid, Integer type, Integer userType,String loginType) throws Exception { |
| | | ResultUtil<LoginWarpper> resultUtil = this.captchaLogin(phone, code, null, null,loginType); |
| | | ResultUtil<LoginWarpper> resultUtil = this.captchaLogin(phone, code, null, null,loginType,null,null); |
| | | if(resultUtil.getCode() == 200 && null != uid){ |
| | | if(type == 2){//司机分享 |
| | | Driver driver = driverMapper.selectById(uid); |
| | |
| | | */ |
| | | @Override |
| | | public ResultUtil<LoginWarpper> wxLogin(Integer type, String openid, String unionid, String jscode, String registIp, |
| | | String registAreaCode, Integer sex, String nickName, String avatar,String loginType) throws Exception { |
| | | String registAreaCode, Integer sex, String nickName, String avatar,String loginType, |
| | | Integer uid,Integer userType) throws Exception { |
| | | UserInfo userInfo = null; |
| | | if(type == 2){//小程序 |
| | | if(ToolUtil.isEmpty(jscode)){ |
| | |
| | | userInfo = userInfoMapper.queryByOpenid(openid); |
| | | } |
| | | if(null == userInfo){ |
| | | // 如果为空 需要生成小程序二维码并携带用户id |
| | | userInfo = new UserInfo(); |
| | | userInfo.setPassWord(ShiroKit.md5("", salt)); |
| | | userInfo.setRegistIp(registIp); |
| | | userInfo.setSex(sex); |
| | | userInfo.setNickName(ToolUtil.isNotEmpty(nickName) ? nickName : this.getDefaultName()); |
| | | userInfo.setAvatar(avatar); |
| | | |
| | | if(type == 2){ |
| | | userInfo.setAppletsOpenId(openid); |
| | | }else{ |
| | |
| | | userInfo.setRegistAreaCode(registAreaCode); |
| | | } |
| | | this.insert(userInfo); |
| | | |
| | | if (uid!=null&&userType!=null){ |
| | | // 生成邀请记录 |
| | | Invite invite = new Invite(); |
| | | invite.setInviteUserId(uid); |
| | | invite.setUserId(userInfo.getId()); |
| | | invite.setRegisterTime(new Date()); |
| | | invite.setUseType(userType); |
| | | inviteMapper.insert(invite); |
| | | if (userType==1){ |
| | | // 只有用户邀请用户会获得优惠券 |
| | | List<Map<String, Object>> query = userActivityInviteMapper.query(userInfo.getCompanyId()); |
| | | Date date = new Date(); |
| | | for(Map<String, Object> map : query){ |
| | | Double lavePrice = Double.valueOf(map.get("lavePrice").toString()); |
| | | for(int i = Integer.valueOf(String.valueOf(map.get("totalNum"))); i > 0; i--){ |
| | | //判断当前优惠券金额是否大于可发放剩余总金额 |
| | | if(Double.valueOf(String.valueOf(map.get("money"))).compareTo(lavePrice) > 0){ |
| | | break; |
| | | } |
| | | UserCouponRecord userCouponRecord = new UserCouponRecord(); |
| | | userCouponRecord.setActivityType(3); |
| | | userCouponRecord.setCouponActivityId(Integer.valueOf(String.valueOf(map.get("id")))); |
| | | userCouponRecord.setCouponId(Integer.valueOf(String.valueOf(map.get("couponId")))); |
| | | userCouponRecord.setState(1); |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.setTime(date); |
| | | calendar.set(Calendar.DAY_OF_MONTH, calendar.get(Calendar.DAY_OF_MONTH) + Integer.valueOf(String.valueOf(map.get("effective")))); |
| | | userCouponRecord.setExpirationTime(calendar.getTime()); |
| | | userCouponRecord.setCouponType(Integer.valueOf(String.valueOf(map.get("couponType")))); |
| | | userCouponRecord.setCouponUseType(Integer.valueOf(String.valueOf(map.get("couponUseType")))); |
| | | userCouponRecord.setInsertTime(date); |
| | | userCouponRecord.setFullMoney(Double.valueOf(String.valueOf(map.get("fullMoney")))); |
| | | userCouponRecord.setMoney(Double.valueOf(String.valueOf(map.get("money")))); |
| | | userCouponRecord.setCompanyId(userInfo.getCompanyId()); |
| | | userCouponRecord.setUserId(uid); |
| | | userCouponRecordService.insert(userCouponRecord); |
| | | //修改剩余可发放总金额 |
| | | lavePrice -= Double.valueOf(String.valueOf(map.get("money"))); |
| | | } |
| | | UserActivityInvite uai = userActivityInviteMapper.selectById(Integer.valueOf(map.get("id").toString())); |
| | | uai.setLavePrice(new BigDecimal(lavePrice).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | userActivityInviteMapper.updateById(uai); |
| | | } |
| | | } |
| | | } |
| | | this.addCoupon(userInfo);//添加优惠券 |
| | | |
| | | UserInfo finalUserInfo = userInfo; |
| | | new Thread(new Runnable() { |
| | | @Override |
| | |
| | | jsonObject.put(userInfo.getId().toString(), userInfo.getAppletsOpenId()); |
| | | redisUtil.setStrValue("appletOpenId", jsonObject.toJSONString()); |
| | | } |
| | | generateQrCode(userInfo); |
| | | |
| | | //调用单点登录的逻辑 |
| | | this.singlePointLogin(userInfo.getId(),loginType); |
| | |
| | | return ResultUtil.success(loginWarpper); |
| | | } |
| | | |
| | | |
| | | private void generateQrCode(UserInfo userInfo) { |
| | | if (userInfo.getCode()!=null){ |
| | | return; |
| | | } |
| | | String accessToken = weChatUtil.getAccessToken(); |
| | | InputStream inputStream = null; |
| | | OutputStream outputStream = null; |
| | | try { |
| | | String url = "https://api.weixin.qq.com/wxa/getwxacodeunlimit?access_token=" + accessToken; |
| | | Map<String, Object> param = new HashMap<>(); |
| | | // param.put("page", "pageA/houseDetail"); |
| | | param.put("check_path", false); |
| | | // 用户id 用于分享 |
| | | param.put("scene", "uid="+userInfo.getId()+"userType=1"); |
| | | param.put("env_version", "trial"); |
| | | param.put("width", 200); //二维码尺寸 |
| | | param.put("is_hyaline", true); // 是否需要透明底色, is_hyaline 为true时,生成透明底色的小程序码 参数仅对小程序码生效 |
| | | param.put("auto_color", true); // 自动配置线条颜色,如果颜色依然是黑色,则说明不建议配置主色调 参数仅对小程序码生效 |
| | | Map<String, Object> line_color = new HashMap<>(); |
| | | line_color.put("r", 0); |
| | | line_color.put("g", 0); |
| | | line_color.put("b", 0); |
| | | param.put("line_color", line_color); |
| | | System.err.println("调用生成微信URL接口传参:" + param); |
| | | MultiValueMap<String, String> headers = new LinkedMultiValueMap<>(); |
| | | HttpEntity requestEntity = new HttpEntity(param, headers); |
| | | ResponseEntity<byte[]> entity = restTemplate.exchange(url, HttpMethod.POST, requestEntity, byte[].class, new Object[0]); |
| | | System.err.println("调用小程序生成微信永久小程序码URL接口返回结果:" + entity.getBody()); |
| | | byte[] result = entity.getBody(); |
| | | System.err.println(Base64.encodeBase64String(result)); |
| | | |
| | | inputStream = new ByteArrayInputStream(result); |
| | | String finalFileName = System.currentTimeMillis() + "" + new SecureRandom().nextInt(0x0400) + ".jpeg"; |
| | | MultipartFile multipartFile = convertInputStreamToMultipartFile(inputStream, finalFileName, "image/jpeg"); |
| | | String pictureName = OssUploadUtil.ossUploadCode(multipartFile); |
| | | System.err.println(pictureName); |
| | | userInfo.setCode(pictureName); |
| | | this.updateById(userInfo); |
| | | |
| | | } catch (Exception e) { |
| | | System.err.println("调用小程序生成微信永久小程序码URL接口异常" + e); |
| | | } finally { |
| | | if (inputStream != null) { |
| | | try { |
| | | inputStream.close(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | if (outputStream != null) { |
| | | try { |
| | | outputStream.close(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | public MultipartFile convertInputStreamToMultipartFile(InputStream inputStream, String fileName, String contentType) throws IOException { |
| | | ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); |
| | | byte[] buffer = new byte[1024]; |
| | | int bytesRead; |
| | | while ((bytesRead = inputStream.read(buffer)) != -1) { |
| | | byteArrayOutputStream.write(buffer, 0, bytesRead); |
| | | } |
| | | byte[] data = byteArrayOutputStream.toByteArray(); |
| | | return new CustomMultipartFile(data, fileName, contentType); |
| | | } |
| | | |
| | | /** |
| | | * 忘记密码操作 |
| | |
| | | if(null == userInfo){ |
| | | return ResultUtil.error("获取用户信息失败"); |
| | | } |
| | | return this.captchaLogin(userInfo.get("phone"), "1234", null, registAreaCode, loginType); |
| | | return this.captchaLogin(userInfo.get("phone"), "1234", null, registAreaCode, loginType,null,null); |
| | | }else{ |
| | | return ResultUtil.error(jsonObject.getString("msg")); |
| | | } |
| | |
| | | jsonObject.put(userId.toString(), openid); |
| | | redisUtil.setStrValue("appletOpenId", jsonObject.toJSONString()); |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | | @Override |
| | | public UserInfo generateCode(UserInfo userInfo) { |
| | | generateQrCode(userInfo); |
| | | return userInfo; |
| | | } |
| | | |
| | | public Map<String, String> getUserInfo(String accessToken){ |
| | |
| | | //添加系统消息 |
| | | systemNoticeService.addSystemNotice(1, "您已获得" + num + "张优惠券,点击查看", userInfo.getId(), 2); |
| | | } |
| | | /** |
| | | * 邀请注册时查询活动添加优惠券 |
| | | * @param userInfo |
| | | * @throws Exception |
| | | */ |
| | | private synchronized void addInviteCoupon(UserInfo userInfo) throws Exception{ |
| | | //添加优惠券 |
| | | List<Map<String, Object>> list = userActivityInviteMapper.query(userInfo.getCompanyId()); |
| | | int num = 0; |
| | | for(Map<String, Object> map : list){ |
| | | if(null != map){ |
| | | Integer totalNum = Integer.valueOf(String.valueOf(map.get("totalNum"))); |
| | | Double lavePrice = Double.valueOf(String.valueOf(map.get("lavePrice"))); |
| | | for(int i = totalNum; i > 0; i--){ |
| | | //判断当前发放的优惠券是否大于剩余可发送总金额 |
| | | if(Double.valueOf(String.valueOf(map.get("money"))).compareTo(lavePrice) > 0){ |
| | | break; |
| | | } |
| | | UserCouponRecord userCouponRecord = new UserCouponRecord(); |
| | | userCouponRecord.setUserId(userInfo.getId()); |
| | | userCouponRecord.setCompanyId(Integer.valueOf(String.valueOf(map.get("companyId")))); |
| | | userCouponRecord.setMoney(Double.valueOf(String.valueOf(map.get("money")))); |
| | | userCouponRecord.setFullMoney(Double.valueOf(String.valueOf(map.get("fullMoney")))); |
| | | userCouponRecord.setInsertTime(new Date()); |
| | | userCouponRecord.setState(1); |
| | | userCouponRecord.setCouponUseType(Integer.valueOf(String.valueOf(map.get("couponUseType")))); |
| | | userCouponRecord.setCouponType(Integer.valueOf(String.valueOf(map.get("couponType")))); |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.setTime(new Date()); |
| | | Integer integer = Integer.valueOf(String.valueOf(null != map.get("effective") ? map.get("effective") : "0")); |
| | | calendar.set(Calendar.DAY_OF_MONTH, calendar.get(Calendar.DAY_OF_MONTH) + integer); |
| | | userCouponRecord.setExpirationTime(calendar.getTime()); |
| | | userCouponRecord.setCouponId(Integer.valueOf(String.valueOf(map.get("couponId")))); |
| | | userCouponRecord.setCouponActivityId(Integer.valueOf(String.valueOf(map.get("id")))); |
| | | userCouponRecord.setActivityType(2); |
| | | userCouponRecordService.insert(userCouponRecord); |
| | | //修改剩余可发放总金额 |
| | | lavePrice -= Double.valueOf(String.valueOf(map.get("money"))); |
| | | num++; |
| | | } |
| | | UserActivityRegistered uar = userActivityRegisteredService.selectById(Integer.valueOf(map.get("id").toString())); |
| | | uar.setLavePrice(new BigDecimal(lavePrice).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | userActivityRegisteredService.updateById(uar); |
| | | } |
| | | } |
| | | //添加系统消息 |
| | | systemNoticeService.addSystemNotice(1, "您已获得" + num + "张优惠券,点击查看", userInfo.getId(), 2); |
| | | } |
| | | |
| | | |
| | | /** |
| | |
| | | |
| | | public class OssUploadUtil { |
| | | //OSS图片访问域名 |
| | | public static String oss_domain = "https://jiayixing-bucket.oss-cn-beijing.aliyuncs.com/"; |
| | | public static String accessKeyId = "LTAI5tE2Z7nA1rbtzZYMSPqR"; |
| | | public static String accessKeySecret = "HOGUqx1t4UWh8KepXJf69dlKj4tTBs"; |
| | | public static String bucketName="jiayixing-bucket"; |
| | | public static String endpoint = "oss-cn-beijing.aliyuncs.com"; |
| | | public static String oss_domain = "https://xv95128.oss-cn-wuhan-lr.aliyuncs.com/"; |
| | | public static String oss_domain_cdn = "http://cdn.xn95128.cn/"; |
| | | public static String accessKeyId = "LTAI5tEQarpMqRDNnSuj2mCE"; |
| | | public static String accessKeySecret = "6lBQHFh4XRaIytR5mQ6wDjAbIWmDok"; |
| | | public static String bucketName="xv95128"; |
| | | public static String endpoint = "oss-cn-wuhan-lr.aliyuncs.com"; |
| | | |
| | | public static OSSClient ossClient = new OSSClient(endpoint, accessKeyId,accessKeySecret); |
| | | |
| | | public static String ossUpload( MultipartFile file) throws IOException{ |
| | | public static String ossUpload(HttpServletRequest request, MultipartFile file) throws IOException{ |
| | | //CommonsMultipartFile file = (CommonsMultipartFile)multipartFile; |
| | | String fileName = ""; |
| | | if(file!=null && !"".equals(file.getOriginalFilename()) && file.getOriginalFilename()!=null){ |
| | |
| | | ossClient.putObject(bucketName,"img/"+fileName,content,meta);// 上传Object. |
| | | if(fileName != null && !"".equals(fileName)){ |
| | | System.out.println(fileName); |
| | | fileName = oss_domain+"img/"+fileName; |
| | | fileName = oss_domain_cdn+"img/"+fileName; |
| | | } |
| | | } |
| | | return fileName; |
| | | } |
| | | public static String ossUploadCode( MultipartFile file) throws IOException{ |
| | | //CommonsMultipartFile file = (CommonsMultipartFile)multipartFile; |
| | | String fileName = ""; |
| | | if(file!=null && !"".equals(file.getOriginalFilename()) && file.getOriginalFilename()!=null){ |
| | | InputStream content = file.getInputStream();//获得指定文件的输入流 |
| | | ObjectMetadata meta = new ObjectMetadata();// 创建上传Object的Metadata |
| | | meta.setContentLength(file.getSize()); // 必须设置ContentLength |
| | | String originalFilename = file.getOriginalFilename(); |
| | | fileName = UUID.randomUUID().toString().replaceAll("-","") + originalFilename.subSequence(originalFilename.lastIndexOf("."), originalFilename.length()); |
| | | ossClient.putObject(bucketName,"img/"+fileName,content,meta);// 上传Object. |
| | | if(fileName != null && !"".equals(fileName)){ |
| | | System.out.println(fileName); |
| | | fileName = oss_domain_cdn+"img/"+fileName; |
| | | } |
| | | } |
| | | return fileName; |
| | |
| | | MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request; |
| | | MultipartFile file = (MultipartFile) multipartRequest.getFile("myfile"); |
| | | if (file.getSize() != 0) { |
| | | ossUpload = OssUploadUtil.ossUpload( file); |
| | | ossUpload = OssUploadUtil.ossUploadCode( file); |
| | | // ossUpload = ObsUploadUtil.obsUpload(super.getHttpServletRequest(), file); |
| | | m.put("imgUrl", ossUpload); |
| | | } |
| | |
| | | public String image(@RequestParam("file") MultipartFile picture) { |
| | | try { |
| | | MultipartFile file = (MultipartFile) picture; |
| | | String pictureName = OssUploadUtil.ossUpload(file); |
| | | String pictureName = OssUploadUtil.ossUploadCode(file); |
| | | // String pictureName = ObsUploadUtil.obsUpload(super.getHttpServletRequest(), picture); |
| | | return pictureName; |
| | | } catch (IOException e1) { |
| | |
| | | // 文件全路径 |
| | | //pictureName = gunsProperties.getPictureServerAddress() + pictureName; |
| | | // pictureName = ObsUploadUtil.obsUpload(super.getHttpServletRequest(), picture); |
| | | pictureName = OssUploadUtil.ossUpload( picture); |
| | | pictureName = OssUploadUtil.ossUploadCode( picture); |
| | | |
| | | String result = "{'original': '" + picture.getOriginalFilename() + "', 'state': 'SUCCESS', 'url': '" + pictureName + "'}"; |
| | | if (callback == null) { |