| | |
| | | package com.yeshi.makemoney.app.controller.admin.goldcorn; |
| | | |
| | | import com.google.gson.*; |
| | | import com.yeshi.makemoney.app.service.inter.goldcorn.GoldCornGetRecordService; |
| | | import com.yeshi.makemoney.app.utils.SystemInfoUtil; |
| | | import com.yeshi.makemoney.app.utils.goldcorn.GoldCornUtil; |
| | | import com.yeshi.makemoney.app.vo.AcceptAdminData; |
| | | import com.yeshi.makemoney.app.vo.admin.goldcorn.GoldCornMoneyExchangeRateAdminVO; |
| | | import net.sf.json.JSONArray; |
| | | import net.sf.json.JSONObject; |
| | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | import org.yeshi.utils.JsonUtil; |
| | | import org.yeshi.utils.StringUtil; |
| | | import org.yeshi.utils.SystemUtil; |
| | | import org.yeshi.utils.TimeUtil; |
| | | import com.google.gson.reflect.TypeToken; |
| | |
| | | import javax.servlet.http.HttpSession; |
| | | import java.lang.reflect.Type; |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | import com.yeshi.makemoney.app.entity.goldcorn.GoldCornMoneyExchangeRateRecord; |
| | | import com.yeshi.makemoney.app.service.inter.goldcorn.GoldCornMoneyExchangeRateRecordService; |
| | | import com.yeshi.makemoney.app.service.query.goldcorn.GoldCornMoneyExchangeRateRecordQuery; |
| | | import org.yeshi.utils.statistic.BaseStatisticTimeQuery; |
| | | import org.yeshi.utils.statistic.StatisticNumberResult; |
| | | import org.yeshi.utils.statistic.StatisticTimeSpan; |
| | | |
| | | @Controller |
| | | @RequestMapping("admin/api/goldcorn/exchangerate") |
| | |
| | | |
| | | @Resource |
| | | private GoldCornMoneyExchangeRateRecordService goldCornMoneyExchangeRateRecordService; |
| | | |
| | | @Resource |
| | | private GoldCornGetRecordService goldCornGetRecordService; |
| | | |
| | | |
| | | @ResponseBody |
| | |
| | | |
| | | @ResponseBody |
| | | @RequestMapping("add") |
| | | public String add(GoldCornMoneyExchangeRateAdminVO vo, HttpSession session) { |
| | | public String add(String day,String money, String validateTime, AcceptAdminData acceptAdminData) { |
| | | |
| | | if (StringUtil.isNullOrEmpty(money)) { |
| | | return JsonUtil.loadFalseResult("金额不能为空"); |
| | | } |
| | | |
| | | GoldCornMoneyExchangeRateAdminVO vo = new GoldCornMoneyExchangeRateAdminVO(); |
| | | vo.setDay(day); |
| | | vo.setValidateTime(validateTime); |
| | | //查询日期的金币数量 |
| | | BaseStatisticTimeQuery timeQuery = new BaseStatisticTimeQuery(); |
| | | timeQuery.setStartTime(GoldCornUtil.convertFormatDay(day)); |
| | | timeQuery.setEndTime(GoldCornUtil.convertFormatDay(day)); |
| | | timeQuery.setTimeSpan(StatisticTimeSpan.day); |
| | | List<StatisticNumberResult> list = goldCornGetRecordService.statistic(acceptAdminData.getSystem(), timeQuery); |
| | | if (list == null || list.size() == 0) { |
| | | return JsonUtil.loadFalseResult("统计出错"); |
| | | } |
| | | |
| | | long number = list.get(0).getNumber(); |
| | | //0.1的税 |
| | | vo.setRate(new BigDecimal(money).multiply(new BigDecimal("0.9")).divide(new BigDecimal(number),7, RoundingMode.FLOOR)); |
| | | try { |
| | | GoldCornMoneyExchangeRateRecord bean = vo.toEntity(SystemInfoUtil.getAdminSelectedSystem(session)); |
| | | GoldCornMoneyExchangeRateRecord bean = vo.toEntity(acceptAdminData.getSystem()); |
| | | goldCornMoneyExchangeRateRecordService.add(bean); |
| | | return JsonUtil.loadTrueResult(""); |
| | | } catch (Exception e) { |
| | |
| | | String value = systemConfigService.getValueCache(acceptData.getSystem(), config); |
| | | data.put(config.name(), value); |
| | | } |
| | | //返回正在上线的版本 |
| | | try { |
| | | String value = systemConfigService.getValueCache(acceptData.getSystem(), SystemConfigKey.onLiningVersion); |
| | | JSONObject json = JSONObject.fromObject(value); |
| | | String channel = acceptData.getChannel(); |
| | | if (json.optJSONObject(channel.toLowerCase()) == null) { |
| | | channel = "qq"; |
| | | } |
| | | json = json.optJSONObject(channel.toLowerCase()); |
| | | int onliningVersion = json.optInt("version"); |
| | | if (onliningVersion <= acceptData.getVersion()) { |
| | | //正在上线 |
| | | data.put("onLining", true); |
| | | } else { |
| | | //尚未上线 |
| | | data.put("onLining", false); |
| | | } |
| | | } catch (Exception e) { |
| | | data.put("onLining", false); |
| | | } |
| | | |
| | | SystemConfigKey[] ads = new SystemConfigKey[]{ |
| | | SystemConfigKey.splashAd, |
| | |
| | | List<StatisticNumberResult> statisticByCreateTime(@Param("system") SystemEnum system, @Param("timeQuery") BaseStatisticMySQLTimeQuery timeQuery); |
| | | |
| | | public static class DaoQuery { |
| | | public Long uid; |
| | | public SystemEnum system; |
| | | public Long wxId; |
| | | public Long qqId; |
| | |
| | | appLink(SystemConfigType.system, "应用二合一链接"), |
| | | androidPushAppCode(SystemConfigType.system, "android推送应用编码"), |
| | | androidPushActivity(SystemConfigType.system, "android推送落地页Activity"), |
| | | onLiningVersion(SystemConfigType.system,"正在上线的版本"), |
| | | |
| | | //返回给前端的数据 |
| | | kefu(SystemConfigType.common, "客服链接"), |
| | |
| | | helpLink(SystemConfigType.common, "帮助中心链接"), |
| | | disclaimerLink(SystemConfigType.common, "免责声明链接"), |
| | | |
| | | |
| | | //广告配置 |
| | | splashAd(SystemConfigType.ad, "开屏广告"), |
| | | rewardAd(SystemConfigType.ad, "激励视频广告"), |
| | |
| | | } catch (IllegalAccessException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | daoQuery.sortList= Arrays.asList(new Sort.Order[]{Sort.Order.desc("createTime")}); |
| | | daoQuery.start = (page - 1) * pageSize; |
| | | daoQuery.count = pageSize; |
| | | return goldCornMoneyExchangeRateRecordDao.list(daoQuery); |
| | |
| | | @Override |
| | | public List<UserInfo> list(UserInfoQuery userInfoQuery, int page, int pageSize) { |
| | | DaoQuery daoQuery = new DaoQuery(); |
| | | try { |
| | | BeanUtil.copyProperties(userInfoQuery, daoQuery); |
| | | } catch (IllegalAccessException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | daoQuery.uid=userInfoQuery.getUid(); |
| | | |
| | | daoQuery.sortList = Arrays.asList(new String[]{"create_time desc"}); |
| | | |
| | |
| | | |
| | | public class UserInfoQuery { |
| | | //搜索关键词 |
| | | private String kw; |
| | | private Long uid; |
| | | |
| | | private String getKw(){ |
| | | return kw; |
| | | |
| | | public Long getUid() { |
| | | return uid; |
| | | } |
| | | |
| | | private void setKw(String kw){ |
| | | this.kw = kw; |
| | | public void setUid(Long uid) { |
| | | this.uid = uid; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | spring: |
| | | profiles: |
| | | active: dev |
| | | active: pro |
| | |
| | | </update> |
| | | |
| | | <sql id="listWhere"> |
| | | |
| | | <if test="query.uid!=null"> |
| | | and id = #{query.uid} |
| | | </if> |
| | | |
| | | <if test="query.system!=null"> |
| | | and system = #{query.system} |
| | | </if> |
| | |
| | | </where> |
| | | <if test="query.sortList!=null"> |
| | | <foreach collection="query.sortList" open=" order by " separator="," item="item"> |
| | | #{item} |
| | | ${item} |
| | | </foreach> |
| | | </if> |
| | | limit #{query.start},#{query.count} |
| | |
| | | <span class="x-red">*</span> |
| | | 日期</label> |
| | | <div class="layui-input-block"> |
| | | <input type="date" name="day" lay-verify="required|date" placeholder="" autocomplete="off" |
| | | <input type="text" name="day" lay-verify="required|date" placeholder="" autocomplete="off" |
| | | class="layui-input"> |
| | | </div> |
| | | |
| | |
| | | <div class="layui-form-item"> |
| | | <label for="L_appCode" class="layui-form-label"> |
| | | <span class="x-red">*</span> |
| | | 汇率</label> |
| | | 收入</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" name="rate" lay-verify="required|number" placeholder="1金币兑换的人民币数量" |
| | | <input type="text" name="money" lay-verify="required|number" placeholder="当日收入的人命币金额" |
| | | autocomplete="off" |
| | | class="layui-input"> |
| | | </div> |
| | |
| | | <span class="x-red">*</span> |
| | | 生效时间</label> |
| | | <div class="layui-input-block"> |
| | | <input type="datetime" name="validateTime" id="validateTime" lay-verify="required|datetime" placeholder="生效时间" |
| | | <input type="text" name="validateTime" id="validateTime" lay-verify="required|datetime" placeholder="生效时间" |
| | | autocomplete="off" |
| | | class="layui-input"> |
| | | </div> |
| | |
| | | ,type: 'datetime' |
| | | }); |
| | | |
| | | laydate.render({ |
| | | elem: 'input[name=day]' |
| | | ,type: 'date' |
| | | }); |
| | | |
| | | |
| | | |
| | | var verify = {}; |
| | |
| | | }); |
| | | }, |
| | | deleteList: function (ids, success) { |
| | | ksapp.postJSON("/admin/api/goldcorn/exchangerate/delete", {ids: JSON.stringify(ids)}, function (e) { |
| | | ksapp.post("/admin/api/goldcorn/exchangerate/delete", {ids: JSON.stringify(ids)}, function (e) { |
| | | if (e.code == 0) { |
| | | success(); |
| | | } else { |
| | |
| | | <span class="x-red">*</span> |
| | | 结算日期</label> |
| | | <div class="layui-input-block"> |
| | | <input type="date" name="day" lay-verify="required|date" placeholder="" autocomplete="off" |
| | | <input type="text" name="day" lay-verify="required|date" placeholder="" autocomplete="off" |
| | | class="layui-input"> |
| | | </div> |
| | | |
| | |
| | | </body> |
| | | <script type="text/html" id="toolbar"> |
| | | <div class="layui-btn-container"> |
| | | <button class="layui-btn" onclick="xadmin.open('添加资金结算记录','gold_corn_settle_record_add.html',500,400)"><i |
| | | <button class="layui-btn" onclick="xadmin.open('添加资金结算记录','gold_corn_settle_record_add.html',500,440)"><i |
| | | class="layui-icon"></i>添加结算 |
| | | </button> |
| | | </div> |
| | |
| | | {field: 'totalMoney', width: 120, sort: false, title: "结算金额"}, |
| | | {field: 'userCount', width: 100, sort: false, title: "总结算人数"}, |
| | | {field: 'settledUserCount', width: 120, sort: false, title: "已结算人数",templet:function(res){ |
| | | |
| | | return "<a onclick=\"xadmin.open('已结算用户列表','gold_corn_settled_detail_list.html?eventId="+res.id+"')\" href='javascript:'> "+res.settledUserCount+"</a>" |
| | | return "<a style='color: green;text-decoration: underline;' onclick=\"xadmin.open('已结算用户列表','gold_corn_settled_detail_list.html?eventId="+res.id+"')\" href='javascript:'> "+res.settledUserCount+"</a>" |
| | | }}, |
| | | {field: 'remarks', width: 120, sort: false, title: "备注"}, |
| | | {field: 'createTime', width: 150, sort: false, title: "创建时间"}, |
| | |
| | | {field: 'id', width: 120, sort: false, title: "ID"}, |
| | | { |
| | | field: 'user', width: 120, sort: false, title: "用户", templet: function (res) { |
| | | return res.id; |
| | | return res.user.id; |
| | | } |
| | | }, |
| | | {field: 'money', width: 120, sort: false, title: "金额"}, |
| | |
| | | class="layui-input"> |
| | | </div> |
| | | <div class="layui-inline layui-show-xs-block"> |
| | | <input type="text" name="key" lay-verify="" placeholder="请输入用户ID" autocomplete="off" |
| | | <input type="text" name="uid" lay-verify="" placeholder="请输入用户ID" autocomplete="off" |
| | | class="layui-input"> |
| | | </div> |
| | | <div class="layui-inline layui-show-xs-block"> |
| | |
| | | return false; |
| | | }); |
| | | |
| | | //查询 |
| | | $("#" + chartConfig.type + " .search").click(); |
| | | //延迟查询,防止获取不到表单数据 |
| | | setTimeout(function(){ |
| | | //查询 |
| | | $("#" + chartConfig.type + " .search").click(); |
| | | },1000); |
| | | |
| | | |
| | | } |
| | | |
| | | // $("#search-user").click(); |
New file |
| | |
| | | package test; |
| | | |
| | | import org.yeshi.utils.FileUtil; |
| | | |
| | | import java.io.File; |
| | | import java.io.IOException; |
| | | import java.util.HashSet; |
| | | import java.util.Set; |
| | | |
| | | /** |
| | | * @author hxh |
| | | * @title: Test |
| | | * @description: TODO |
| | | * @date 2022/6/6 18:53 |
| | | */ |
| | | public class Test { |
| | | |
| | | public static void main(String[] args) throws IOException { |
| | | String dir = "C:\\Users\\Administrator\\Desktop\\ocr"; |
| | | File[] fs = new File(dir).listFiles(); |
| | | Set<String> md5Set = new HashSet<>(); |
| | | for (File f : fs) { |
| | | if (f.isDirectory()) { |
| | | continue; |
| | | } |
| | | String md5 = FileUtil.getFileMD5(f); |
| | | if (md5Set.contains(md5)) { |
| | | f.delete(); |
| | | } else { |
| | | md5Set.add(md5); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | } |