| | |
| | | new FebsResponse().message("上传文件为空"); |
| | | } |
| | | |
| | | |
| | | String base64EncoderImg = ""; |
| | | try { |
| | | //输出到BufferedImage |
| | | BufferedImage bufferedImage = Thumbnails.of(file.getInputStream()) |
| | | // 图片大小(长宽)压缩比例 从0-1,1表示原图 |
| | | .scale(1f) |
| | | // 图片质量压缩比例 从0-1,越接近1质量越好 |
| | | .outputQuality(0.5f) |
| | | .asBufferedImage(); |
| | | //对内存中的图片文件进行Base64处理 |
| | | ByteArrayOutputStream newBaos = new ByteArrayOutputStream();//io流 |
| | | ImageIO.write(bufferedImage, "jpg", newBaos);//写入流中 |
| | | byte[] bytes = newBaos.toByteArray();//转换成字节 |
| | | base64EncoderImg = new BASE64Encoder().encode(bytes); |
| | | // base64EncoderImg = URLEncoder.encode(new BASE64Encoder().encode(bytes), "UTF-8"); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | //文件加密 |
| | | // BASE64Encoder base64Encoder =new BASE64Encoder(); |
| | | // String base64EncoderImg = null; |
| | | // try { |
| | | // base64EncoderImg = base64Encoder.encode(file.getBytes()); |
| | | // } catch (IOException e) { |
| | | // e.printStackTrace(); |
| | | // } |
| | | |
| | | BASE64Encoder base64Encoder =new BASE64Encoder(); |
| | | String imageFuffix = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")); |
| | | if("jpg".equals(imageFuffix)){ |
| | | try { |
| | | //输出到BufferedImage |
| | | BufferedImage bufferedImage = Thumbnails.of(file.getInputStream()) |
| | | // 图片大小(长宽)压缩比例 从0-1,1表示原图 |
| | | .scale(1f) |
| | | // 图片质量压缩比例 从0-1,越接近1质量越好 |
| | | .outputQuality(0.5f) |
| | | .asBufferedImage(); |
| | | //对内存中的图片文件进行Base64处理 |
| | | ByteArrayOutputStream newBaos = new ByteArrayOutputStream();//io流 |
| | | ImageIO.write(bufferedImage, "jpg", newBaos);//写入流中 |
| | | byte[] bytes = newBaos.toByteArray();//转换成字节 |
| | | base64EncoderImg = base64Encoder.encode(bytes); |
| | | // base64EncoderImg = URLEncoder.encode(new BASE64Encoder().encode(bytes), "UTF-8"); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | }else{ |
| | | try { |
| | | base64EncoderImg = base64Encoder.encode(file.getBytes()); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | //文件加密 |
| | | // String imageFuffix = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")); |
| | | // String imageFuffix = ".png"; |
| | | String imageNames = System.currentTimeMillis() + IdUtil.simpleUUID() + imageFuffix; |
| | | String imageName = "uploadeFile/" + imageNames; |
| | |
| | | /** |
| | | * 代理分红 |
| | | */ |
| | | @Scheduled(cron = "0 30 0 * * ?") |
| | | public void profitJob() { |
| | | memberProfitService.agentProfit(null); |
| | | } |
| | | // @Scheduled(cron = "0 30 0 * * ?") |
| | | // public void profitJob() { |
| | | // memberProfitService.agentProfit(null); |
| | | // } |
| | | |
| | | @Scheduled(cron = "0 30 1 * * ?") |
| | | public void storeAndDirectorJob() { |
| | | memberProfitService.storeAndDirectorProfit(null); |
| | | } |
| | | // @Scheduled(cron = "0 30 1 * * ?") |
| | | // public void storeAndDirectorJob() { |
| | | // memberProfitService.storeAndDirectorProfit(null); |
| | | // } |
| | | |
| | | /** |
| | | * 感恩奖 |
| | | * 线下服务中心补贴 |
| | | */ |
| | | @Scheduled(cron = "0 0 1 * * ?") |
| | | public void thankfulJob() { |
| | |
| | | /** |
| | | * 排名奖 每月1号 |
| | | */ |
| | | @Scheduled(cron = "0 30 0 1 * ?") |
| | | public void rankJob() { |
| | | memberProfitService.rankProfit(); |
| | | } |
| | | // @Scheduled(cron = "0 30 0 1 * ?") |
| | | // public void rankJob() { |
| | | // memberProfitService.rankProfit(); |
| | | // } |
| | | |
| | | /** |
| | | * 积分池,所有消费拿出10%放到积分池,然后按1%每天释放加权平分 |
| | | */ |
| | | @Scheduled(cron = "0 0 2 * * ?") |
| | | // @Scheduled(cron = "0 0 2 * * ?") |
| | | // @Scheduled(cron = "0 0/5 * * * ? ") |
| | | public void scorePool() { |
| | | memberProfitService.scorePool(); |
| | | } |
| | | // public void scorePool() { |
| | | // memberProfitService.scorePool(); |
| | | // } |
| | | } |
| | |
| | | <select id="selectTeamEqualsMemberByDate" resultType="cc.mrbird.febs.mall.vo.AdminTeamEqualsPerkVo"> |
| | | select |
| | | a.member_id memberId, |
| | | sum(a.amount) amount sumAmount, |
| | | sum(a.amount) sumAmount, |
| | | c.id rtMemberId |
| | | from mall_money_flow a |
| | | inner join mall_member b on b.id = a.member_id |
| | |
| | | elem: $view.find('table'), |
| | | id: 'moneyFlowChargeTable', |
| | | url: ctx + 'admin/mallMember/getMoneyChargeList', |
| | | totalRow: true ,// 开启合计行 |
| | | cols: [[ |
| | | {field: 'withdrawNo', title: '编号', minWidth: 100,align:'left'}, |
| | | {field: 'withdrawNo', title: '编号', minWidth: 100,align:'left', totalRowText: '合计:'}, |
| | | {field: 'name', title: '名称', minWidth: 100,align:'left'}, |
| | | {field: 'phone', title: '账号', minWidth: 150,align:'left'}, |
| | | {field: 'bindPhone', title: '手机号', minWidth: 150,align:'left'}, |
| | | {field: 'amount', title: '金额', minWidth: 150,align:'left'}, |
| | | {field: 'amountFee', title: '手续费', minWidth: 150,align:'left'}, |
| | | {field: 'amount', title: '金额', minWidth: 150,align:'left',totalRow: '{{= parseInt(d.amount) }}'}, |
| | | {field: 'amountFee', title: '手续费', minWidth: 150,align:'left',totalRow: '{{= parseInt(d.amountFee) }}'}, |
| | | {field: 'remark', title: '错误信息', minWidth: 150,align:'left'}, |
| | | {field: 'status', title: '状态', |
| | | templet: function (d) { |
| | |
| | | url: ctx + 'admin/mallMember/getMallMemberList', |
| | | toolbar:"#tableMemberBar", |
| | | defaultToolbar:[], |
| | | totalRow: true ,// 开启合计行 |
| | | cols: [[ |
| | | {type: 'checkbox'}, |
| | | {field: 'phone', title: '账号', minWidth: 150,align:'left',hide:toolbarMallmember}, |
| | | {field: 'name', title: '名称', minWidth: 100,align:'left'}, |
| | | {field: 'name', title: '名称', minWidth: 100,align:'left', totalRowText: '合计:'}, |
| | | {field: 'inviteId', title: '邀请码', minWidth: 100,align:'left'}, |
| | | {field: 'balance', title: '余额', minWidth: 100,align:'left'}, |
| | | // {field: 'score', title: '赠送积分', minWidth: 100,align:'left'}, |
| | | {field: 'prizeScore', title: '现金积分', minWidth: 100,align:'left'}, |
| | | // {field: 'commission', title: '佣金', minWidth: 100,align:'left'}, |
| | | {field: 'balance', title: '余额', minWidth: 100,align:'left',totalRow: '{{= parseInt(d.balance) }}'}, |
| | | {field: 'prizeScore', title: '现金积分', minWidth: 100,align:'left',totalRow: '{{= parseInt(d.prizeScore) }}'}, |
| | | {field: 'referrerName', title: '推荐人', minWidth: 100,align:'left'}, |
| | | {field: 'levelName', title: '会员类型', minWidth: 100,align:'left'}, |
| | | // {field: 'storeMaster', title: '店长', templet:'#switchStoreMaster', minWidth: 100}, |
| | | // {field: 'director', title: '总监', templet:'#switchDirector', minWidth: 100 }, |
| | | {field: 'storeMaster', title: '线下服务中心', templet:'#switchStoreMaster', minWidth: 120,align:'left'}, |
| | | {field: 'director', title: '代理商', templet:'#switchDirector', minWidth: 120,align:'left' }, |
| | | {field: 'accountType', title: '账号类型', |
| | | templet: function (d) { |
| | | if (d.accountType === 2) { |
| | |
| | | }else{ |
| | | return '' |
| | | } |
| | | }, minWidth: 100,align:'center'}, |
| | | {field: 'accountStatus', title: '账号状态', templet: '#switchStatus', minWidth: 100,align:'center'}, |
| | | {field: 'createdTime', title: '注册时间', minWidth: 180,align:'center'}, |
| | | }, minWidth: 100,align:'left'}, |
| | | {field: 'accountStatus', title: '账号状态', templet: '#switchStatus', minWidth: 100,align:'left'}, |
| | | {field: 'createdTime', title: '注册时间', minWidth: 180,align:'left'}, |
| | | // {title: '操作', |
| | | // templet: function (d) { |
| | | // // '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="see" shiro:hasPermission="user:update">详情</button>' |
| | |
| | | // // '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="moneyFlow" shiro:hasPermission="moneyFlow:update">资金流水</button>' |
| | | // // + '<button class="layui-btn layui-btn-normal layui-btn-xs" type="button" lay-event="updateReferer" shiro:hasPermission="user:update">修改推荐人</button>' |
| | | // },minWidth: 200,align:'center', fixed:"right"} |
| | | {title: '操作', minWidth: 200 ,toolbar: '#mallmember-option',hide:toolbarMallmember} |
| | | {title: '操作', minWidth: 200 ,toolbar: '#mallmember-option',hide:toolbarMallmember,align:'left'} |
| | | ]] |
| | | }); |
| | | } |
| | |
| | | <blockquote class="layui-elem-quote blue-border">签到</blockquote> |
| | | <div class="layui-form-item"> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">签到:开始</label> |
| | | <div class="layui-input-inline"> |
| | | <input type="text" name="signScoreDays" lay-verify="required|integer" placeholder="请输入数字" autocomplete="off" class="layui-input" > |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">天,每天获取:</label> |
| | | <label class="layui-form-label febs-form-item-require">签到:</label> |
| | | <div class="layui-form-mid layui-word-aux">开始每次</div> |
| | | <div class="layui-input-inline"> |
| | | <input type="text" name="signScore" lay-verify="required|integer" placeholder="请输入数字" autocomplete="off" class="layui-input" > |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">,之后每天获取</label> |
| | | <div class="layui-form-mid layui-word-aux">积分,从第</div> |
| | | <div class="layui-input-inline"> |
| | | <input type="text" name="signScoreDays" lay-verify="required|integer" placeholder="请输入数字" autocomplete="off" class="layui-input" > |
| | | </div> |
| | | <div class="layui-form-mid layui-word-aux">次后,每次获取</div> |
| | | <div class="layui-input-inline"> |
| | | <input type="text" name="signScoreCnt" lay-verify="required|integer" placeholder="请输入数字" autocomplete="off" class="layui-input" > |
| | | </div> |
| | | <div class="layui-form-mid layui-word-aux">积分</div> |
| | | </div> |
| | | </div> |
| | | |
| | |
| | | </div> |
| | | <div class="layui-card-footer"> |
| | | <button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="hlm-score-set-submit" id="submit">保存</button> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | |
| | | @Test |
| | | public void profitJobTest() { |
| | | profitJob.profitJob(); |
| | | // profitJob.profitJob(); |
| | | } |
| | | |
| | | |