| | |
| | | <packaging>jar</packaging> |
| | | |
| | | <dependencies> |
| | | |
| | | <dependency> |
| | | <groupId>org.springframework</groupId> |
| | | <artifactId>spring-test</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.github.pagehelper</groupId> |
| | | <artifactId>pagehelper-spring-boot-starter</artifactId> |
| | |
| | | if (userInfo.getCode()==null){ |
| | | userInfo = driverService.generateCode(userInfo); |
| | | } |
| | | driverService.generateCode(userInfo); |
| | | Map<String, String> res = new HashMap<>(); |
| | | res.put("code",userInfo.getCode()); |
| | | int i = inviteService.selectCount(new EntityWrapper<Invite>() |
| | | .eq("inviteUserId", uid) |
| | | .eq("useType", 2)); |
| | | .eq("userType", 2)); |
| | | |
| | | res.put("inviteNumber",i+""); |
| | | return ResultUtil.success(res); |
| | |
| | | startTime = startTime + " 00:00:00"; |
| | | endTime = endTime + " 23:59:59"; |
| | | } |
| | | pageNum = (pageNum - 1) * size; |
| | | List<Invite> invites = inviteService.inviteList(uid,startTime,endTime,pageNum,size); |
| | | for (Invite invite : invites) { |
| | | // 将手机号phone中间四位替换为* |
| | |
| | | import com.stylefeng.guns.modular.smallLogistics.server.IOrderLogisticsService; |
| | | import com.stylefeng.guns.modular.system.dao.DriverWorkMapper; |
| | | import com.stylefeng.guns.modular.system.dao.TUseMoneyMapper; |
| | | import com.stylefeng.guns.modular.system.dao.UserCouponRecordMapper; |
| | | import com.stylefeng.guns.modular.system.model.*; |
| | | import com.stylefeng.guns.modular.system.service.*; |
| | | import com.stylefeng.guns.modular.system.util.ChinaMobileUtil; |
| | |
| | | private IPaymentRecordService paymentRecordService; |
| | | @Autowired |
| | | private ITransactionDetailsService transactionDetailsService; |
| | | @Autowired |
| | | private UserCouponRecordMapper userCouponRecordMapper; |
| | | /** |
| | | * 司机手动确认收款 |
| | | * @param orderId |
| | |
| | | // 平台收入 |
| | | double money; |
| | | Driver driver = driverService.selectById(orderTaxi.getDriverId()); |
| | | Company company = companyService.selectById(driver.getFranchiseeId()); |
| | | Company company = companyService.selectById(driver.getCompanyId()); |
| | | |
| | | if(orderTaxi.getOrderSource() == 2 || orderTaxi.getOrderSource() == 3){ |
| | | double v = company.getPercentageDeduction() / 100; |
| | |
| | | money = company.getFixedDeduction(); |
| | | moneyTwo = orderTaxi.getOrderMoney()-money; |
| | | } |
| | | Double orderMoney = orderTaxi.getOrderMoney(); |
| | | if (orderTaxi.getCouponId()!=null){ |
| | | UserCouponRecord userCouponRecord = userCouponRecordMapper.selectById(orderTaxi.getCouponId()); |
| | | // if(userCouponRecord.getCompanyId() != orderTaxi.getCompanyId()){ |
| | | // return ResultUtil.error("优惠券不能用于此订单", ""); |
| | | // } |
| | | // if(userCouponRecord.getState() == 2){ |
| | | // return ResultUtil.error("优惠券已使用", ""); |
| | | // } |
| | | // if(userCouponRecord.getState() == 3){ |
| | | // return ResultUtil.error("优惠券已过期", ""); |
| | | // } |
| | | // if(userCouponRecord.getCouponUseType() != 0 && userCouponRecord.getCouponUseType() != 2){ |
| | | // return ResultUtil.error("优惠券不能用于此类型订单", ""); |
| | | // } |
| | | // if(userCouponRecord.getCouponType() == 2 && orderMoney.compareTo(userCouponRecord.getFullMoney()) < 0){ |
| | | // return ResultUtil.error("优惠券不能用于此订单", ""); |
| | | // } |
| | | orderMoney = orderMoney - userCouponRecord.getMoney(); |
| | | orderTaxi.setCouponMoney(userCouponRecord.getMoney()); |
| | | orderTaxi.setCouponId(orderTaxi.getCouponId()); |
| | | } |
| | | orderTaxi.setPayMoney(orderMoney); |
| | | orderTaxiService.updateById(orderTaxi); |
| | | |
| | | driver.setBalance(driver.getBalance() + moneyTwo); |
| | | // 新增扣除使用费记录 |
| | | transactionDetailsService.saveDataTaxi(driver.getId(), "软件使用费", money, 2, 1, 2, 6, orderTaxi.getId(),placeOrderWay,company.getId()); |
| | |
| | | public interface InviteMapper extends BaseMapper<Invite> { |
| | | |
| | | |
| | | List<Invite> inviteList(@Param("uid")Integer uid,@Param("uid") String startTime, @Param("uid")String endTime, |
| | | List<Invite> inviteList(@Param("uid")Integer uid,@Param("startTime") String startTime, @Param("endTime")String endTime, |
| | | @Param("pageNum")Integer pageNum, @Param("size")Integer size); |
| | | } |
| | |
| | | <if test="null != uid"> |
| | | and t1.inviteUserId = #{uid} |
| | | </if> |
| | | <if test="null != startTime and null != endTime"> |
| | | <if test="null != startTime and '' != startTime"> |
| | | and t1.registerTime between #{startTime} and #{endTime} |
| | | </if> |
| | | and t1.userType = 2 |
| | | order by t1.registerTime desc |
| | | limit #{pageNum}, #{size} |
| | | </select> |
| | |
| | | /** |
| | | * 使用范围(1=用户,2=司机) |
| | | */ |
| | | @TableField("useType") |
| | | private Integer useType; |
| | | @TableField("userType") |
| | | private Integer userType; |
| | | |
| | | @TableField(exist = false) |
| | | @ApiModelProperty("头像") |
| | |
| | | ResultUtil loginOut(Integer id) throws Exception; |
| | | |
| | | Driver generateCode(Driver userInfo); |
| | | String generateQrCodeTemp(); |
| | | |
| | | } |
| | |
| | | import com.stylefeng.guns.modular.system.warpper.LoginWarpper; |
| | | import com.stylefeng.guns.modular.system.warpper.RegisteredWarpper; |
| | | import com.stylefeng.guns.modular.taxi.service.IOrderTaxiService; |
| | | import org.apache.http.entity.ContentType; |
| | | import org.apache.shiro.authc.SimpleAuthenticationInfo; |
| | | import org.apache.shiro.authc.UsernamePasswordToken; |
| | | import org.apache.shiro.authc.credential.HashedCredentialsMatcher; |
| | |
| | | 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.http.*; |
| | | import org.springframework.mock.web.MockMultipartFile; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.LinkedMultiValueMap; |
| | | import org.springframework.util.MultiValueMap; |
| | |
| | | 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; |
| | |
| | | // param.put("page", "pageA/houseDetail"); |
| | | param.put("check_path", false); |
| | | // 用户id 用于分享 |
| | | param.put("scene", "uid="+userInfo.getId()+"userType=1"); |
| | | param.put("scene", "uid="+userInfo.getId()+"userType=2"); |
| | | param.put("env_version", "trial"); |
| | | param.put("width", 200); //二维码尺寸 |
| | | param.put("is_hyaline", true); // 是否需要透明底色, is_hyaline 为true时,生成透明底色的小程序码 参数仅对小程序码生效 |
| | |
| | | line_color.put("b", 0); |
| | | param.put("line_color", line_color); |
| | | System.err.println("调用生成微信URL接口传参:" + param); |
| | | MultiValueMap<String, String> headers = new LinkedMultiValueMap<>(); |
| | | HttpHeaders headers = new HttpHeaders(); |
| | | headers.setContentType(MediaType.APPLICATION_JSON); |
| | | HttpEntity requestEntity = new HttpEntity(param, headers); |
| | | ResponseEntity<byte[]> entity = restTemplate.exchange(url, HttpMethod.POST, requestEntity, byte[].class, new Object[0]); |
| | | // HashMap<String, String> map = new HashMap<>(); |
| | | // map.put("path", path); |
| | | // HttpHeaders headers = new HttpHeaders(); |
| | | // headers.setContentType(MediaType.APPLICATION_JSON); |
| | | // HttpEntity requestEntity = new HttpEntity(map, headers); |
| | | // ResponseEntity<byte[]> rep = restTemplate.exchange(url, HttpMethod.POST, requestEntity, byte[].class); |
| | | // byte[] bytes = rep.getBody(); |
| | | ResponseEntity<byte[]> entity = restTemplate.exchange(url, HttpMethod.POST, requestEntity, byte[].class); |
| | | 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); |
| | | String finalFileName = System.currentTimeMillis() + "" + new SecureRandom().nextInt(0x0400) + ".jpg"; |
| | | ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(result); |
| | | MultipartFile file = new MockMultipartFile(ContentType.APPLICATION_OCTET_STREAM.toString(), byteArrayInputStream); |
| | | String pictureName = OssUploadUtil.ossUploadCode(file,finalFileName); |
| | | System.err.println(pictureName); |
| | | userInfo.setCode(pictureName); |
| | | this.updateById(userInfo); |
| | |
| | | } |
| | | } |
| | | } |
| | | @Override |
| | | public String generateQrCodeTemp() { |
| | | |
| | | 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="+1+"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); |
| | | HttpHeaders headers = new HttpHeaders(); |
| | | headers.setContentType(MediaType.APPLICATION_JSON); |
| | | HttpEntity requestEntity = new HttpEntity(param, headers); |
| | | // HashMap<String, String> map = new HashMap<>(); |
| | | // map.put("path", path); |
| | | // HttpHeaders headers = new HttpHeaders(); |
| | | // headers.setContentType(MediaType.APPLICATION_JSON); |
| | | // HttpEntity requestEntity = new HttpEntity(map, headers); |
| | | // ResponseEntity<byte[]> rep = restTemplate.exchange(url, HttpMethod.POST, requestEntity, byte[].class); |
| | | // byte[] bytes = rep.getBody(); |
| | | ResponseEntity<byte[]> entity = restTemplate.exchange(url, HttpMethod.POST, requestEntity, byte[].class); |
| | | 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) + ".jpg"; |
| | | ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(result); |
| | | MultipartFile file = new MockMultipartFile(ContentType.APPLICATION_OCTET_STREAM.toString(), byteArrayInputStream); |
| | | String pictureName = OssUploadUtil.ossUploadCode(file,finalFileName); |
| | | System.err.println(pictureName); |
| | | return Base64.encodeBase64String(result); |
| | | |
| | | } 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(); |
| | | } |
| | | } |
| | | } |
| | | return ""; |
| | | } |
| | | /** |
| | | * 获取编号 |
| | | * @return |
| | |
| | | } |
| | | return fileName; |
| | | } |
| | | public static String ossUploadCode( MultipartFile file,String originalFilename) throws IOException{ |
| | | //CommonsMultipartFile file = (CommonsMultipartFile)multipartFile; |
| | | String fileName = ""; |
| | | if(file!=null && !"".equals(originalFilename) && originalFilename!=null){ |
| | | InputStream content = file.getInputStream();//获得指定文件的输入流 |
| | | ObjectMetadata meta = new ObjectMetadata();// 创建上传Object的Metadata |
| | | meta.setContentLength(file.getSize()); // 必须设置ContentLength |
| | | 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; |
| | | } |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | public String getAccessToken(){ |
| | | String url = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=wx0e72f86394831b34&secret=930f857abc74f7bb5cbd89e1544c5669"; |
| | | String url = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=wx4d36488fa2cd2718&secret=f3874e9c813f31a2e90c37346eb74d82"; |
| | | String backData = restTemplate.getForObject(url, String.class); |
| | | String accessToken = JSONObject.parseObject(backData).getString("access_token"); |
| | | return accessToken; |
| | |
| | | </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>--> |
| | | |
| | | <!-- <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="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">--> |
| | | |
| | | <!-- <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.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> |
| | | |
| | |
| | | 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; |
| | | } |
| | | }, |
| | | {title: '邀请人', field: 'inviteUserName', visible: true, align: 'center', valign: 'middle',width:'19%'}, |
| | | {title: '被邀请用户', field: 'nickName', visible: true, align: 'center', valign: 'middle',width:'19%'}, |
| | | {title: '被邀请用户手机号', field: 'phone', visible: true, align: 'center', valign: 'middle',width:'19%'}, |
| | | {title: '被邀请用户ID', field: 'userId', visible: true, align: 'center', valign: 'middle',width:'19%'}, |
| | | {title: '注册时间', field: 'registerTime', visible: true, align: 'center', valign: 'middle',width:'19%',}, |
| | | ]; |
| | | }; |
| | | |
| | |
| | | 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; |
| | | } |
| | | }, |
| | | {title: '邀请人', field: 'inviteUserName', visible: true, align: 'center', valign: 'middle',width:'19%'}, |
| | | {title: '被邀请用户', field: 'nickName', visible: true, align: 'center', valign: 'middle',width:'19%'}, |
| | | {title: '被邀请用户手机号', field: 'phone', visible: true, align: 'center', valign: 'middle',width:'19%'}, |
| | | {title: '被邀请用户ID', field: 'userId', visible: true, align: 'center', valign: 'middle',width:'19%'}, |
| | | {title: '注册时间', field: 'registerTime', visible: true, align: 'center', valign: 'middle',width:'19%',}, |
| | | ]; |
| | | }; |
| | | |
| | |
| | | res.put("code",userInfo.getCode()); |
| | | int i = inviteService.selectCount(new EntityWrapper<Invite>() |
| | | .eq("inviteUserId", uid) |
| | | .eq("useType", 1)); |
| | | .eq("userType", 1)); |
| | | |
| | | res.put("inviteNumber",i+""); |
| | | return ResultUtil.success(res); |
| | |
| | | startTime = startTime + " 00:00:00"; |
| | | endTime = endTime + " 23:59:59"; |
| | | } |
| | | pageNum = (pageNum - 1) * size; |
| | | List<Invite> invites = inviteService.inviteList(uid,startTime,endTime,pageNum,size); |
| | | for (Invite invite : invites) { |
| | | // 将手机号phone中间四位替换为* |
| | |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | public interface InviteMapper extends BaseMapper<Invite> { |
| | | |
| | | |
| | | List<Invite> inviteList(@Param("uid")Integer uid,@Param("uid") String startTime, @Param("uid")String endTime, |
| | | List<Invite> inviteList(@Param("uid")Integer uid,@Param("startTime") String startTime, @Param("endTime")String endTime, |
| | | @Param("pageNum")Integer pageNum, @Param("size")Integer size); |
| | | } |
| | |
| | | <if test="null != uid"> |
| | | and t1.inviteUserId = #{uid} |
| | | </if> |
| | | <if test="null != startTime and null != endTime"> |
| | | <if test="null != startTime and '' != startTime"> |
| | | and t1.registerTime between #{startTime} and #{endTime} |
| | | </if> |
| | | and t1.userType = 1 |
| | | order by t1.registerTime desc |
| | | limit #{pageNum}, #{size} |
| | | </select> |
| | |
| | | /** |
| | | * 使用范围(1=用户,2=司机) |
| | | */ |
| | | @TableField("useType") |
| | | private Integer useType; |
| | | @TableField("userType") |
| | | private Integer userType; |
| | | |
| | | @TableField(exist = false) |
| | | @ApiModelProperty("头像") |
| | |
| | | @Override |
| | | public ResultUtil delMyCoupon(Integer id, Integer uid) throws Exception { |
| | | UserCouponRecord userCouponRecord = userCouponRecordMapper.selectById(id); |
| | | if(userCouponRecord.getUserId() != uid){ |
| | | if(!userCouponRecord.getUserId().equals(uid)){ |
| | | return ResultUtil.error("您不能删除此优惠券"); |
| | | } |
| | | userCouponRecordMapper.deleteById(id); |
| | |
| | | |
| | | @Resource |
| | | private DriverMapper driverMapper; |
| | | |
| | | @Autowired |
| | | private RestTemplate restTemplate; |
| | | @Resource |
| | |
| | | invite.setInviteUserId(uid); |
| | | invite.setUserId(userInfo.getId()); |
| | | invite.setRegisterTime(new Date()); |
| | | invite.setUseType(userType); |
| | | invite.setUserType(userType); |
| | | inviteMapper.insert(invite); |
| | | if (userType==1){ |
| | | // 只有用户邀请用户会获得优惠券 |
| | |
| | | } |
| | | } |
| | | } |
| | | this.addCoupon(userInfo);//添加优惠券 |
| | | } |
| | | if(userInfo.getState() == 2){ |
| | | return ResultUtil.error("账号被冻结"); |
| | |
| | | invite.setInviteUserId(uid); |
| | | invite.setUserId(userInfo.getId()); |
| | | invite.setRegisterTime(new Date()); |
| | | invite.setUseType(userType); |
| | | invite.setUserType(userType); |
| | | inviteMapper.insert(invite); |
| | | if (userType==1){ |
| | | // 只有用户邀请用户会获得优惠券 |
| | |
| | | param.put("check_path", false); |
| | | // 用户id 用于分享 |
| | | param.put("scene", "uid="+userInfo.getId()+"userType=1"); |
| | | param.put("env_version", "trial"); |
| | | |
| | | param.put("env_version", "trial");// 体验版 |
| | | // param.put("env_version", "release");// 正式版 |
| | | param.put("width", 200); //二维码尺寸 |
| | | param.put("is_hyaline", true); // 是否需要透明底色, is_hyaline 为true时,生成透明底色的小程序码 参数仅对小程序码生效 |
| | | param.put("auto_color", true); // 自动配置线条颜色,如果颜色依然是黑色,则说明不建议配置主色调 参数仅对小程序码生效 |
| | |
| | | } |
| | | jsonObject.put(userId.toString(), openid); |
| | | redisUtil.setStrValue("appletOpenId", jsonObject.toJSONString()); |
| | | UserInfo userInfo = userInfoMapper.selectById(userId); |
| | | if (userInfo!=null){ |
| | | userInfo.setAppletsOpenId(openid); |
| | | userInfoMapper.updateById(userInfo); |
| | | } |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | |
| | | * @return |
| | | */ |
| | | public String getAccessToken(){ |
| | | String url = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=wx0e72f86394831b34&secret=930f857abc74f7bb5cbd89e1544c5669"; |
| | | String url = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=wx4d36488fa2cd2718&secret=f3874e9c813f31a2e90c37346eb74d82"; |
| | | String backData = restTemplate.getForObject(url, String.class); |
| | | String accessToken = JSONObject.parseObject(backData).getString("access_token"); |
| | | return accessToken; |
| | |
| | | @Override |
| | | protected void initChannel(SocketChannel socketChannel) throws Exception { |
| | | // String path = "C:\\Program Files\\Apache Software Foundation\\Tomcat 8.5\\cert\\SHA256withRSA_lzhyc.cn.pfx"; |
| | | String path = "/usr/local/tomcat/ssl/xn95128.cn.pfx"; |
| | | SSLContext sslContext = createSSLContext.createSSLContext("PKCS12" |
| | | , path, "djgz8ivi"); |
| | | //SSLEngine 此类允许使用ssl安全套接层协议进行安全通信 |
| | | SSLEngine engine = sslContext.createSSLEngine(); |
| | | engine.setUseClientMode(false); |
| | | socketChannel.pipeline().addLast("ssl", new SslHandler(engine)); |
| | | // String path = "/usr/local/tomcat/ssl/xn95128.cn.pfx"; |
| | | // SSLContext sslContext = createSSLContext.createSSLContext("PKCS12" |
| | | // , path, "djgz8ivi"); |
| | | // //SSLEngine 此类允许使用ssl安全套接层协议进行安全通信 |
| | | // SSLEngine engine = sslContext.createSSLEngine(); |
| | | // engine.setUseClientMode(false); |
| | | // socketChannel.pipeline().addLast("ssl", new SslHandler(engine)); |
| | | |
| | | // 设置30秒没有读到数据,则触发一个READER_IDLE事件。 |
| | | // pipeline.addLast(new IdleStateHandler(30, 0, 0)); |