| | |
| | | </dependency> |
| | | |
| | | |
| | | <!-- https://mvnrepository.com/artifact/com.google.zxing/core --> |
| | | <dependency> |
| | | <groupId>com.google.zxing</groupId> |
| | | <artifactId>core</artifactId> |
| | | <version>3.3.0</version> |
| | | </dependency> |
| | | |
| | | <!-- https://mvnrepository.com/artifact/com.google.zxing/javase --> |
| | | <dependency> |
| | | <groupId>com.google.zxing</groupId> |
| | | <artifactId>javase</artifactId> |
| | | <version>3.3.0</version> |
| | | </dependency> |
| | | |
| | | |
| | | </dependencies> |
| | | |
| | | |
| | |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.boot.SpringApplication; |
| | | import org.springframework.boot.autoconfigure.SpringBootApplication; |
| | | import org.springframework.boot.web.servlet.MultipartConfigFactory; |
| | | import org.springframework.context.ApplicationListener; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.event.ContextRefreshedEvent; |
| | | import org.springframework.transaction.annotation.EnableTransactionManagement; |
| | | import org.yeshi.utils.mq.JobThreadExecutorServiceImpl; |
| | | import org.yeshi.utils.tencentcloud.COSManager; |
| | | import org.yeshi.utils.tencentcloud.entity.COSInitParams; |
| | | |
| | | import javax.servlet.MultipartConfigElement; |
| | | import java.io.File; |
| | | import java.util.Properties; |
| | | |
| | | //不引入数据库 |
| | |
| | | COSManager.getInstance().init(params); |
| | | } |
| | | |
| | | @Bean |
| | | MultipartConfigElement multipartConfigElement() { |
| | | MultipartConfigFactory factory = new MultipartConfigFactory(); |
| | | String location = System.getProperty("user.dir") + "/data/tmp"; |
| | | File tmpFile = new File(location); |
| | | if (!tmpFile.exists()) { |
| | | tmpFile.mkdirs(); |
| | | } |
| | | factory.setLocation(location); |
| | | return factory.createMultipartConfig(); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.yeshi.makemoney.app.controller.admin; |
| | | |
| | | import com.yeshi.makemoney.app.Application; |
| | | import com.yeshi.makemoney.app.service.inter.AdminUserService; |
| | | import com.yeshi.makemoney.app.utils.ImageUtil; |
| | | import net.sf.json.JSONObject; |
| | | import org.apache.commons.codec.digest.DigestUtils; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | import org.yeshi.utils.JsonUtil; |
| | | import org.yeshi.utils.entity.FileUploadResult; |
| | | import org.yeshi.utils.tencentcloud.COSManager; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpSession; |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | | import java.util.Properties; |
| | | |
| | | @Controller |
| | | @RequestMapping("/admin/api/file") |
| | | public class FileController { |
| | | |
| | | |
| | | @ResponseBody |
| | | @RequestMapping("uploadImg") |
| | | public String uploadImg(@RequestParam("file_url") MultipartFile file, String type, HttpSession session) throws IOException { |
| | | String md5 = DigestUtils.md5Hex(file.getBytes()); |
| | | InputStream inputStream = file.getInputStream(); |
| | | String contentType = file.getContentType(); |
| | | String fileType = contentType.substring(contentType.indexOf("/") + 1); |
| | | String key = "/imgs/" + type + "/" + md5 + "." + fileType; |
| | | FileUploadResult result = COSManager.getInstance().uploadFile(inputStream, key); |
| | | if (result == null) { |
| | | return JsonUtil.loadFalseResult("上传出错"); |
| | | } |
| | | JSONObject data = new JSONObject(); |
| | | data.put("url", ImageUtil.getCOSImageUrl(key)); |
| | | data.put("md5", result.getMd5()); |
| | | return JsonUtil.loadTrueResult(data); |
| | | } |
| | | |
| | | } |
| | |
| | | @ResponseBody |
| | | @RequestMapping("list") |
| | | public String list(SystemConfigQuery query, int page, int limit, String callback) { |
| | | List<SystemConfig> list = systemConfigService.listByType(SystemConfigType.common); |
| | | List<SystemConfig> list = systemConfigService.listByType(query.getType() == null ? SystemConfigType.common : query.getType()); |
| | | long count = list.size(); |
| | | JSONObject data = new JSONObject(); |
| | | Gson gson = new GsonBuilder().registerTypeAdapter(Date.class, new JsonSerializer<Date>() { |
| | |
| | | |
| | | @ResponseBody |
| | | @RequestMapping("getKeyList") |
| | | public String getKeyList() { |
| | | public String getKeyList(SystemConfigType type) { |
| | | JSONArray array = new JSONArray(); |
| | | for (SystemConfigKey key : SystemConfigKey.values()) { |
| | | if (key.getType() == SystemConfigType.common) { |
| | | if (key.getType() == (type == null ? SystemConfigType.common : type)) { |
| | | JSONObject data = new JSONObject(); |
| | | data.put("key", key.name()); |
| | | data.put("value", key.getDesc()); |
| | |
| | | package com.yeshi.makemoney.app.controller.admin.money; |
| | | |
| | | import com.google.gson.*; |
| | | import com.yeshi.makemoney.app.aop.AdminApiFilter; |
| | | import com.yeshi.makemoney.app.dto.money.ExtractConfig; |
| | | import com.yeshi.makemoney.app.entity.config.SystemConfig; |
| | | import com.yeshi.makemoney.app.entity.config.SystemConfigKey; |
| | | import com.yeshi.makemoney.app.entity.money.ExtractPayType; |
| | | import com.yeshi.makemoney.app.service.inter.config.SystemConfigService; |
| | | import com.yeshi.makemoney.app.vo.AcceptAdminData; |
| | | import net.sf.json.JSONArray; |
| | | import net.sf.json.JSONObject; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | 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.TimeUtil; |
| | | import com.google.gson.reflect.TypeToken; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpSession; |
| | | import java.lang.reflect.Type; |
| | | import java.math.BigDecimal; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | |
| | | |
| | | @Resource |
| | | private ExtractService extractService; |
| | | |
| | | @Resource |
| | | private SystemConfigService systemConfigService; |
| | | |
| | | |
| | | @ResponseBody |
| | |
| | | } |
| | | } |
| | | |
| | | @ResponseBody |
| | | @RequestMapping("getExtractConfig") |
| | | public String getExtractConfig(AcceptAdminData acceptAdminData) { |
| | | SystemConfig config = systemConfigService.getByKey(acceptAdminData.getSystem(), SystemConfigKey.extractConfig); |
| | | ExtractConfig extractConfig = null; |
| | | if (config != null && !StringUtil.isNullOrEmpty(config.getValue())) { |
| | | extractConfig = new Gson().fromJson(config.getValue(), ExtractConfig.class); |
| | | } |
| | | |
| | | if (extractConfig == null) { |
| | | extractConfig = new ExtractConfig(); |
| | | extractConfig.setNewerLittleMoneyNum(0); |
| | | extractConfig.setMaxMoney(new BigDecimal(0)); |
| | | extractConfig.setMaxMoneyPerDay(new BigDecimal(0)); |
| | | extractConfig.setMaxNumPerDay(0); |
| | | extractConfig.setMinMoney(new BigDecimal(0)); |
| | | extractConfig.setExtractMoneyList(new ArrayList<>()); |
| | | } |
| | | |
| | | return JsonUtil.loadTrueResult(extractConfig); |
| | | |
| | | } |
| | | |
| | | @ResponseBody |
| | | @RequestMapping("updateExtractConfig") |
| | | public String updateExtractConfig(@RequestBody ExtractConfig extractConfig, AcceptAdminData acceptAdminData) { |
| | | SystemConfig config = systemConfigService.getByKey(acceptAdminData.getSystem(), SystemConfigKey.extractConfig); |
| | | if (config == null) { |
| | | SystemConfig newConfig = new SystemConfig(); |
| | | newConfig.setSystem(acceptAdminData.getSystem()); |
| | | newConfig.setKey(SystemConfigKey.extractConfig); |
| | | newConfig.setValue(new Gson().toJson(extractConfig)); |
| | | try { |
| | | systemConfigService.add(newConfig); |
| | | } catch (Exception e) { |
| | | return JsonUtil.loadFalseResult(e.getMessage()); |
| | | } |
| | | } else { |
| | | SystemConfig newConfig = new SystemConfig(); |
| | | newConfig.setId(config.getId()); |
| | | newConfig.setValue(new Gson().toJson(extractConfig)); |
| | | systemConfigService.update(newConfig); |
| | | } |
| | | return JsonUtil.loadTrueResult(""); |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.yeshi.makemoney.app.controller.admin.team; |
| | | |
| | | import com.google.gson.*; |
| | | import com.yeshi.makemoney.app.vo.AcceptAdminData; |
| | | import com.yeshi.makemoney.app.vo.admin.team.SpreadImgAdminVO; |
| | | import net.sf.json.JSONArray; |
| | | import net.sf.json.JSONObject; |
| | | import org.apache.commons.codec.digest.DigestUtils; |
| | | import org.apache.commons.io.IOUtils; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | import org.yeshi.utils.FileUtil; |
| | | import org.yeshi.utils.HttpUtil; |
| | | import org.yeshi.utils.JsonUtil; |
| | | import org.yeshi.utils.TimeUtil; |
| | | import com.google.gson.reflect.TypeToken; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpSession; |
| | | import java.io.FileInputStream; |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | | import java.lang.reflect.Type; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | import com.yeshi.makemoney.app.entity.team.SpreadImg; |
| | | import com.yeshi.makemoney.app.service.inter.team.SpreadImgService; |
| | | import com.yeshi.makemoney.app.service.query.team.SpreadImgQuery; |
| | | import org.yeshi.utils.exception.HttpException; |
| | | |
| | | @Controller |
| | | @RequestMapping("/admin/api/team/spreadimg") |
| | | public class SpreadImgAdminController { |
| | | |
| | | @Resource |
| | | private SpreadImgService spreadImgService; |
| | | |
| | | |
| | | @ResponseBody |
| | | @RequestMapping("list") |
| | | public String list(SpreadImgQuery query, int page, int limit) { |
| | | List<SpreadImg> list = spreadImgService.list(query, page, limit); |
| | | long count = spreadImgService.count(query); |
| | | JSONObject data = new JSONObject(); |
| | | Gson gson = new GsonBuilder().registerTypeAdapter(Date.class, new JsonSerializer<Date>() { |
| | | |
| | | @Override |
| | | public JsonElement serialize(Date date, Type type, JsonSerializationContext jsonSerializationContext) { |
| | | return date == null ? new JsonPrimitive("") : new JsonPrimitive(TimeUtil.getGernalTime(date.getTime(), "yyyy.MM.dd HH:mm")); |
| | | } |
| | | }).create(); |
| | | |
| | | data.put("list", gson.toJson(list)); |
| | | data.put("count", count); |
| | | return JsonUtil.loadTrueResult(data); |
| | | |
| | | } |
| | | |
| | | @ResponseBody |
| | | @RequestMapping("delete") |
| | | public String delete(String ids) { |
| | | Type type = new TypeToken<List<String>>() { |
| | | }.getType(); |
| | | List<String> idList = new Gson().fromJson(ids, type); |
| | | spreadImgService.delete(idList); |
| | | return JsonUtil.loadTrueResult(""); |
| | | } |
| | | |
| | | @ResponseBody |
| | | @RequestMapping("add") |
| | | public String add(SpreadImgAdminVO bean, AcceptAdminData acceptAdminData) { |
| | | //获取MD5 |
| | | String md5 = null; |
| | | try { |
| | | InputStream inputStream = HttpUtil.downLoadImg(bean.getUrl()); |
| | | md5 = DigestUtils.md5Hex(IOUtils.toByteArray(inputStream)); |
| | | } catch (Exception e) { |
| | | return JsonUtil.loadFalseResult("无法获取图片MD5"); |
| | | } |
| | | |
| | | |
| | | try { |
| | | SpreadImg be = bean.toEntity(acceptAdminData.getSystem()); |
| | | be.setId(be.toId(md5)); |
| | | spreadImgService.add(be); |
| | | return JsonUtil.loadTrueResult(""); |
| | | |
| | | } catch (Exception e) { |
| | | return JsonUtil.loadFalseResult(e.getMessage()); |
| | | |
| | | } |
| | | } |
| | | |
| | | @ResponseBody |
| | | @RequestMapping("get") |
| | | public String get(String id, HttpSession session) { |
| | | SpreadImg entity = spreadImgService.get(id); |
| | | if (entity != null) { |
| | | return JsonUtil.loadTrueResult(SpreadImgAdminVO.create(entity)); |
| | | |
| | | } else { |
| | | return JsonUtil.loadFalseResult("ID不存在"); |
| | | |
| | | } |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @RequestMapping("update") |
| | | public String update(SpreadImgAdminVO bean, HttpSession session) { |
| | | if (bean.getId() == null) { |
| | | return JsonUtil.loadFalseResult("ID不能为空"); |
| | | } |
| | | try { |
| | | spreadImgService.update(bean.toEntity(null)); |
| | | } catch (Exception e) { |
| | | return JsonUtil.loadFalseResult(e.getMessage()); |
| | | } |
| | | return JsonUtil.loadTrueResult(""); |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.yeshi.makemoney.app.controller.admin.team; |
| | | |
| | | import com.google.gson.*; |
| | | import net.sf.json.JSONArray; |
| | | import net.sf.json.JSONObject; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | import org.yeshi.utils.JsonUtil; |
| | | import org.yeshi.utils.TimeUtil; |
| | | import com.google.gson.reflect.TypeToken; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpSession; |
| | | import java.lang.reflect.Type; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import com.yeshi.makemoney.app.entity.team.UserSpreadImg; |
| | | import com.yeshi.makemoney.app.service.inter.team.UserSpreadImgService; |
| | | import com.yeshi.makemoney.app.service.query.team.UserSpreadImgQuery; |
| | | @Controller |
| | | @RequestMapping("/admin/api/team/userspreadimg") |
| | | public class UserSpreadImgAdminController { |
| | | |
| | | @Resource |
| | | private UserSpreadImgService userSpreadImgService; |
| | | |
| | | |
| | | @ResponseBody |
| | | @RequestMapping("list") |
| | | public String list(UserSpreadImgQuery query, int page, int limit ) { |
| | | List<UserSpreadImg> list = userSpreadImgService.list(query,page,limit); |
| | | long count = userSpreadImgService.count(query); |
| | | JSONObject data = new JSONObject(); |
| | | Gson gson = new GsonBuilder().registerTypeAdapter(Date.class, new JsonSerializer<Date>() { |
| | | |
| | | @Override |
| | | public JsonElement serialize(Date date, Type type, JsonSerializationContext jsonSerializationContext) { |
| | | return date == null ? new JsonPrimitive("") : new JsonPrimitive(TimeUtil.getGernalTime(date.getTime(), "yyyy.MM.dd HH:mm")); |
| | | } |
| | | }).create(); |
| | | |
| | | data.put("list", gson.toJson(list)); |
| | | data.put("count", count); |
| | | return JsonUtil.loadTrueResult(data); |
| | | |
| | | } |
| | | |
| | | @ResponseBody |
| | | @RequestMapping("delete") |
| | | public String delete(String ids) { |
| | | Type type = new TypeToken<List<String>>(){}.getType(); |
| | | List<String> idList=new Gson().fromJson(ids,type); |
| | | userSpreadImgService.delete(idList); |
| | | return JsonUtil.loadTrueResult(""); |
| | | |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @RequestMapping("get") |
| | | public String get(String id, HttpSession session) { |
| | | UserSpreadImg entity = userSpreadImgService.get(id); |
| | | if (entity !=null){ |
| | | return JsonUtil.loadTrueResult(entity); |
| | | |
| | | } else { |
| | | return JsonUtil.loadFalseResult("ID不存在"); |
| | | |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | import java.util.List; |
| | | import java.util.Date; |
| | | |
| | | import org.yeshi.utils.mongo.MongodbBaseDao; |
| | | import com.yeshi.makemoney.app.entity.goldcorn.GoldCornGetPrice; |
| | | |
| | | import java.lang.String; |
| | | |
| | | import com.yeshi.makemoney.app.entity.goldcorn.GoldCornGetType; |
| | | |
| | | import java.lang.Integer; |
| | | |
| | | import com.yeshi.makemoney.app.entity.SystemEnum; |
| | | |
| | | import java.util.ArrayList; |
| | | |
| | | |
| | |
| | | if(bean.getRemarks() != null) { |
| | | update.set("remarks", bean.getRemarks()); |
| | | } |
| | | |
| | | if (bean.getTeamGainRate() != null) { |
| | | update.set("teamGainRate", bean.getTeamGainRate()); |
| | | } |
| | | if (bean.getTeamDivide() != null) { |
| | | update.set("teamDivide", bean.getTeamDivide()); |
| | | } |
| | | |
| | | |
| | | if(bean.getCreateTime() != null) { |
| | | update.set("createTime", bean.getCreateTime()); |
| | | } |
| | |
| | | public Long uid; |
| | | public ExtractPayType type; |
| | | public Integer state; |
| | | public List<Integer> stateList; |
| | | public Date maxSuccessTime; |
| | | public Date minSuccessTime; |
| | | public Date maxCreateTime; |
| | | public Date minCreateTime; |
| | | public BigDecimal minMoney; |
| | | public BigDecimal maxMoney; |
| | | public long start; |
| | | public int count; |
| | | public List<String> sortList; |
New file |
| | |
| | | package com.yeshi.makemoney.app.dao.money; |
| | | |
| | | import org.springframework.data.mongodb.core.query.Criteria; |
| | | import org.springframework.data.mongodb.core.query.Query; |
| | | import org.springframework.data.mongodb.core.query.Update; |
| | | import org.springframework.data.domain.Sort; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import java.util.List; |
| | | import java.lang.Long; |
| | | import java.util.Date; |
| | | |
| | | import org.yeshi.utils.mongo.MongodbBaseDao; |
| | | import com.yeshi.makemoney.app.entity.money.UserExtractMoneyLimit; |
| | | |
| | | import java.lang.String; |
| | | import java.lang.Integer; |
| | | import java.util.ArrayList; |
| | | |
| | | |
| | | @Repository |
| | | public class UserExtractMoneyLimitDao extends MongodbBaseDao<UserExtractMoneyLimit> { |
| | | |
| | | public void updateSelective(UserExtractMoneyLimit bean) { |
| | | Query query = new Query(); |
| | | Update update = new Update(); |
| | | query.addCriteria(Criteria.where("id").is(bean.getId())); |
| | | if (bean.getUid() != null) { |
| | | update.set("uid", bean.getUid()); |
| | | } |
| | | if (bean.getDay() != null) { |
| | | update.set("day", bean.getDay()); |
| | | } |
| | | if (bean.getMinMoney() != null) { |
| | | update.set("minMoney", bean.getMinMoney()); |
| | | } |
| | | if (bean.getMaxMoney() != null) { |
| | | update.set("maxMoney", bean.getMaxMoney()); |
| | | } |
| | | if (bean.getCount() != null) { |
| | | update.set("count", bean.getCount()); |
| | | } |
| | | if (bean.getCreateTime() != null) { |
| | | update.set("createTime", bean.getCreateTime()); |
| | | } |
| | | update.set("updateTime", new Date()); |
| | | update(query, update); |
| | | } |
| | | |
| | | |
| | | public List<UserExtractMoneyLimit> list(DaoQuery daoQuery) { |
| | | Query query = getQuery(daoQuery); |
| | | if (daoQuery.sortList != null && daoQuery.sortList.size() > 0) { |
| | | query.with(Sort.by(daoQuery.sortList)); |
| | | } |
| | | query.skip(daoQuery.start); |
| | | query.limit(daoQuery.count); |
| | | return findList(query); |
| | | } |
| | | |
| | | public long count(DaoQuery daoQuery) { |
| | | Query query = getQuery(daoQuery); |
| | | return count(query); |
| | | } |
| | | |
| | | private Query getQuery(DaoQuery daoQuery) { |
| | | List<Criteria> andList = new ArrayList<>(); |
| | | if (daoQuery.uid != null) { |
| | | andList.add(Criteria.where("uid").is(daoQuery.uid)); |
| | | } |
| | | if (daoQuery.day != null) { |
| | | andList.add(Criteria.where("day").is(daoQuery.day)); |
| | | } |
| | | Query query = new Query(); |
| | | Criteria[] ands = new Criteria[andList.size()]; |
| | | andList.toArray(ands); |
| | | if (ands.length > 0) { |
| | | query.addCriteria(new Criteria().andOperator(ands)); |
| | | } |
| | | return query; |
| | | } |
| | | |
| | | public static class DaoQuery { |
| | | public Long uid; |
| | | public String day; |
| | | public int start; |
| | | public int count; |
| | | public List<Sort.Order> sortList; |
| | | } |
| | | } |
New file |
| | |
| | | package com.yeshi.makemoney.app.dao.team; |
| | | |
| | | import com.yeshi.makemoney.app.entity.SystemEnum; |
| | | import org.springframework.data.mongodb.core.query.Criteria; |
| | | import org.springframework.data.mongodb.core.query.Query; |
| | | import org.springframework.data.mongodb.core.query.Update; |
| | | import org.springframework.data.domain.Sort; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import java.util.List; |
| | | import java.util.Date; |
| | | |
| | | import org.yeshi.utils.mongo.MongodbBaseDao; |
| | | |
| | | import java.lang.Boolean; |
| | | import java.lang.String; |
| | | import java.util.ArrayList; |
| | | |
| | | import com.yeshi.makemoney.app.entity.team.SpreadImg; |
| | | |
| | | |
| | | @Repository |
| | | public class SpreadImgDao extends MongodbBaseDao<SpreadImg> { |
| | | |
| | | public void updateSelective(SpreadImg bean) { |
| | | Query query = new Query(); |
| | | Update update = new Update(); |
| | | query.addCriteria(Criteria.where("id").is(bean.getId())); |
| | | if (bean.getUrl() != null) { |
| | | update.set("url", bean.getUrl()); |
| | | } |
| | | if (bean.getShow() != null) { |
| | | update.set("show", bean.getShow()); |
| | | } |
| | | if (bean.getStartTime() != null) { |
| | | update.set("startTime", bean.getStartTime()); |
| | | } |
| | | if (bean.getEndTime() != null) { |
| | | update.set("endTime", bean.getEndTime()); |
| | | } |
| | | if (bean.getCreateTime() != null) { |
| | | update.set("createTime", bean.getCreateTime()); |
| | | } |
| | | update.set("updateTime", new Date()); |
| | | update(query, update); |
| | | } |
| | | |
| | | |
| | | public List<SpreadImg> list(DaoQuery daoQuery) { |
| | | Query query = getQuery(daoQuery); |
| | | if (daoQuery.sortList != null && daoQuery.sortList.size() > 0) { |
| | | query.with(Sort.by(daoQuery.sortList)); |
| | | } |
| | | query.skip(daoQuery.start); |
| | | query.limit(daoQuery.count); |
| | | return findList(query); |
| | | } |
| | | |
| | | public long count(DaoQuery daoQuery) { |
| | | Query query = getQuery(daoQuery); |
| | | return count(query); |
| | | } |
| | | |
| | | private Query getQuery(DaoQuery daoQuery) { |
| | | List<Criteria> andList = new ArrayList<>(); |
| | | if (daoQuery.show != null) { |
| | | andList.add(Criteria.where("show").is(daoQuery.show)); |
| | | } |
| | | if (daoQuery.system != null) { |
| | | andList.add(Criteria.where("system").is(daoQuery.system)); |
| | | } |
| | | |
| | | if (daoQuery.date != null) { |
| | | andList.add(Criteria.where("startTime").lte(daoQuery.date).and("endTime").gt(daoQuery.date)); |
| | | } |
| | | |
| | | Query query = new Query(); |
| | | Criteria[] ands = new Criteria[andList.size()]; |
| | | andList.toArray(ands); |
| | | if (ands.length > 0) { |
| | | query.addCriteria(new Criteria().andOperator(ands)); |
| | | } |
| | | return query; |
| | | } |
| | | |
| | | public static class DaoQuery { |
| | | public Boolean show; |
| | | public SystemEnum system; |
| | | public Date date; |
| | | public int start; |
| | | public int count; |
| | | public List<Sort.Order> sortList; |
| | | } |
| | | } |
New file |
| | |
| | | package com.yeshi.makemoney.app.dao.team; |
| | | |
| | | import org.springframework.data.mongodb.core.query.Criteria; |
| | | import org.springframework.data.mongodb.core.query.Query; |
| | | import org.springframework.data.mongodb.core.query.Update; |
| | | import org.springframework.data.domain.Sort; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import com.yeshi.makemoney.app.entity.team.UserSpreadImg; |
| | | import java.util.List; |
| | | import java.lang.Long; |
| | | import java.util.Date; |
| | | import org.yeshi.utils.mongo.MongodbBaseDao; |
| | | import java.lang.String; |
| | | import java.util.ArrayList; |
| | | |
| | | |
| | | @Repository |
| | | public class UserSpreadImgDao extends MongodbBaseDao<UserSpreadImg>{ |
| | | |
| | | public void updateSelective(UserSpreadImg bean) { |
| | | Query query = new Query(); |
| | | Update update=new Update(); |
| | | query.addCriteria(Criteria.where("id").is(bean.getId())); |
| | | if(bean.getUid() != null) { |
| | | update.set("uid", bean.getUid()); |
| | | } |
| | | if(bean.getUrl() != null) { |
| | | update.set("url", bean.getUrl()); |
| | | } |
| | | if(bean.getSourceMD5() != null) { |
| | | update.set("sourceMD5", bean.getSourceMD5()); |
| | | } |
| | | if(bean.getCreateTime() != null) { |
| | | update.set("createTime", bean.getCreateTime()); |
| | | } |
| | | update.set("updateTime", new Date()); |
| | | update(query, update); |
| | | } |
| | | |
| | | |
| | | public List<UserSpreadImg> list(DaoQuery daoQuery){ |
| | | Query query = getQuery(daoQuery); |
| | | if (daoQuery.sortList!=null && daoQuery.sortList.size()>0){ |
| | | query.with(Sort.by(daoQuery.sortList)); |
| | | } |
| | | query.skip(daoQuery.start); |
| | | query.limit(daoQuery.count); |
| | | return findList(query); |
| | | } |
| | | |
| | | public long count(DaoQuery daoQuery){ |
| | | Query query=getQuery(daoQuery); |
| | | return count(query); |
| | | } |
| | | |
| | | private Query getQuery(DaoQuery daoQuery){ |
| | | List<Criteria> andList=new ArrayList<>(); |
| | | if(daoQuery.uid!=null){ |
| | | andList.add(Criteria.where("uid").is(daoQuery.uid)); |
| | | } |
| | | if(daoQuery.sourceMD5!=null){ |
| | | andList.add(Criteria.where("sourceMD5").is(daoQuery.sourceMD5)); |
| | | } |
| | | Query query=new Query(); |
| | | Criteria[] ands=new Criteria[andList.size()]; |
| | | andList.toArray(ands); |
| | | if(ands.length>0){ |
| | | query.addCriteria(new Criteria().andOperator(ands)); |
| | | } |
| | | return query; |
| | | } |
| | | |
| | | public static class DaoQuery{ |
| | | public Long uid; |
| | | public String sourceMD5; |
| | | public int start; |
| | | public int count; |
| | | public List<Sort.Order> sortList; |
| | | } |
| | | } |
New file |
| | |
| | | package com.yeshi.makemoney.app.dao.user; |
| | | |
| | | import org.springframework.data.mongodb.core.query.Criteria; |
| | | import org.springframework.data.mongodb.core.query.Query; |
| | | import org.springframework.data.mongodb.core.query.Update; |
| | | import org.springframework.data.domain.Sort; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import java.util.List; |
| | | import com.yeshi.makemoney.app.entity.user.UserExtraInfo; |
| | | import java.util.Date; |
| | | import org.yeshi.utils.mongo.MongodbBaseDao; |
| | | import java.lang.String; |
| | | import java.lang.Integer; |
| | | import java.util.ArrayList; |
| | | |
| | | |
| | | @Repository |
| | | public class UserExtraInfoDao extends MongodbBaseDao<UserExtraInfo>{ |
| | | |
| | | public void updateSelective(UserExtraInfo bean) { |
| | | Query query = new Query(); |
| | | Update update=new Update(); |
| | | query.addCriteria(Criteria.where("id").is(bean.getId())); |
| | | if(bean.getInviteCode() != null) { |
| | | update.set("inviteCode", bean.getInviteCode()); |
| | | } |
| | | if(bean.getUnReadMsgCount() != null) { |
| | | update.set("unReadMsgCount", bean.getUnReadMsgCount()); |
| | | } |
| | | if(bean.getCreateTime() != null) { |
| | | update.set("createTime", bean.getCreateTime()); |
| | | } |
| | | update.set("updateTime", new Date()); |
| | | update(query, update); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | package com.yeshi.makemoney.app.dto.money; |
| | | |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author hxh |
| | |
| | | /** |
| | | * 首次提现的最小金额 |
| | | **/ |
| | | private BigDecimal firstMinMoney; |
| | | private Integer newerLittleMoneyNum; |
| | | |
| | | /** |
| | | * 提现金额 |
| | | **/ |
| | | |
| | | private List<BigDecimal> extractMoneyList; |
| | | |
| | | |
| | | public BigDecimal getMaxMoney() { |
| | |
| | | this.maxMoneyPerDay = maxMoneyPerDay; |
| | | } |
| | | |
| | | public BigDecimal getFirstMinMoney() { |
| | | return firstMinMoney; |
| | | |
| | | public Integer getNewerLittleMoneyNum() { |
| | | return newerLittleMoneyNum; |
| | | } |
| | | |
| | | public void setFirstMinMoney(BigDecimal firstMinMoney) { |
| | | this.firstMinMoney = firstMinMoney; |
| | | public void setNewerLittleMoneyNum(Integer newerLittleMoneyNum) { |
| | | this.newerLittleMoneyNum = newerLittleMoneyNum; |
| | | } |
| | | |
| | | public List<BigDecimal> getExtractMoneyList() { |
| | | return extractMoneyList; |
| | | } |
| | | |
| | | public void setExtractMoneyList(List<BigDecimal> extractMoneyList) { |
| | | this.extractMoneyList = extractMoneyList; |
| | | } |
| | | } |
| | |
| | | tencentSMSAppKey(SystemConfigType.system, "腾讯云短信APPKey"), |
| | | tencentVerifySMSTemplate(SystemConfigType.system, "腾讯云验证码短信模板"), |
| | | testAccount(SystemConfigType.system, "测试账号"), |
| | | appLink(SystemConfigType.system, "应用二合一链接"), |
| | | |
| | | //返回给前端的数据 |
| | | kefu(SystemConfigType.common, "客服链接"), |
| | |
| | | import org.springframework.data.annotation.Id; |
| | | import org.springframework.data.mongodb.core.mapping.Document; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | |
| | | * 金币数量 |
| | | */ |
| | | private Integer cornNum; |
| | | |
| | | /** |
| | | * 加入团队后的金币增益 |
| | | */ |
| | | private BigDecimal teamGainRate; |
| | | |
| | | /** |
| | | * 生效时间 |
| | | */ |
| | | private Date validateTime; |
| | | |
| | | |
| | | /** |
| | | * 是否团队分成 |
| | | */ |
| | | private Boolean teamDivide; |
| | | |
| | | /** |
| | | * 备注 |
| | |
| | | public void setRemarks(String remarks) { |
| | | this.remarks = remarks; |
| | | } |
| | | |
| | | public BigDecimal getTeamGainRate() { |
| | | return teamGainRate; |
| | | } |
| | | |
| | | public void setTeamGainRate(BigDecimal teamGainRate) { |
| | | this.teamGainRate = teamGainRate; |
| | | } |
| | | |
| | | public Boolean getTeamDivide() { |
| | | return teamDivide; |
| | | } |
| | | |
| | | public void setTeamDivide(Boolean teamDivide) { |
| | | this.teamDivide = teamDivide; |
| | | } |
| | | } |
| | |
| | | @Indexed |
| | | private String fromId; |
| | | |
| | | /** |
| | | * 是否属于加倍 |
| | | **/ |
| | | private Boolean isDubble; |
| | | |
| | | @Indexed |
| | | private GoldCornGetType type; |
| | | private String remarks; |
| | |
| | | private Integer level; |
| | | |
| | | public String toId() { |
| | | return uid + "-" + type.name() + "-" + createTime.getTime(); |
| | | String st = uid + "-" + type.name() + "-" + createTime.getTime(); |
| | | if (isDubble != null && isDubble) { |
| | | st += "-double"; |
| | | } |
| | | return st; |
| | | } |
| | | |
| | | |
| | |
| | | public void setLevel(Integer level) { |
| | | this.level = level; |
| | | } |
| | | |
| | | public Boolean getDubble() { |
| | | return isDubble; |
| | | } |
| | | |
| | | public void setDubble(Boolean dubble) { |
| | | isDubble = dubble; |
| | | } |
| | | } |
New file |
| | |
| | | package com.yeshi.makemoney.app.entity.money; |
| | | |
| | | import org.springframework.data.annotation.Id; |
| | | import org.springframework.data.mongodb.core.index.Indexed; |
| | | import org.springframework.data.mongodb.core.mapping.Document; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author hxh |
| | | * @title: UserExtractMoneyLimit |
| | | * @description: 用户提现金额限制 |
| | | * @date 2022/4/8 14:30 |
| | | */ |
| | | @Document(collection = "userExtractMoneyLimit") |
| | | public class UserExtractMoneyLimit { |
| | | |
| | | @Id |
| | | private String id; |
| | | @Indexed |
| | | private Long uid; |
| | | @Indexed |
| | | private String day; |
| | | /** |
| | | * 最小金额(单位:分) |
| | | **/ |
| | | private Integer minMoney; |
| | | /** |
| | | * 最大金额(单位:分) |
| | | **/ |
| | | private Integer maxMoney; |
| | | |
| | | private Integer count; |
| | | |
| | | private Date createTime; |
| | | |
| | | private Date updateTime; |
| | | |
| | | public String toId() { |
| | | return uid + "-" + day + "-" + minMoney + "-" + maxMoney; |
| | | } |
| | | |
| | | |
| | | public String getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(String id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public Long getUid() { |
| | | return uid; |
| | | } |
| | | |
| | | public void setUid(Long uid) { |
| | | this.uid = uid; |
| | | } |
| | | |
| | | public String getDay() { |
| | | return day; |
| | | } |
| | | |
| | | public void setDay(String day) { |
| | | this.day = day; |
| | | } |
| | | |
| | | public Integer getMinMoney() { |
| | | return minMoney; |
| | | } |
| | | |
| | | public void setMinMoney(Integer minMoney) { |
| | | this.minMoney = minMoney; |
| | | } |
| | | |
| | | public Integer getMaxMoney() { |
| | | return maxMoney; |
| | | } |
| | | |
| | | public void setMaxMoney(Integer maxMoney) { |
| | | this.maxMoney = maxMoney; |
| | | } |
| | | |
| | | public Integer getCount() { |
| | | return count; |
| | | } |
| | | |
| | | public void setCount(Integer count) { |
| | | this.count = count; |
| | | } |
| | | |
| | | public Date getCreateTime() { |
| | | return createTime; |
| | | } |
| | | |
| | | public void setCreateTime(Date createTime) { |
| | | this.createTime = createTime; |
| | | } |
| | | |
| | | public Date getUpdateTime() { |
| | | return updateTime; |
| | | } |
| | | |
| | | public void setUpdateTime(Date updateTime) { |
| | | this.updateTime = updateTime; |
| | | } |
| | | } |
New file |
| | |
| | | package com.yeshi.makemoney.app.entity.team; |
| | | |
| | | import com.yeshi.makemoney.app.entity.SystemEnum; |
| | | import org.springframework.data.annotation.Id; |
| | | import org.springframework.data.mongodb.core.mapping.Document; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author hxh |
| | | * @title: SpreadImg |
| | | * @description: 邀请图素材 |
| | | * @date 2022/4/8 16:39 |
| | | */ |
| | | @Document(collection = "spreadImg") |
| | | public class SpreadImg { |
| | | @Id |
| | | private String id; |
| | | private String url; |
| | | private SystemEnum system; |
| | | private Boolean show; |
| | | private Date startTime; |
| | | private Date endTime; |
| | | private Date createTime; |
| | | private Date updateTime; |
| | | |
| | | |
| | | public String toId(String md5) { |
| | | return system.name() + "-" + md5; |
| | | } |
| | | |
| | | public String getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(String id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getUrl() { |
| | | return url; |
| | | } |
| | | |
| | | public void setUrl(String url) { |
| | | this.url = url; |
| | | } |
| | | |
| | | public Date getCreateTime() { |
| | | return createTime; |
| | | } |
| | | |
| | | public void setCreateTime(Date createTime) { |
| | | this.createTime = createTime; |
| | | } |
| | | |
| | | public Date getUpdateTime() { |
| | | return updateTime; |
| | | } |
| | | |
| | | public void setUpdateTime(Date updateTime) { |
| | | this.updateTime = updateTime; |
| | | } |
| | | |
| | | public Boolean getShow() { |
| | | return show; |
| | | } |
| | | |
| | | public void setShow(Boolean show) { |
| | | this.show = show; |
| | | } |
| | | |
| | | public Date getStartTime() { |
| | | return startTime; |
| | | } |
| | | |
| | | public void setStartTime(Date startTime) { |
| | | this.startTime = startTime; |
| | | } |
| | | |
| | | public Date getEndTime() { |
| | | return endTime; |
| | | } |
| | | |
| | | public void setEndTime(Date endTime) { |
| | | this.endTime = endTime; |
| | | } |
| | | |
| | | public SystemEnum getSystem() { |
| | | return system; |
| | | } |
| | | |
| | | public void setSystem(SystemEnum system) { |
| | | this.system = system; |
| | | } |
| | | } |
New file |
| | |
| | | package com.yeshi.makemoney.app.entity.team; |
| | | |
| | | import org.springframework.data.annotation.Id; |
| | | import org.springframework.data.mongodb.core.index.Indexed; |
| | | import org.springframework.data.mongodb.core.mapping.Document; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author hxh |
| | | * @title: UserSpreadImg |
| | | * @description: 用户分享图素材 |
| | | * @date 2022/4/8 16:42 |
| | | */ |
| | | @Document(collection = "userSpreadImg") |
| | | public class UserSpreadImg { |
| | | @Id |
| | | private String id; |
| | | @Indexed |
| | | private Long uid; |
| | | private String url; |
| | | /** |
| | | * 原图的MD5值 |
| | | **/ |
| | | @Indexed |
| | | private String sourceMD5; |
| | | private Date createTime; |
| | | private Date updateTime; |
| | | |
| | | public String toId() { |
| | | return uid + "-" + sourceMD5; |
| | | } |
| | | |
| | | |
| | | public String getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(String id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public Long getUid() { |
| | | return uid; |
| | | } |
| | | |
| | | public void setUid(Long uid) { |
| | | this.uid = uid; |
| | | } |
| | | |
| | | public String getUrl() { |
| | | return url; |
| | | } |
| | | |
| | | public void setUrl(String url) { |
| | | this.url = url; |
| | | } |
| | | |
| | | public String getSourceMD5() { |
| | | return sourceMD5; |
| | | } |
| | | |
| | | public void setSourceMD5(String sourceMD5) { |
| | | this.sourceMD5 = sourceMD5; |
| | | } |
| | | |
| | | public Date getCreateTime() { |
| | | return createTime; |
| | | } |
| | | |
| | | public void setCreateTime(Date createTime) { |
| | | this.createTime = createTime; |
| | | } |
| | | |
| | | public Date getUpdateTime() { |
| | | return updateTime; |
| | | } |
| | | |
| | | public void setUpdateTime(Date updateTime) { |
| | | this.updateTime = updateTime; |
| | | } |
| | | } |
| | |
| | | |
| | | @Id |
| | | private Long id; |
| | | |
| | | /** |
| | | * 邀请码 |
| | | **/ |
| | | @Indexed |
| | | private String inviteCode; |
| | | |
| | | /** |
| | | * 未读消息的数量 |
| | | **/ |
| | | private Integer unReadMsgCount; |
| | | |
| | | |
| | | private Date createTime; |
| | | private Date updateTime; |
| | | |
| | | |
| | | public Long getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(Long id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getInviteCode() { |
| | | return inviteCode; |
| | | } |
| | | |
| | | public void setInviteCode(String inviteCode) { |
| | | this.inviteCode = inviteCode; |
| | | } |
| | | |
| | | public Integer getUnReadMsgCount() { |
| | | return unReadMsgCount; |
| | | } |
| | | |
| | | public void setUnReadMsgCount(Integer unReadMsgCount) { |
| | | this.unReadMsgCount = unReadMsgCount; |
| | | } |
| | | |
| | | public Date getCreateTime() { |
| | | return createTime; |
| | | } |
| | | |
| | | public void setCreateTime(Date createTime) { |
| | | this.createTime = createTime; |
| | | } |
| | | |
| | | public Date getUpdateTime() { |
| | | return updateTime; |
| | | } |
| | | |
| | | public void setUpdateTime(Date updateTime) { |
| | | this.updateTime = updateTime; |
| | | } |
| | | } |
| | |
| | | |
| | | public final static int CODE_MONEY_LIMIT = 301; |
| | | |
| | | //小金额提现次数限制 |
| | | public final static int CODE_LITTLE_MONEY_LIMIT = 302; |
| | | |
| | | //已经处理 |
| | | public final static int CODE_ALREADY_DONE = 401; |
| | | |
New file |
| | |
| | | package com.yeshi.makemoney.app.exception.money; |
| | | |
| | | import com.ks.lib.common.exception.BaseException; |
| | | |
| | | public class UserExtractMoneyLimitException extends BaseException{ |
| | | |
| | | public UserExtractMoneyLimitException(int code, String msg) { |
| | | super(code, msg); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.yeshi.makemoney.app.exception.team; |
| | | |
| | | import com.ks.lib.common.exception.BaseException; |
| | | |
| | | public class SpreadImgException extends BaseException{ |
| | | |
| | | public SpreadImgException(int code, String msg) { |
| | | super(code, msg); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.yeshi.makemoney.app.exception.team; |
| | | |
| | | import com.ks.lib.common.exception.BaseException; |
| | | |
| | | public class UserSpreadImgException extends BaseException { |
| | | |
| | | //绘图出错 |
| | | public final static int CODE_DRAW_IMG_ERROR = 1001; |
| | | |
| | | public UserSpreadImgException(int code, String msg) { |
| | | super(code, msg); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.yeshi.makemoney.app.exception.user; |
| | | |
| | | import com.ks.lib.common.exception.BaseException; |
| | | |
| | | public class UserExtraInfoException extends BaseException{ |
| | | |
| | | public UserExtraInfoException(int code, String msg) { |
| | | super(code, msg); |
| | | } |
| | | |
| | | } |
| | |
| | | */ |
| | | public class UserInfoException extends BaseException { |
| | | |
| | | //没有邀请码 |
| | | public final static int CODE_NO_INVITE_CODE = 1001; |
| | | |
| | | public UserInfoException(int code, String msg) { |
| | | super(code, msg); |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public SystemConfig getByKey(SystemEnum system, SystemConfigKey key) { |
| | | DaoQuery daoQuery = new DaoQuery(); |
| | | daoQuery.system = system; |
| | | daoQuery.key = key; |
| | | daoQuery.count = 1; |
| | | List<SystemConfig> list = systemConfigDao.list(daoQuery); |
| | | if (list == null || list.size() == 0) { |
| | | return null; |
| | | } |
| | | return list.get(0); |
| | | } |
| | | |
| | | @Override |
| | | public List<SystemConfig> list(SystemConfigQuery systemConfigQuery, int page, int pageSize) { |
| | | DaoQuery daoQuery = new DaoQuery(); |
| | | try { |
| | |
| | | import org.springframework.data.domain.Sort; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Arrays; |
| | | import java.util.Date; |
| | | |
| | |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public Integer getPriceCornNum(SystemEnum system, GoldCornGetType type, Date date, boolean hasBoss) { |
| | | GoldCornGetPrice price = getPrice(system, type, date); |
| | | if (price == null) { |
| | | return null; |
| | | } |
| | | return new BigDecimal(price.getCornNum()).multiply(new BigDecimal(1).add(price.getTeamGainRate())).intValue(); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | return results.getUniqueMappedResult() == null ? 0L : Long.parseLong(results.getUniqueMappedResult().get("count") + ""); |
| | | } |
| | | |
| | | @Override |
| | | public Map<Long, Integer> sumGoldCornByFromUids(Long uid, List<Long> fromUidList, String day) { |
| | | Criteria[] ands = new Criteria[3]; |
| | | ands[0] = Criteria.where("day").is(day); |
| | | ands[1] = Criteria.where("uid").is(uid); |
| | | |
| | | Criteria[] ors = new Criteria[fromUidList.size()]; |
| | | for (int i = 0; i < ors.length; i++) { |
| | | ors[i] = Criteria.where("fromUid").is(fromUidList.get(i)); |
| | | } |
| | | ands[3] = new Criteria().orOperator(ors); |
| | | |
| | | List<AggregationOperation> list = new ArrayList<>(); |
| | | list.add(Aggregation.match(new Criteria().andOperator(ands))); |
| | | list.add(Aggregation.group("fromUid").sum("cornNum").as("cornNum")); |
| | | AggregationResults<Map> results = goldCornGetRecordDao.aggregate(list, Map.class); |
| | | List<Map> mapList = results.getMappedResults(); |
| | | Map<Long, Integer> map = new HashMap<>(); |
| | | if (mapList != null) { |
| | | for (Map m : mapList) { |
| | | map.put((long) m.get("fromUid"), (int) m.get("cornNum")); |
| | | } |
| | | } |
| | | return map; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | @RequestSerializableByKey(key = "'addgoldcorn-'+#uid+'-'+#type") |
| | | @Override |
| | | public void addGoldCorn(Long uid, GoldCornGetType type, Date currentTime) throws UserInfoException, GoldCornGetPriceException, GoldCornGetFrequencyConfigException, GoldCornMakeException { |
| | | public void addGoldCorn(Long uid, GoldCornGetType type, boolean isDouble, Date currentTime) throws UserInfoException, GoldCornGetPriceException, GoldCornGetFrequencyConfigException, GoldCornMakeException { |
| | | if (uid == null || type == null || currentTime == null) { |
| | | throw new GoldCornMakeException(GoldCornMakeException.CODE_PARAMS_NOT_ENOUGH, "参数不完整"); |
| | | } |
| | |
| | | if (price == null) { |
| | | throw new GoldCornGetPriceException(GoldCornGetPriceException.CODE_NOT_EXIST, "价格信息缺失"); |
| | | } |
| | | |
| | | //基础价格 |
| | | int baseCornNum = price.getCornNum(); |
| | | |
| | | //是否加入团队 |
| | | Long bossUid = teamInviteRelationService.getBossUid(uid); |
| | | if (bossUid != null) { |
| | | baseCornNum = new BigDecimal(baseCornNum).multiply(new BigDecimal(1).add(price.getTeamGainRate())).intValue(); |
| | | } |
| | | |
| | | GoldCornGetRecord record = new GoldCornGetRecord(); |
| | | record.setCornNum(price.getCornNum()); |
| | | record.setCornNum(baseCornNum); |
| | | record.setDay(TimeUtil.getGernalTime(currentTime.getTime(), "yyyy-MM-dd")); |
| | | record.setType(type); |
| | | record.setUid(uid); |
| | | record.setLevel(GoldCornGetRecord.LEVEL_OWN); |
| | | record.setCreateTime(currentTime); |
| | | GoldCornGetRecord recordD = null; |
| | | if (isDouble) { |
| | | recordD = new GoldCornGetRecord(); |
| | | recordD.setCornNum(baseCornNum); |
| | | recordD.setDay(TimeUtil.getGernalTime(currentTime.getTime(), "yyyy-MM-dd")); |
| | | recordD.setType(type); |
| | | recordD.setUid(uid); |
| | | recordD.setLevel(GoldCornGetRecord.LEVEL_OWN); |
| | | recordD.setCreateTime(currentTime); |
| | | recordD.setDubble(true); |
| | | } |
| | | |
| | | //允许上级提成 |
| | | |
| | | try { |
| | | goldCornGetRecordService.add(record); |
| | | if (recordD != null) { |
| | | goldCornGetRecordService.add(recordD); |
| | | } |
| | | //是否有上级 |
| | | Long bossUid = teamInviteRelationService.getBossUid(uid); |
| | | if (price.getTeamDivide() != null && price.getTeamDivide()) { |
| | | if (bossUid != null) { |
| | | BigDecimal rate = new BigDecimal(systemConfigService.getValueCache(user.getSystem(), SystemConfigKey.teamFirstDivideRate)); |
| | | GoldCornGetRecord cRecord = new GoldCornGetRecord(); |
| | | cRecord.setCornNum(price.getCornNum()); |
| | | cRecord.setDay(record.getDay()); |
| | | cRecord.setType(type); |
| | | cRecord.setUid(bossUid); |
| | | cRecord.setCornNum(new BigDecimal(record.getCornNum()).multiply(rate).intValue()); |
| | | cRecord.setCornNum(new BigDecimal(baseCornNum).multiply(rate).intValue()); |
| | | cRecord.setFromId(record.getId()); |
| | | cRecord.setFromUid(record.getUid()); |
| | | cRecord.setLevel(GoldCornGetRecord.LEVEL_FIRST); |
| | |
| | | if (bossUid != null) { |
| | | rate = new BigDecimal(systemConfigService.getValueCache(user.getSystem(), SystemConfigKey.teamSecondDivideRate)); |
| | | GoldCornGetRecord ccRecord = new GoldCornGetRecord(); |
| | | ccRecord.setCornNum(price.getCornNum()); |
| | | ccRecord.setDay(record.getDay()); |
| | | ccRecord.setType(type); |
| | | ccRecord.setUid(bossUid); |
| | | ccRecord.setFromId(record.getId()); |
| | | ccRecord.setFromUid(record.getUid()); |
| | | ccRecord.setCornNum(new BigDecimal(record.getCornNum()).multiply(rate).intValue()); |
| | | ccRecord.setCornNum(new BigDecimal(baseCornNum).multiply(rate).intValue()); |
| | | ccRecord.setLevel(GoldCornGetRecord.LEVEL_SECOND); |
| | | ccRecord.setCreateTime(currentTime); |
| | | if (ccRecord.getCornNum() > 0) { |
| | |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } catch (GoldCornGetRecordException e) { |
| | | throw new GoldCornMakeException(GoldCornMakeException.CODE_ADD_RECORD_ERROR, e.getMsg()); |
| | | } |
| | | |
| | | } |
| | | |
| | | @Override |
| | |
| | | import com.yeshi.makemoney.app.exception.money.UserMoneyBalanceException; |
| | | import com.yeshi.makemoney.app.service.inter.config.SystemConfigService; |
| | | import com.yeshi.makemoney.app.service.inter.money.ExtractService; |
| | | import com.yeshi.makemoney.app.service.inter.money.UserExtractMoneyLimitService; |
| | | import com.yeshi.makemoney.app.service.inter.money.UserMoneyRecordService; |
| | | import com.yeshi.makemoney.app.service.inter.money.UserMoneyService; |
| | | import com.yeshi.makemoney.app.service.inter.user.UserInfoService; |
| | |
| | | |
| | | @Resource |
| | | private UserMoneyRecordService userMoneyRecordService; |
| | | |
| | | @Resource |
| | | private UserExtractMoneyLimitService userExtractMoneyLimitService; |
| | | |
| | | @Override |
| | | public List<Extract> list(ExtractQuery extractQuery, int page, int pageSize) { |
| | |
| | | throw new ExtractException(ExtractException.CODE_EXTRACT_CONFIG_ERROR, "提现配置错误"); |
| | | } |
| | | |
| | | if (isFirst(user.getId())) { |
| | | if (money.compareTo(config.getFirstMinMoney()) < 0) { |
| | | throw new ExtractException(ExtractException.CODE_MONEY_LIMIT, String.format("首次提现最低金额为%s元", config.getFirstMinMoney().toString())); |
| | | } |
| | | } else { |
| | | |
| | | if (money.compareTo(config.getMinMoney()) < 0) { |
| | | throw new ExtractException(ExtractException.CODE_MONEY_LIMIT, String.format("最低提现金额为%s元", config.getMinMoney().toString())); |
| | | } |
| | | } |
| | | |
| | | |
| | | if (money.compareTo(config.getMaxMoney()) > 0) { |
| | | throw new ExtractException(ExtractException.CODE_MONEY_LIMIT, String.format("最高提现金额为%s元", config.getMaxMoney().toString())); |
| | |
| | | throw new ExtractException(ExtractException.CODE_MONEY_LIMIT, String.format("单日累计最高提现次数为%s次", config.getMaxNumPerDay().toString())); |
| | | } |
| | | |
| | | //小金额提现限制 |
| | | if (money.compareTo(new BigDecimal(1)) < 0) { |
| | | //是否已经用完新用户额度 |
| | | if (!canExtractLittleMoney(user.getId(), config.getNewerLittleMoneyNum(), new Date(currentTime))) { |
| | | throw new ExtractException(ExtractException.CODE_LITTLE_MONEY_LIMIT, "今日小于1元提现次数已用尽"); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public boolean canExtractLittleMoney(Long uid, int maxNewerCount, Date date) { |
| | | //判断新人 |
| | | long count = countByMaxMoney(uid, new BigDecimal(1), Arrays.asList(new Integer[]{Extract.STATE_NOT_PROCESS, Extract.STATE_PROCESSING, Extract.STATE_PASS}), null); |
| | | if (maxNewerCount > count) { |
| | | return true; |
| | | } |
| | | |
| | | //判断激励分配 |
| | | int limit = userExtractMoneyLimitService.getLittleMoneyLimit(uid, date); |
| | | if (limit <= 0) { |
| | | return false; |
| | | } |
| | | count = countByMaxMoney(uid, new BigDecimal(1), Arrays.asList(new Integer[]{Extract.STATE_NOT_PROCESS, Extract.STATE_PROCESSING, Extract.STATE_PASS}), new Date(TimeUtil.convertToTimeTemp(TimeUtil.getGernalTime(date.getTime(), "yyyyMMdd"), "yyyyMMdd"))); |
| | | if (count < limit) { |
| | | return true; |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public long countByMaxMoney(Long uid, BigDecimal money, List<Integer> stateList, Date minCreateTime) { |
| | | DaoQuery daoQuery = new DaoQuery(); |
| | | daoQuery.uid = uid; |
| | | daoQuery.maxMoney = money; |
| | | daoQuery.stateList = stateList; |
| | | daoQuery.minCreateTime = minCreateTime; |
| | | return extractMapper.count(daoQuery); |
| | | } |
| | | |
| | | /** |
| | | * 提现到支付宝 |
| | | * |
New file |
| | |
| | | package com.yeshi.makemoney.app.service.impl.money; |
| | | |
| | | import com.yeshi.makemoney.app.dao.money.UserExtractMoneyLimitDao; |
| | | import com.yeshi.makemoney.app.dao.money.UserExtractMoneyLimitDao.DaoQuery; |
| | | import com.yeshi.makemoney.app.entity.money.UserExtractMoneyLimit; |
| | | import com.yeshi.makemoney.app.exception.money.UserExtractMoneyLimitException; |
| | | import com.yeshi.makemoney.app.service.inter.money.UserExtractMoneyLimitService; |
| | | import com.yeshi.makemoney.app.service.query.money.UserExtractMoneyLimitQuery; |
| | | import org.springframework.data.mongodb.core.query.Criteria; |
| | | import org.springframework.data.mongodb.core.query.Query; |
| | | import org.springframework.stereotype.Service; |
| | | import org.yeshi.utils.TimeUtil; |
| | | import org.yeshi.utils.bean.BeanUtil; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class UserExtractMoneyLimitServiceImpl implements UserExtractMoneyLimitService { |
| | | |
| | | @Resource |
| | | private UserExtractMoneyLimitDao userExtractMoneyLimitDao; |
| | | |
| | | @Override |
| | | public List<UserExtractMoneyLimit> list(UserExtractMoneyLimitQuery userExtractMoneyLimitQuery, int page, int pageSize) { |
| | | DaoQuery daoQuery = new DaoQuery(); |
| | | try { |
| | | BeanUtil.copyProperties(userExtractMoneyLimitQuery, daoQuery); |
| | | } catch (IllegalAccessException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | daoQuery.start = (page - 1) * pageSize; |
| | | daoQuery.count = pageSize; |
| | | return userExtractMoneyLimitDao.list(daoQuery); |
| | | } |
| | | |
| | | @Override |
| | | public long count(UserExtractMoneyLimitQuery userExtractMoneyLimitQuery) { |
| | | DaoQuery daoQuery = new DaoQuery(); |
| | | try { |
| | | BeanUtil.copyProperties(userExtractMoneyLimitQuery, daoQuery); |
| | | } catch (IllegalAccessException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return userExtractMoneyLimitDao.count(daoQuery); |
| | | } |
| | | |
| | | @Override |
| | | public UserExtractMoneyLimit get(String id) { |
| | | Query query = new Query(); |
| | | query.addCriteria(Criteria.where("_id").is(id)); |
| | | return userExtractMoneyLimitDao.findOne(query); |
| | | } |
| | | |
| | | @Override |
| | | public void add(UserExtractMoneyLimit userExtractMoneyLimit) throws UserExtractMoneyLimitException { |
| | | //查询主键ID是否存在 |
| | | if (userExtractMoneyLimitDao.get(userExtractMoneyLimit.getId()) != null) { |
| | | throw new UserExtractMoneyLimitException(UserExtractMoneyLimitException.CODE_EXIST, "已存在"); |
| | | } |
| | | |
| | | if (userExtractMoneyLimit.getCreateTime() == null) { |
| | | userExtractMoneyLimit.setCreateTime(new Date()); |
| | | } |
| | | //保存 |
| | | userExtractMoneyLimitDao.save(userExtractMoneyLimit); |
| | | } |
| | | |
| | | @Override |
| | | public void update(UserExtractMoneyLimit userExtractMoneyLimit) { |
| | | if (userExtractMoneyLimit.getUpdateTime() == null) { |
| | | userExtractMoneyLimit.setUpdateTime(new Date()); |
| | | } |
| | | //更新 |
| | | userExtractMoneyLimitDao.updateSelective(userExtractMoneyLimit); |
| | | } |
| | | |
| | | @Override |
| | | public void delete(List<String> idList) { |
| | | for (String id : idList) { |
| | | userExtractMoneyLimitDao.delete(id); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void addLittleMoneyLimit(Long uid, int count,Date date) throws UserExtractMoneyLimitException { |
| | | UserExtractMoneyLimit limit = new UserExtractMoneyLimit(); |
| | | limit.setCount(count); |
| | | limit.setDay(TimeUtil.getGernalTime(date.getTime(), "yyyy-MM-dd")); |
| | | limit.setUid(uid); |
| | | limit.setMinMoney(0); |
| | | limit.setMaxMoney(1 * 100); |
| | | UserExtractMoneyLimit old = get(limit.toId()); |
| | | if (old != null) { |
| | | UserExtractMoneyLimit update = new UserExtractMoneyLimit(); |
| | | update.setId(old.getId()); |
| | | update.setCount(count + old.getCount()); |
| | | userExtractMoneyLimitDao.updateSelective(update); |
| | | return; |
| | | } |
| | | add(limit); |
| | | } |
| | | |
| | | @Override |
| | | public int getLittleMoneyLimit(Long uid,Date date) { |
| | | UserExtractMoneyLimit limit = new UserExtractMoneyLimit(); |
| | | limit.setDay(TimeUtil.getGernalTime(date.getTime(), "yyyy-MM-dd")); |
| | | limit.setUid(uid); |
| | | limit.setMinMoney(0); |
| | | limit.setMaxMoney(1 * 100); |
| | | UserExtractMoneyLimit old = get(limit.toId()); |
| | | if (old == null) { |
| | | return 0; |
| | | } |
| | | return old.getCount(); |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.yeshi.makemoney.app.service.impl.team; |
| | | |
| | | import java.lang.Exception; |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.yeshi.makemoney.app.entity.SystemEnum; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Date; |
| | | |
| | | import org.yeshi.utils.bean.BeanUtil; |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.yeshi.makemoney.app.dao.team.SpreadImgDao; |
| | | import com.yeshi.makemoney.app.entity.team.SpreadImg; |
| | | import com.yeshi.makemoney.app.service.inter.team.SpreadImgService; |
| | | import com.yeshi.makemoney.app.service.query.team.SpreadImgQuery; |
| | | import com.yeshi.makemoney.app.dao.team.SpreadImgDao.DaoQuery; |
| | | |
| | | import org.springframework.data.mongodb.core.query.Criteria; |
| | | import org.springframework.data.mongodb.core.query.Query; |
| | | |
| | | @Service |
| | | public class SpreadImgServiceImpl implements SpreadImgService { |
| | | |
| | | @Resource |
| | | private SpreadImgDao spreadImgDao; |
| | | |
| | | @Override |
| | | public List<SpreadImg> list(SpreadImgQuery spreadImgQuery, int page, int pageSize) { |
| | | DaoQuery daoQuery = new DaoQuery(); |
| | | try { |
| | | BeanUtil.copyProperties(spreadImgQuery, daoQuery); |
| | | } catch (IllegalAccessException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | daoQuery.start = (page - 1) * pageSize; |
| | | daoQuery.count = pageSize; |
| | | return spreadImgDao.list(daoQuery); |
| | | } |
| | | |
| | | @Override |
| | | public long count(SpreadImgQuery spreadImgQuery) { |
| | | DaoQuery daoQuery = new DaoQuery(); |
| | | try { |
| | | BeanUtil.copyProperties(spreadImgQuery, daoQuery); |
| | | } catch (IllegalAccessException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return spreadImgDao.count(daoQuery); |
| | | } |
| | | |
| | | @Override |
| | | public SpreadImg get(String id) { |
| | | Query query = new Query(); |
| | | query.addCriteria(Criteria.where("_id").is(id)); |
| | | return spreadImgDao.findOne(query); |
| | | } |
| | | |
| | | @Override |
| | | public void add(SpreadImg spreadImg) throws Exception { |
| | | //查询主键ID是否存在 |
| | | if (spreadImgDao.get(spreadImg.getId()) != null) { |
| | | throw new Exception("已存在"); |
| | | } |
| | | |
| | | if (spreadImg.getCreateTime() == null) { |
| | | spreadImg.setCreateTime(new Date()); |
| | | } |
| | | //保存 |
| | | spreadImgDao.save(spreadImg); |
| | | } |
| | | |
| | | @Override |
| | | public void update(SpreadImg spreadImg) { |
| | | if (spreadImg.getUpdateTime() == null) { |
| | | spreadImg.setUpdateTime(new Date()); |
| | | } |
| | | //更新 |
| | | spreadImgDao.updateSelective(spreadImg); |
| | | } |
| | | |
| | | @Override |
| | | public void delete(List<String> idList) { |
| | | for (String id : idList) { |
| | | spreadImgDao.delete(id); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public List<SpreadImg> listSpreadImgs(SystemEnum system, Date date) { |
| | | DaoQuery daoQuery = new DaoQuery(); |
| | | daoQuery.system = system; |
| | | daoQuery.show = true; |
| | | daoQuery.date = date; |
| | | daoQuery.count = 10; |
| | | return spreadImgDao.list(daoQuery); |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.yeshi.makemoney.app.service.impl.team; |
| | | |
| | | import java.io.InputStream; |
| | | import java.lang.Exception; |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.yeshi.makemoney.app.entity.config.SystemConfigKey; |
| | | import com.yeshi.makemoney.app.entity.team.SpreadImg; |
| | | import com.yeshi.makemoney.app.entity.user.UserExtraInfo; |
| | | import com.yeshi.makemoney.app.entity.user.UserInfo; |
| | | import com.yeshi.makemoney.app.exception.team.SpreadImgException; |
| | | import com.yeshi.makemoney.app.exception.team.UserSpreadImgException; |
| | | import com.yeshi.makemoney.app.exception.user.UserInfoException; |
| | | import com.yeshi.makemoney.app.service.inter.config.SystemConfigService; |
| | | import com.yeshi.makemoney.app.service.inter.team.SpreadImgService; |
| | | import com.yeshi.makemoney.app.service.inter.user.UserExtraInfoService; |
| | | import com.yeshi.makemoney.app.service.inter.user.UserInfoService; |
| | | import com.yeshi.makemoney.app.utils.DrawImageUtil; |
| | | import com.yeshi.makemoney.app.utils.ImageUtil; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.net.URLDecoder; |
| | | import java.util.*; |
| | | |
| | | import org.yeshi.utils.HttpUtil; |
| | | import org.yeshi.utils.StringUtil; |
| | | import org.yeshi.utils.bean.BeanUtil; |
| | | |
| | | import com.yeshi.makemoney.app.dao.team.UserSpreadImgDao; |
| | | import com.yeshi.makemoney.app.entity.team.UserSpreadImg; |
| | | import com.yeshi.makemoney.app.service.inter.team.UserSpreadImgService; |
| | | import com.yeshi.makemoney.app.service.query.team.UserSpreadImgQuery; |
| | | import com.yeshi.makemoney.app.dao.team.UserSpreadImgDao.DaoQuery; |
| | | |
| | | import org.springframework.data.mongodb.core.query.Criteria; |
| | | import org.springframework.data.mongodb.core.query.Query; |
| | | import org.yeshi.utils.entity.FileUploadResult; |
| | | import org.yeshi.utils.tencentcloud.COSManager; |
| | | |
| | | @Service |
| | | public class UserSpreadImgServiceImpl implements UserSpreadImgService { |
| | | |
| | | @Resource |
| | | private UserSpreadImgDao userSpreadImgDao; |
| | | |
| | | @Resource |
| | | private SpreadImgService spreadImgService; |
| | | |
| | | @Resource |
| | | private UserInfoService userInfoService; |
| | | |
| | | @Resource |
| | | private SystemConfigService systemConfigService; |
| | | |
| | | @Resource |
| | | private UserExtraInfoService userExtraInfoService; |
| | | |
| | | @Override |
| | | public List<UserSpreadImg> list(UserSpreadImgQuery userSpreadImgQuery, int page, int pageSize) { |
| | | DaoQuery daoQuery = new DaoQuery(); |
| | | try { |
| | | BeanUtil.copyProperties(userSpreadImgQuery, daoQuery); |
| | | } catch (IllegalAccessException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | daoQuery.start = (page - 1) * pageSize; |
| | | daoQuery.count = pageSize; |
| | | return userSpreadImgDao.list(daoQuery); |
| | | } |
| | | |
| | | @Override |
| | | public long count(UserSpreadImgQuery userSpreadImgQuery) { |
| | | DaoQuery daoQuery = new DaoQuery(); |
| | | try { |
| | | BeanUtil.copyProperties(userSpreadImgQuery, daoQuery); |
| | | } catch (IllegalAccessException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return userSpreadImgDao.count(daoQuery); |
| | | } |
| | | |
| | | @Override |
| | | public UserSpreadImg get(String id) { |
| | | Query query = new Query(); |
| | | query.addCriteria(Criteria.where("_id").is(id)); |
| | | return userSpreadImgDao.findOne(query); |
| | | } |
| | | |
| | | @Override |
| | | public void add(UserSpreadImg userSpreadImg) throws Exception { |
| | | //查询主键ID是否存在 |
| | | if (userSpreadImgDao.get(userSpreadImg.getId()) != null) { |
| | | throw new Exception("已存在"); |
| | | } |
| | | |
| | | if (userSpreadImg.getCreateTime() == null) { |
| | | userSpreadImg.setCreateTime(new Date()); |
| | | } |
| | | //保存 |
| | | userSpreadImgDao.save(userSpreadImg); |
| | | } |
| | | |
| | | @Override |
| | | public void update(UserSpreadImg userSpreadImg) { |
| | | if (userSpreadImg.getUpdateTime() == null) { |
| | | userSpreadImg.setUpdateTime(new Date()); |
| | | } |
| | | //更新 |
| | | userSpreadImgDao.updateSelective(userSpreadImg); |
| | | } |
| | | |
| | | @Override |
| | | public void delete(List<String> idList) { |
| | | for (String id : idList) { |
| | | userSpreadImgDao.delete(id); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public List<UserSpreadImg> getUserSpreadImgs(Long uid) { |
| | | DaoQuery daoQuery = new DaoQuery(); |
| | | daoQuery.uid = uid; |
| | | daoQuery.count = 20; |
| | | return userSpreadImgDao.list(daoQuery); |
| | | } |
| | | |
| | | @Override |
| | | public void drawImgs(Long uid, String inviteCode) throws UserInfoException, SpreadImgException, UserSpreadImgException { |
| | | |
| | | UserInfo user = userInfoService.get(uid); |
| | | if (user == null) { |
| | | throw new UserInfoException(UserInfoException.CODE_NOT_EXIST, "用户不存在"); |
| | | } |
| | | |
| | | //获取目前可用的邀请图素材 |
| | | List<SpreadImg> list = spreadImgService.listSpreadImgs(user.getSystem(), new Date()); |
| | | if (list == null || list.size() == 0) { |
| | | throw new SpreadImgException(SpreadImgException.CODE_NOT_EXIST, "没有可用的素材"); |
| | | } |
| | | //获取所有素材的MD5 |
| | | List<String> resourceMD5List = new ArrayList<>(); |
| | | Map<String, SpreadImg> resourceMap = new HashMap<>(); |
| | | for (SpreadImg img : list) { |
| | | resourceMD5List.add(img.getId()); |
| | | resourceMap.put(img.getId(), img); |
| | | } |
| | | |
| | | //获取用户现有的分享图 |
| | | List<UserSpreadImg> userSpreadImgList = getUserSpreadImgs(uid); |
| | | List<String> md5List = new ArrayList<>(); |
| | | Map<String, UserSpreadImg> userMap = new HashMap<>(); |
| | | for (UserSpreadImg img : userSpreadImgList) { |
| | | md5List.add(img.getId()); |
| | | userMap.put(img.getSourceMD5(), img); |
| | | } |
| | | |
| | | //删除素材中不存在的图片 |
| | | md5List.removeAll(resourceMD5List); |
| | | for (String md5 : md5List) { |
| | | deleteUserSpreadImg(userMap.get(md5)); |
| | | } |
| | | |
| | | //添加素材中的图片 |
| | | resourceMD5List.removeAll(md5List); |
| | | for (String md5 : resourceMD5List) { |
| | | SpreadImg spreadImg = resourceMap.get(md5); |
| | | if (spreadImg != null) { |
| | | UserSpreadImg img = new UserSpreadImg(); |
| | | try { |
| | | InputStream inputStream = DrawImageUtil.drawInvite(HttpUtil.getImage(spreadImg.getUrl()), inviteCode, systemConfigService.getValueCache(user.getSystem(), SystemConfigKey.appLink)); |
| | | String key = "/imgs/userspreadimg/" + uid + "-" + md5 + ".jpg"; |
| | | FileUploadResult result = COSManager.getInstance().uploadFile(inputStream, key); |
| | | if (result == null) { |
| | | throw new Exception("图片上传出错"); |
| | | } |
| | | img.setUrl(ImageUtil.getCOSImageUrl(key)); |
| | | } catch (Exception e) { |
| | | throw new UserSpreadImgException(UserSpreadImgException.CODE_DRAW_IMG_ERROR, e.getMessage()); |
| | | } |
| | | img.setUid(uid); |
| | | img.setSourceMD5(spreadImg.getId()); |
| | | img.setId(img.toId()); |
| | | userSpreadImgDao.save(img); |
| | | } |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void drawImgs(Long uid) throws UserInfoException, SpreadImgException, UserSpreadImgException { |
| | | UserExtraInfo extraInfo = userExtraInfoService.get(uid); |
| | | if (extraInfo == null || StringUtil.isNullOrEmpty(extraInfo.getInviteCode())) { |
| | | throw new UserInfoException(UserInfoException.CODE_NO_INVITE_CODE, "邀请码不存在"); |
| | | } |
| | | drawImgs(uid, extraInfo.getInviteCode()); |
| | | } |
| | | |
| | | private void deleteUserSpreadImg(UserSpreadImg img) { |
| | | if (img == null) { |
| | | return; |
| | | } |
| | | //删除实体 |
| | | userSpreadImgDao.delete(img.getId()); |
| | | //删除图片 |
| | | COSManager.getInstance().deleteFileByKey(getUrlKey(img.getUrl())); |
| | | } |
| | | |
| | | private static String getUrlKey(String imgUrl) { |
| | | String url = imgUrl.replace("http://", "").replace("https://", ""); |
| | | String key = url.substring(url.indexOf("/")); |
| | | return key; |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.yeshi.makemoney.app.service.impl.user; |
| | | |
| | | import com.yeshi.makemoney.app.dao.user.UserExtraInfoDao; |
| | | import com.yeshi.makemoney.app.entity.user.UserExtraInfo; |
| | | import com.yeshi.makemoney.app.service.inter.user.UserExtraInfoService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | |
| | | @Service |
| | | public class UserExtraInfoServiceImpl implements UserExtraInfoService { |
| | | |
| | | @Resource |
| | | private UserExtraInfoDao userExtraInfoDao; |
| | | |
| | | |
| | | @Override |
| | | public UserExtraInfo get(Long uid) { |
| | | return init(uid); |
| | | } |
| | | |
| | | @Override |
| | | public UserExtraInfo init(Long uid) { |
| | | UserExtraInfo extraInfo = userExtraInfoDao.get(uid); |
| | | if (extraInfo != null) { |
| | | return extraInfo; |
| | | } |
| | | |
| | | extraInfo = new UserExtraInfo(); |
| | | extraInfo.setId(uid); |
| | | extraInfo.setCreateTime(new Date()); |
| | | userExtraInfoDao.save(extraInfo); |
| | | return extraInfo; |
| | | } |
| | | |
| | | @Override |
| | | public void addUnReadMsgCount(Long uid, int count) { |
| | | UserExtraInfo extraInfo = init(uid); |
| | | if (extraInfo.getUnReadMsgCount() == null) { |
| | | extraInfo.setUnReadMsgCount(count); |
| | | } else { |
| | | extraInfo.setUnReadMsgCount(extraInfo.getUnReadMsgCount() + count); |
| | | } |
| | | userExtraInfoDao.updateSelective(extraInfo); |
| | | } |
| | | |
| | | @Override |
| | | public void setMsgRead(Long uid) { |
| | | init(uid); |
| | | UserExtraInfo update = new UserExtraInfo(); |
| | | update.setId(uid); |
| | | update.setUnReadMsgCount(0); |
| | | userExtraInfoDao.updateSelective(update); |
| | | } |
| | | |
| | | @Override |
| | | public void setInviteCode(Long uid, String code) { |
| | | init(uid); |
| | | UserExtraInfo update = new UserExtraInfo(); |
| | | update.setId(uid); |
| | | update.setInviteCode(code); |
| | | userExtraInfoDao.updateSelective(update); |
| | | } |
| | | } |
| | |
| | | |
| | | |
| | | /** |
| | | * @return java.lang.String |
| | | * @author hxh |
| | | * @description 根据Key值获取对象 |
| | | * @date 11:50 2021/11/16 |
| | | * @param: system |
| | | * @param: key |
| | | **/ |
| | | public SystemConfig getByKey(SystemEnum system, SystemConfigKey key); |
| | | |
| | | |
| | | /** |
| | | * 获取列表 |
| | | * |
| | | * @param systemConfigQuery |
| | |
| | | import com.yeshi.makemoney.app.entity.SystemEnum; |
| | | import com.yeshi.makemoney.app.entity.goldcorn.GoldCornGetType; |
| | | import org.yeshi.utils.bean.BeanUtil; |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.yeshi.makemoney.app.entity.goldcorn.GoldCornGetPrice; |
| | | import com.yeshi.makemoney.app.service.inter.goldcorn.GoldCornGetPriceService; |
| | | import com.yeshi.makemoney.app.service.query.goldcorn.GoldCornGetPriceQuery; |
| | |
| | | |
| | | /** |
| | | * 获取列表 |
| | | * |
| | | * @param goldCornGetPriceQuery |
| | | * @param page |
| | | * @param pageSize |
| | |
| | | public void delete(List<String> idList) ; |
| | | |
| | | /** |
| | | * @return com.yeshi.makemoney.app.entity.goldcorn.GoldCornGetPrice |
| | | * @author hxh |
| | | * @description 获取价格 |
| | | * @date 18:14 2022/4/6 |
| | | * @param: system |
| | | * @param: type |
| | | * @param: date |
| | | * @return com.yeshi.makemoney.app.entity.goldcorn.GoldCornGetPrice |
| | | **/ |
| | | public GoldCornGetPrice getPrice(SystemEnum system, GoldCornGetType type,Date date); |
| | | |
| | | |
| | | /** |
| | | * @return java.lang.Integer |
| | | * @author hxh |
| | | * @description 获取价格配置中的金币单价 |
| | | * @date 16:06 2022/4/8 |
| | | * @param: system |
| | | * @param: type |
| | | * @param: date |
| | | * @param: hasBoss |
| | | **/ |
| | | public Integer getPriceCornNum(SystemEnum system, GoldCornGetType type, Date date, boolean hasBoss); |
| | | |
| | | |
| | | } |
| | |
| | | package com.yeshi.makemoney.app.service.inter.goldcorn; |
| | | |
| | | import java.lang.Exception; |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | |
| | | import com.yeshi.makemoney.app.entity.goldcorn.GoldCornGetRecord; |
| | | import com.yeshi.makemoney.app.exception.goldcorn.GoldCornGetRecordException; |
| | | import org.yeshi.utils.bean.BeanUtil; |
| | | import com.yeshi.makemoney.app.service.query.goldcorn.GoldCornGetRecordQuery; |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.yeshi.makemoney.app.entity.goldcorn.GoldCornGetRecord; |
| | | import com.yeshi.makemoney.app.service.inter.goldcorn.GoldCornGetRecordService; |
| | | import com.yeshi.makemoney.app.service.query.goldcorn.GoldCornGetRecordQuery; |
| | | import java.util.Map; |
| | | |
| | | |
| | | public interface GoldCornGetRecordService { |
| | |
| | | public long countUidsByDay(String day); |
| | | |
| | | |
| | | /** |
| | | * @return java.util.Map<java.lang.Long , java.math.BigDecimal> |
| | | * @author hxh |
| | | * @description 统计FromUid产生的金币数量 |
| | | * @date 15:36 2022/4/8 |
| | | * @param: uid |
| | | * @param: fromUidList |
| | | * @param: day |
| | | **/ |
| | | public Map<Long, Integer> sumGoldCornByFromUids(Long uid, List<Long> fromUidList, String day); |
| | | |
| | | } |
| | |
| | | * @date 16:55 2022/4/6 |
| | | * @param: uid 用户ID |
| | | * @param: type 类型 |
| | | * @param: isDouble 是否加倍 |
| | | * @param: time 发生时间 |
| | | **/ |
| | | public void addGoldCorn(Long uid, GoldCornGetType type, Date time) throws UserInfoException, GoldCornGetPriceException, GoldCornGetFrequencyConfigException, GoldCornMakeException; |
| | | public void addGoldCorn(Long uid, GoldCornGetType type,boolean isDouble, Date time) throws UserInfoException, GoldCornGetPriceException, GoldCornGetFrequencyConfigException, GoldCornMakeException; |
| | | |
| | | |
| | | /** |
| | |
| | | package com.yeshi.makemoney.app.service.inter.money; |
| | | |
| | | import java.lang.Exception; |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | |
| | | import com.ks.lib.common.exception.ParamsException; |
| | | import com.yeshi.makemoney.app.dto.mq.ExtractTransferResultMQMsg; |
| | | import com.yeshi.makemoney.app.entity.money.Extract; |
| | | import com.yeshi.makemoney.app.exception.money.ExtractException; |
| | | import com.yeshi.makemoney.app.exception.money.UserMoneyBalanceException; |
| | | import org.yeshi.utils.bean.BeanUtil; |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.yeshi.makemoney.app.entity.money.Extract; |
| | | import com.yeshi.makemoney.app.service.inter.money.ExtractService; |
| | | import com.yeshi.makemoney.app.service.query.money.ExtractQuery; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | |
| | | public interface ExtractService { |
| | |
| | | |
| | | |
| | | /** |
| | | * @return void |
| | | * @author hxh |
| | | * @description 处理提现结果 |
| | | * @date 18:27 2022/4/1 |
| | | * @param: msg |
| | | * @return void |
| | | **/ |
| | | public void processExtractResult(ExtractTransferResultMQMsg msg) throws ParamsException; |
| | | |
| | | |
| | | /** |
| | | * @return int |
| | | * @author hxh |
| | | * @description 小于某个金额的提现次数 |
| | | * @date 14:23 2022/4/8 |
| | | * @param: uid |
| | | * @param: money |
| | | * @param: stateList |
| | | **/ |
| | | public long countByMaxMoney(Long uid, BigDecimal money, List<Integer> stateList, Date minCreateTime); |
| | | |
| | | /** |
| | | * @return boolean |
| | | * @author hxh |
| | | * @description 用户是否可以提现小金额 |
| | | * @date 15:02 2022/4/8 |
| | | * @param: uid |
| | | * @param: maxNewerCount |
| | | * @param: date |
| | | **/ |
| | | public boolean canExtractLittleMoney(Long uid, int maxNewerCount, Date date); |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.yeshi.makemoney.app.service.inter.money; |
| | | |
| | | import java.lang.Exception; |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | |
| | | import com.yeshi.makemoney.app.exception.money.UserExtractMoneyLimitException; |
| | | import org.yeshi.utils.bean.BeanUtil; |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.yeshi.makemoney.app.entity.money.UserExtractMoneyLimit; |
| | | import com.yeshi.makemoney.app.service.inter.money.UserExtractMoneyLimitService; |
| | | import com.yeshi.makemoney.app.service.query.money.UserExtractMoneyLimitQuery; |
| | | |
| | | |
| | | public interface UserExtractMoneyLimitService { |
| | | |
| | | /** |
| | | * 获取列表 |
| | | * |
| | | * @param userExtractMoneyLimitQuery |
| | | * @param page |
| | | * @param pageSize |
| | | * @return |
| | | */ |
| | | public List<UserExtractMoneyLimit> list(UserExtractMoneyLimitQuery userExtractMoneyLimitQuery, int page, int pageSize); |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | public long count(UserExtractMoneyLimitQuery userExtractMoneyLimitQuery); |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | public UserExtractMoneyLimit get(String id); |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | public void add(UserExtractMoneyLimit userExtractMoneyLimit) throws UserExtractMoneyLimitException; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | public void update(UserExtractMoneyLimit userExtractMoneyLimit); |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | public void delete(List<String> idList); |
| | | |
| | | |
| | | /** |
| | | * @return void |
| | | * @author hxh |
| | | * @description 增加今日小金额提现次数 |
| | | * @date 14:41 2022/4/8 |
| | | * @param: uid |
| | | * @param: count |
| | | **/ |
| | | public void addLittleMoneyLimit(Long uid, int count,Date date) throws UserExtractMoneyLimitException; |
| | | |
| | | /** |
| | | * @return int |
| | | * @author hxh |
| | | * @description 获取今日小金额提现次数 |
| | | * @date 14:41 2022/4/8 |
| | | * @param: uid |
| | | **/ |
| | | public int getLittleMoneyLimit(Long uid,Date date); |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.yeshi.makemoney.app.service.inter.team; |
| | | |
| | | import java.lang.Exception; |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | |
| | | import com.yeshi.makemoney.app.entity.SystemEnum; |
| | | import org.yeshi.utils.bean.BeanUtil; |
| | | import java.util.List; |
| | | import com.yeshi.makemoney.app.entity.team.SpreadImg; |
| | | import com.yeshi.makemoney.app.service.inter.team.SpreadImgService; |
| | | import com.yeshi.makemoney.app.service.query.team.SpreadImgQuery; |
| | | |
| | | |
| | | public interface SpreadImgService { |
| | | |
| | | /** |
| | | * 获取列表 |
| | | * @param spreadImgQuery |
| | | * @param page |
| | | * @param pageSize |
| | | * @return |
| | | */ |
| | | public List<SpreadImg> list(SpreadImgQuery spreadImgQuery, int page, int pageSize) ; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | public long count(SpreadImgQuery spreadImgQuery) ; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | public SpreadImg get(String id) ; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | public void add(SpreadImg spreadImg) throws Exception; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | public void update(SpreadImg spreadImg) ; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | public void delete(List<String> idList) ; |
| | | |
| | | |
| | | /** |
| | | * @author hxh |
| | | * @description 分享图列表 |
| | | * @date 11:51 2022/4/9 |
| | | * @param: system |
| | | * @param: date |
| | | * @return java.util.List<com.yeshi.makemoney.app.entity.team.SpreadImg> |
| | | **/ |
| | | public List<SpreadImg> listSpreadImgs(SystemEnum system,Date date); |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.yeshi.makemoney.app.service.inter.team; |
| | | |
| | | import java.lang.Exception; |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | |
| | | import com.yeshi.makemoney.app.exception.team.SpreadImgException; |
| | | import com.yeshi.makemoney.app.exception.team.UserSpreadImgException; |
| | | import com.yeshi.makemoney.app.exception.user.UserInfoException; |
| | | import org.yeshi.utils.bean.BeanUtil; |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.yeshi.makemoney.app.entity.team.UserSpreadImg; |
| | | import com.yeshi.makemoney.app.service.inter.team.UserSpreadImgService; |
| | | import com.yeshi.makemoney.app.service.query.team.UserSpreadImgQuery; |
| | | |
| | | |
| | | public interface UserSpreadImgService { |
| | | |
| | | /** |
| | | * 获取列表 |
| | | * |
| | | * @param userSpreadImgQuery |
| | | * @param page |
| | | * @param pageSize |
| | | * @return |
| | | */ |
| | | public List<UserSpreadImg> list(UserSpreadImgQuery userSpreadImgQuery, int page, int pageSize); |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | public long count(UserSpreadImgQuery userSpreadImgQuery); |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | public UserSpreadImg get(String id); |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | public void add(UserSpreadImg userSpreadImg) throws Exception; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | public void update(UserSpreadImg userSpreadImg); |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | public void delete(List<String> idList); |
| | | |
| | | public List<UserSpreadImg> getUserSpreadImgs(Long uid); |
| | | |
| | | |
| | | /** |
| | | * @return void |
| | | * @author hxh |
| | | * @description 绘制邀请图 |
| | | * @date 11:48 2022/4/9 |
| | | * @param: uid |
| | | * @param: inviteCode |
| | | **/ |
| | | public void drawImgs(Long uid, String inviteCode) throws UserInfoException, SpreadImgException, UserSpreadImgException; |
| | | |
| | | /** |
| | | * @author hxh |
| | | * @description 绘制邀请图 |
| | | * @date 14:36 2022/4/9 |
| | | * @param: uid |
| | | * @return void |
| | | **/ |
| | | public void drawImgs(Long uid) throws UserInfoException, SpreadImgException, UserSpreadImgException; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.yeshi.makemoney.app.service.inter.user; |
| | | |
| | | import com.yeshi.makemoney.app.entity.user.UserExtraInfo; |
| | | |
| | | public interface UserExtraInfoService { |
| | | |
| | | public UserExtraInfo get(Long uid); |
| | | |
| | | |
| | | public UserExtraInfo init(Long uid); |
| | | |
| | | /** |
| | | * @return void |
| | | * @author hxh |
| | | * @description 增加未读消息的数量 |
| | | * @date 15:15 2022/4/8 |
| | | * @param: uid |
| | | * @param: count |
| | | **/ |
| | | public void addUnReadMsgCount(Long uid, int count); |
| | | |
| | | /** |
| | | * @author hxh |
| | | * @description 读所有消息 |
| | | * @date 15:22 2022/4/8 |
| | | * @param: uid |
| | | * @return void |
| | | **/ |
| | | public void setMsgRead(Long uid); |
| | | |
| | | |
| | | /** |
| | | * @return void |
| | | * @author hxh |
| | | * @description 设置邀请码 |
| | | * @date 15:16 2022/4/8 |
| | | * @param: uid |
| | | * @param: code |
| | | **/ |
| | | public void setInviteCode(Long uid, String code); |
| | | |
| | | |
| | | } |
| | |
| | | package com.yeshi.makemoney.app.service.query.config; |
| | | |
| | | import com.yeshi.makemoney.app.entity.config.SystemConfigType; |
| | | |
| | | public class SystemConfigQuery { |
| | | //搜索关键词 |
| | | private String kw; |
| | | //类型 |
| | | private SystemConfigType type; |
| | | |
| | | private String getKw(){ |
| | | return kw; |
| | | public SystemConfigType getType() { |
| | | return type; |
| | | } |
| | | |
| | | private void setKw(String kw){ |
| | | this.kw = kw; |
| | | public void setType(SystemConfigType type) { |
| | | this.type = type; |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.yeshi.makemoney.app.service.query.money; |
| | | |
| | | public class UserExtractMoneyLimitQuery { |
| | | //搜索关键词 |
| | | private String kw; |
| | | |
| | | private String getKw(){ |
| | | return kw; |
| | | } |
| | | |
| | | private void setKw(String kw){ |
| | | this.kw = kw; |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.yeshi.makemoney.app.service.query.team; |
| | | |
| | | public class SpreadImgQuery { |
| | | //搜索关键词 |
| | | private String kw; |
| | | |
| | | private String getKw(){ |
| | | return kw; |
| | | } |
| | | |
| | | private void setKw(String kw){ |
| | | this.kw = kw; |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.yeshi.makemoney.app.service.query.team; |
| | | |
| | | public class UserSpreadImgQuery { |
| | | //搜索关键词 |
| | | private String kw; |
| | | |
| | | private String getKw(){ |
| | | return kw; |
| | | } |
| | | |
| | | private void setKw(String kw){ |
| | | this.kw = kw; |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.yeshi.makemoney.app.service.query.user; |
| | | |
| | | public class UserExtraInfoQuery { |
| | | //搜索关键词 |
| | | private String kw; |
| | | |
| | | private String getKw(){ |
| | | return kw; |
| | | } |
| | | |
| | | private void setKw(String kw){ |
| | | this.kw = kw; |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.yeshi.makemoney.app.utils; |
| | | |
| | | import com.google.zxing.WriterException; |
| | | import jdk.internal.util.xml.impl.Input; |
| | | import org.yeshi.utils.FileUtil; |
| | | import org.yeshi.utils.QRCodeUtil; |
| | | |
| | | import javax.imageio.ImageIO; |
| | | import java.awt.*; |
| | | import java.awt.image.BufferedImage; |
| | | import java.io.*; |
| | | import java.util.HashMap; |
| | | |
| | | /** |
| | | * @author hxh |
| | | * @title: ImageUtil |
| | | * @description: 绘图工具类 |
| | | * @date 2022/4/9 12:43 |
| | | */ |
| | | public class DrawImageUtil { |
| | | |
| | | public static InputStream drawInvite(InputStream bg, String inviteCode, String link) throws Exception { |
| | | BufferedImage bgImage = ImageIO.read(bg); |
| | | final BufferedImage targetImg = new BufferedImage(bgImage.getWidth(), bgImage.getHeight(), |
| | | BufferedImage.TYPE_INT_RGB); |
| | | |
| | | HashMap<RenderingHints.Key, Object> mapH = new HashMap<RenderingHints.Key, Object>(); |
| | | // 抗锯齿 (抗锯齿总开关) |
| | | mapH.put(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); |
| | | // 文字抗锯齿 |
| | | mapH.put(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_GASP); |
| | | |
| | | // 画 背景图片 |
| | | final Graphics2D g2d = targetImg.createGraphics(); |
| | | g2d.drawImage(bgImage, 0, 0, bgImage.getWidth(), bgImage.getHeight(), null); |
| | | g2d.setRenderingHints(mapH); |
| | | g2d.setBackground(Color.WHITE); |
| | | |
| | | Font font = null; |
| | | //画邀请码 |
| | | String st = "我的邀请码:" + inviteCode; |
| | | try { |
| | | font = Font.createFont(Font.PLAIN, DrawImageUtil.class.getClassLoader().getResourceAsStream("fonts/yahei.ttf")).deriveFont(36.0f); |
| | | } catch (FontFormatException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | g2d.setFont(font); |
| | | g2d.setColor(new Color(255, 255, 255)); |
| | | |
| | | |
| | | FontMetrics fm = g2d.getFontMetrics(font); |
| | | int textLength = fm.stringWidth(st); |
| | | |
| | | |
| | | int ax = (bgImage.getWidth() - textLength) / 2; |
| | | int ay = bgImage.getHeight() - bgImage.getWidth() * 8 / 15 + font.getSize(); |
| | | |
| | | g2d.fillRoundRect(ax - 40, ay - 20 - font.getSize(), textLength + 40 * 2, font.getSize() + 25 * 2, font.getSize() + 25 * 2, font.getSize() + 25 * 2); |
| | | |
| | | g2d.setColor(new Color(254, 0, 62)); |
| | | g2d.drawString(st, ax, ay); |
| | | |
| | | |
| | | //画二维码背景 |
| | | g2d.setColor(new Color(255, 255, 255)); |
| | | |
| | | ay = ay - 15 - font.getSize() + (font.getSize() + 17 * 2) * 7 / 4; |
| | | |
| | | g2d.fillRoundRect(ax - 40, ay, textLength + 40 * 2, textLength + 30 * 2, font.getSize() + 17 * 2, font.getSize() + 17 * 2); |
| | | |
| | | |
| | | BufferedImage code = QRCodeUtil.getInstance(500, 500).createImageDeleteWhite(link, null, 0xFFFE003E, 0xFFFFFFFF, true); |
| | | |
| | | |
| | | g2d.drawImage(zoomInImage(code, textLength, textLength), null, ax, ay + 30); |
| | | |
| | | |
| | | ByteArrayOutputStream aos = new ByteArrayOutputStream(); |
| | | ImageIO.write(targetImg, "JPEG", aos); |
| | | return new ByteArrayInputStream(aos.toByteArray()); |
| | | } |
| | | |
| | | public static BufferedImage zoomInImage(BufferedImage originalImage, int width, int height) { |
| | | int type = originalImage.getType(); |
| | | if (type == 0) { |
| | | type = 5; |
| | | } |
| | | BufferedImage newImage = new BufferedImage(width, height, type); |
| | | Graphics g = newImage.getGraphics(); |
| | | g.drawImage(originalImage, 0, 0, width, height, null); |
| | | g.dispose(); |
| | | return newImage; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.yeshi.makemoney.app.utils; |
| | | |
| | | import com.yeshi.makemoney.app.Application; |
| | | |
| | | import java.util.Properties; |
| | | |
| | | /** |
| | | * @author hxh |
| | | * @title: ImageUtil |
| | | * @description: 图片帮助类 |
| | | * @date 2022/4/9 14:15 |
| | | */ |
| | | public class ImageUtil { |
| | | |
| | | private static String domain; |
| | | |
| | | private static String getVisitDomain() { |
| | | if (domain == null) { |
| | | Properties ps = org.yeshi.utils.PropertiesUtil |
| | | .getProperties(Application.class.getClassLoader().getResourceAsStream("cos.properties")); |
| | | domain = ps.getProperty("domain"); |
| | | } |
| | | return domain; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * @author hxh |
| | | * @description 获取cos的图片访问路径 |
| | | * @date 14:17 2022/4/9 |
| | | * @param: key |
| | | * @return java.lang.String |
| | | **/ |
| | | public static String getCOSImageUrl(String key) { |
| | | return getVisitDomain() + key; |
| | | |
| | | } |
| | | |
| | | } |
| | |
| | | import com.yeshi.makemoney.app.entity.goldcorn.GoldCornGetType; |
| | | import org.yeshi.utils.TimeUtil; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | |
| | | private GoldCornGetType type; |
| | | private Integer cornNum; |
| | | private String validateTime; |
| | | private BigDecimal teamGainRate; |
| | | private String remarks; |
| | | private String teamDivide; |
| | | |
| | | public GoldCornGetPrice toEntity(SystemEnum system) { |
| | | GoldCornGetPrice entity = new GoldCornGetPrice(); |
| | | entity.setCornNum(cornNum); |
| | | entity.setId(id); |
| | | entity.setRemarks(remarks); |
| | | entity.setTeamGainRate(teamGainRate); |
| | | entity.setTeamDivide("on".equalsIgnoreCase(teamDivide) ? true : false); |
| | | entity.setSystem(system); |
| | | entity.setType(type); |
| | | entity.setValidateTime(new Date(TimeUtil.convertToTimeTemp(validateTime, "yyyy-MM-dd HH:mm:ss"))); |
| | |
| | | vo.setId(entity.getId()); |
| | | vo.setRemarks(entity.getRemarks()); |
| | | vo.setType(entity.getType()); |
| | | vo.setTeamDivide(entity.getTeamDivide() ? "on" : null); |
| | | vo.setTeamGainRate(entity.getTeamGainRate()); |
| | | vo.setValidateTime(TimeUtil.getGernalTime(entity.getValidateTime().getTime(), "yyyy-MM-dd HH:mm:ss")); |
| | | return vo; |
| | | } |
| | |
| | | public void setRemarks(String remarks) { |
| | | this.remarks = remarks; |
| | | } |
| | | |
| | | public BigDecimal getTeamGainRate() { |
| | | return teamGainRate; |
| | | } |
| | | |
| | | public void setTeamGainRate(BigDecimal teamGainRate) { |
| | | this.teamGainRate = teamGainRate; |
| | | } |
| | | |
| | | public String getTeamDivide() { |
| | | return teamDivide; |
| | | } |
| | | |
| | | public void setTeamDivide(String teamDivide) { |
| | | this.teamDivide = teamDivide; |
| | | } |
| | | } |
New file |
| | |
| | | package com.yeshi.makemoney.app.vo.admin.team; |
| | | |
| | | import com.yeshi.makemoney.app.entity.SystemEnum; |
| | | import com.yeshi.makemoney.app.entity.team.SpreadImg; |
| | | import org.yeshi.utils.TimeUtil; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author hxh |
| | | * @title: SpreadImgAdminVO |
| | | * @description: TODO |
| | | * @date 2022/4/8 19:14 |
| | | */ |
| | | public class SpreadImgAdminVO { |
| | | private String id; |
| | | private String url; |
| | | private String show; |
| | | private SystemEnum system; |
| | | private String startTime; |
| | | private String endTime; |
| | | |
| | | public SpreadImg toEntity(SystemEnum system) { |
| | | SpreadImg entity = new SpreadImg(); |
| | | entity.setId(id); |
| | | entity.setUrl(url); |
| | | entity.setSystem(system); |
| | | entity.setShow("on".equalsIgnoreCase(show) ? true : false); |
| | | entity.setStartTime(new Date(TimeUtil.convertToTimeTemp(startTime, "yyyy-MM-dd HH:mm:ss"))); |
| | | entity.setEndTime(new Date(TimeUtil.convertToTimeTemp(endTime, "yyyy-MM-dd HH:mm:ss"))); |
| | | return entity; |
| | | } |
| | | |
| | | public static SpreadImgAdminVO create(SpreadImg entity) { |
| | | SpreadImgAdminVO vo = new SpreadImgAdminVO(); |
| | | vo.setId(entity.getId()); |
| | | vo.setUrl(entity.getUrl()); |
| | | vo.setShow(entity.getShow() ? "on" : null); |
| | | vo.setStartTime(TimeUtil.getGernalTime(entity.getStartTime().getTime(), "yyyy-MM-dd HH:mm:ss")); |
| | | vo.setEndTime(TimeUtil.getGernalTime(entity.getEndTime().getTime(), "yyyy-MM-dd HH:mm:ss")); |
| | | vo.setSystem(entity.getSystem()); |
| | | return vo; |
| | | } |
| | | |
| | | public String getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(String id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getUrl() { |
| | | return url; |
| | | } |
| | | |
| | | public void setUrl(String url) { |
| | | this.url = url; |
| | | } |
| | | |
| | | public String getShow() { |
| | | return show; |
| | | } |
| | | |
| | | public void setShow(String show) { |
| | | this.show = show; |
| | | } |
| | | |
| | | public String getStartTime() { |
| | | return startTime; |
| | | } |
| | | |
| | | public void setStartTime(String startTime) { |
| | | this.startTime = startTime; |
| | | } |
| | | |
| | | public String getEndTime() { |
| | | return endTime; |
| | | } |
| | | |
| | | public void setEndTime(String endTime) { |
| | | this.endTime = endTime; |
| | | } |
| | | |
| | | public SystemEnum getSystem() { |
| | | return system; |
| | | } |
| | | |
| | | public void setSystem(SystemEnum system) { |
| | | this.system = system; |
| | | } |
| | | } |
| | |
| | | appId =1255749512 |
| | | secretId =AKIDTlpgJhLjOozvd6QI2XnpfGbgV4NQJk25 |
| | | secretKey =xhCSUHo55oHUQ6XicFcmfIgspX0EEzWo |
| | | bucketName =xxxx |
| | | region=ap-nanjing |
| | | bucketName=makemoney |
| | | region=ap-guangzhou |
| | | #图片访问域名 |
| | | domain=http://img.mm.yeshitv.com |
| | |
| | | <?xml version='1.0' encoding='UTF-8'?> |
| | | <!DOCTYPE generator-config PUBLIC "-//yeshitv.com//DTD generator_code 1.0//EN" |
| | | "http://dtd.yeshitv.com/generator_code/1.3.dtd"> |
| | | <generator-config class="com.yeshi.makemoney.app.entity.msg.AppPageNotifyMsg"> |
| | | <generator-config class="com.yeshi.makemoney.app.entity.team.UserSpreadImg"> |
| | | |
| | | <dao package="com.yeshi.makemoney.app.dao.msg"> |
| | | <dao package="com.yeshi.makemoney.app.dao.team"> |
| | | <queryList> |
| | | <query name="type" type="equal"/> |
| | | <query name="show" type="equal"/> |
| | | <query name="content" type="contains"/> |
| | | <query name="sourceMD5" type="equal"/> |
| | | <query name="uid" type="equal"/> |
| | | </queryList> |
| | | </dao> |
| | | |
| | | <service interPackage="com.yeshi.makemoney.app.service.inter.msg" |
| | | implPackage="com.yeshi.makemoney.app.service.impl.msg" |
| | | queryPackage="com.yeshi.makemoney.app.service.query.msg"> |
| | | <exception package="com.yeshi.makemoney.app.exception.msg"></exception> |
| | | <service interPackage="com.yeshi.makemoney.app.service.inter.team" |
| | | implPackage="com.yeshi.makemoney.app.service.impl.team" |
| | | queryPackage="com.yeshi.makemoney.app.service.query.team"> |
| | | <exception package="com.yeshi.makemoney.app.exception.team" |
| | | base="com.ks.lib.common.exception.BaseException"></exception> |
| | | </service> |
| | | |
| | | <admin> |
| | | <controller package="com.yeshi.makemoney.app.controller.admin.msg" |
| | | mapping="/admin/api/msg/appnotify" |
| | | <controller package="com.yeshi.makemoney.app.controller.admin.team" |
| | | mapping="/admin/api/team/spreadimg" |
| | | jsonp="false"> |
| | | </controller> |
| | | <pages title="用户消息" |
| | | pageDir="D:/workspace/makemoney/server/MakeMoney/app/src/main/resources/static/msg"> |
| | | <pages title="用户邀请图" |
| | | pageDir="D:/workspace/makemoney/server/MakeMoney/app/src/main/resources/static/team"> |
| | | <list> |
| | | <searchForm> |
| | | <columns> |
| | | <column property="type" title="消息类型"> |
| | | <select> |
| | | <api path="/admin/api/msg/appnotify/getMsgTypes"> |
| | | </api> |
| | | </select> |
| | | </column> |
| | | <column property="kw" title="关键词"> |
| | | <text inputType="TEXT" placeHolder="内容关键词"></text> |
| | | </column> |
| | |
| | | </searchForm> |
| | | <columns> |
| | | <column property="id" title="ID" showType="TEXT"></column> |
| | | <column property="type" title="消息类型" showType="TEXT"></column> |
| | | <column property="url" title="素材图" showType="IMG"></column> |
| | | <column property="show" title="是否显示" showType="SWITCH"></column> |
| | | <column property="content" title="内容" showType="TEXT"></column> |
| | | <column property="contentUrl" title="链接" showType="TEXT"></column> |
| | | <column property="md5" title="MD5" showType="TEXT"></column> |
| | | <column property="startTime" title="显示开始时间" showType="TEXT"></column> |
| | | <column property="endTime" title="显示结束时间" showType="TEXT"></column> |
| | | <column property="canClose" title="是否可以关闭" showType="SWITCH"></column> |
| | | <column property="createTime" title="创建时间" showType="TEXT"></column> |
| | | <column property="updateTime" title="修改时间" showType="TEXT"></column> |
| | | <column property="startTime" title="显示开始时间" showType="DATETIME"></column> |
| | | <column property="endTime" title="显示结束时间" showType="DATETIME"></column> |
| | | <column property="createTime" title="创建时间" showType="DATETIME"></column> |
| | | <column property="updateTime" title="修改时间" showType="DATETIME"></column> |
| | | </columns> |
| | | </list> |
| | | |
| | | <add> |
| | | |
| | | <column property="type" title="消息类型"> |
| | | <select> |
| | | <api path="/admin/api/msg/appnotify/getMsgTypes"></api> |
| | | </select> |
| | | <column property="url" title="素材图"> |
| | | <img height="100"> |
| | | <api path="/admin/api/file/uploadImg"> |
| | | <params> |
| | | <value key="type">spreadimg</value> |
| | | </params> |
| | | </api> |
| | | |
| | | </img> |
| | | </column> |
| | | |
| | | <column property="show" title="是否显示"> |
| | | <switch></switch> |
| | | |
| | | </column> |
| | | <column property="canClose" title="是否可以关闭"> |
| | | <switch></switch> |
| | | </column> |
| | | |
| | | <column property="content" title="内容"> |
| | | <text inputType="TEXT" maxLength="128"> |
| | | <verify type="none" require="true"></verify> |
| | | </text> |
| | | </column> |
| | | <column property="contentUrl" title="链接"> |
| | | <text inputType="TEXT" maxLength="256"> |
| | | <verify type="url"></verify> |
| | | </text> |
| | | </column> |
| | | <column property="startTime" title="显示开始时间"> |
| | | <text inputType="DATETIME"> |
| | | <verify type="datetime"></verify> |
| | |
| | | </add> |
| | | |
| | | <update> |
| | | <column property="type" title="消息类型"> |
| | | <select enable="false"> |
| | | <api path="/admin/api/msg/appnotify/getMsgTypes"></api> |
| | | </select> |
| | | <column property="url" title="素材图"> |
| | | <img height="100" enable="false"></img> |
| | | </column> |
| | | <column property="show" title="是否显示"> |
| | | <switch></switch> |
| | | |
| | | </column> |
| | | <column property="canClose" title="是否可以关闭"> |
| | | <switch></switch> |
| | | </column> |
| | | |
| | | <column property="content" title="内容"> |
| | | <text inputType="TEXT" maxLength="128"> |
| | | <verify type="none" require="true"></verify> |
| | | </text> |
| | | </column> |
| | | <column property="contentUrl" title="链接"> |
| | | <text inputType="TEXT" maxLength="256"> |
| | | <verify type="url"></verify> |
| | | </text> |
| | | </column> |
| | | <column property="startTime" title="显示开始时间"> |
| | | <text inputType="DATETIME"> |
| | | <verify type="datetime"></verify> |
| | |
| | | <?xml version='1.0' encoding='UTF-8'?> |
| | | <!DOCTYPE generator-config PUBLIC "-//yeshitv.com//DTD generator_code 1.0//EN" |
| | | "http://dtd.yeshitv.com/generator_code/1.3.dtd"> |
| | | <generator-config class="com.yeshi.makemoney.app.entity.msg.UserMsg"> |
| | | <generator-config class="com.yeshi.makemoney.app.entity.team.UserSpreadImg"> |
| | | |
| | | <dao package="com.yeshi.makemoney.app.dao.msg"> |
| | | <dao package="com.yeshi.makemoney.app.dao.team"> |
| | | <queryList> |
| | | <query name="sourceMD5" type="equal"/> |
| | | <query name="uid" type="equal"/> |
| | | <query name="type" type="equal"/> |
| | | <query name="createTime" type="equal"/> |
| | | </queryList> |
| | | </dao> |
| | | |
| | | <service interPackage="com.yeshi.makemoney.app.service.inter.msg" |
| | | implPackage="com.yeshi.makemoney.app.service.impl.msg" |
| | | queryPackage="com.yeshi.makemoney.app.service.query.msg" adminVOPackage="com.yeshi"> |
| | | <exception package="com.yeshi.makemoney.app.exception.msg" base="com.ks.lib.common.exception.BaseException"></exception> |
| | | <service interPackage="com.yeshi.makemoney.app.service.inter.team" |
| | | implPackage="com.yeshi.makemoney.app.service.impl.team" |
| | | queryPackage="com.yeshi.makemoney.app.service.query.team"> |
| | | <exception package="com.yeshi.makemoney.app.exception.team" |
| | | base="com.ks.lib.common.exception.BaseException"></exception> |
| | | </service> |
| | | |
| | | <admin> |
| | | <controller package="com.yeshi.makemoney.app.controller.admin.msg" |
| | | mapping="admin/api/msg/usermsg" |
| | | <controller package="com.yeshi.makemoney.app.controller.admin.team" |
| | | mapping="/admin/api/team/spreadimg" |
| | | jsonp="false"> |
| | | </controller> |
| | | <pages title="用户消息" |
| | | pageDir="D:/workspace/makemoney/server/MakeMoney/app/src/main/resources/static/msg"> |
| | | <pages title="用户邀请图" |
| | | pageDir="D:/workspace/makemoney/server/MakeMoney/app/src/main/resources/static/team"> |
| | | <list> |
| | | <searchForm> |
| | | <columns> |
| | | <column property="type" title="消息类型"> |
| | | <select> |
| | | <api path="/admin/api/msg/usermsg/getMsgTypes"> |
| | | </api> |
| | | </select> |
| | | </column> |
| | | <column property="uid" title="用户ID"> |
| | | <text inputType="TEXT" placeHolder="请输入用户ID"></text> |
| | | <text inputType="TEXT" placeHolder="用户ID"></text> |
| | | </column> |
| | | </columns> |
| | | </searchForm> |
| | | <columns> |
| | | <column property="id" title="ID" showType="TEXT"></column> |
| | | <column property="uid" title="用户ID" showType="TEXT"></column> |
| | | <column property="type" title="消息类型" showType="TEXT"></column> |
| | | <column property="contentList" title="内容" showType="TEXT"></column> |
| | | <column property="createTime" title="创建时间" showType="TEXT"></column> |
| | | <column property="updateTime" title="修改时间" showType="TEXT"></column> |
| | | <column property="url" title="邀请图" showType="IMG"></column> |
| | | <column property="sourceMD5" title="原图MD5" showType="TEXT"></column> |
| | | <column property="createTime" title="创建时间" showType="DATETIME"></column> |
| | | <column property="updateTime" title="修改时间" showType="DATETIME"></column> |
| | | </columns> |
| | | </list> |
| | | |
| | | </pages> |
| | | |
| | | </admin> |
| | |
| | | <if test="query.state!=null"> |
| | | and state = #{query.state} |
| | | </if> |
| | | |
| | | <if test="query.stateList!=null"> |
| | | <foreach collection="query.stateList" open=" and (" separator=" or " close=")" item="state"> |
| | | state = #{state} |
| | | </foreach> |
| | | </if> |
| | | |
| | | <if test="query.minMoney!=null"> |
| | | and money >= #{query.minMoney} |
| | | </if> |
| | | |
| | | <if test="query.maxMoney!=null"> |
| | | and #{query.maxMoney} >money |
| | | </if> |
| | | |
| | | <if test="query.state!=null"> |
| | | and state = #{query.state} |
| | | </if> |
| | | |
| | | <if test="query.maxSuccessTime!=null"> |
| | | and success_time <![CDATA[<]]> #{query.maxSuccessTime} |
| | | </if> |
| | |
| | | <label for="L_appCode" class="layui-form-label"> |
| | | 内容</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" name="value" lay-verify="" placeholder="" autocomplete="off" |
| | | class="layui-input"> |
| | | <textarea type="text" rows="5" name="value" lay-verify="" placeholder="" autocomplete="off" |
| | | class="layui-textarea"></textarea> |
| | | </div> |
| | | |
| | | </div> |
| | |
| | | //渲染上传控件 |
| | | uploadTool.init(upload); |
| | | |
| | | var params = {}; |
| | | var type = ksapp.getQueryParam("type"); |
| | | if (type != null && type.length > 0) { |
| | | params["type"] = type; |
| | | } |
| | | |
| | | ksapp.postJSON('/admin/api/config/getKeyList', {}, function (res) { |
| | | ksapp.post('/admin/api/config/getKeyList', params, function (res) { |
| | | if (res.code == 0) { |
| | | //填充数据 |
| | | $("select[name=key]").empty(); |
| | |
| | | </body> |
| | | <script type="text/html" id="toolbar"> |
| | | <div class="layui-btn-container"> |
| | | <button class="layui-btn" onclick="xadmin.open('添加系统配置信息','system_config_add.html',500,580)"><i |
| | | <button class="layui-btn" onclick="xadmin.open('添加系统配置信息','system_config_add.html?type='+ ksapp.getQueryParam('type'),500,580)"><i |
| | | class="layui-icon"></i>添加 |
| | | </button> |
| | | </div> |
| | |
| | | |
| | | <script type="text/html" id="optContainer"> |
| | | <div class="layui-btn-container"> |
| | | <a title="修改" onclick="xadmin.open('修改系统配置信息','system_config_update.html?id={{d.id}}',500,580)" href="javascript:;"> |
| | | <a title="修改" onclick="xadmin.open('修改系统配置信息','system_config_update.html?id={{d.id}}',500,580)" |
| | | href="javascript:;"> |
| | | <i class="layui-icon"></i> |
| | | </a> |
| | | </div> |
| | |
| | | cols: [[{type: 'checkbox', title: "ID"}, |
| | | {field: 'name', width: 200, sort: false, title: "名称"}, |
| | | {field: 'key', width: 120, sort: false, title: "关键字"}, |
| | | {field: 'value', width: 400, sort: false, title: "内容",templet:function(res){ |
| | | { |
| | | field: 'value', width: 400, sort: false, title: "内容", templet: function (res) { |
| | | if("object"== typeof res.value){ |
| | | return JSON.stringify(res.value); |
| | | }else{ |
| | | return res.value; |
| | | } |
| | | |
| | | }}, |
| | | } |
| | | }, |
| | | {field: 'remarks', width: 120, sort: false, title: "备注"}, |
| | | {field: 'createTime', width: 120, sort: false, title: "创建时间"}, |
| | | {field: 'updateTime', width: 120, sort: false, title: "修改时间"}, |
| | |
| | | }); |
| | | |
| | | break; |
| | | }; |
| | | } |
| | | ; |
| | | }); |
| | | //请求搜索表单中需要的数据 |
| | | $('#search').trigger("click"); |
| | |
| | | }); |
| | | }, |
| | | search: function (params) { |
| | | params["type"] = ksapp.getQueryParam("type"); |
| | | var ps = {}; |
| | | for (var key in params) { |
| | | if (params[key] != null && params[key].length > 0) { |
| | | ps[key] = params[key]; |
| | | } |
| | | } |
| | | |
| | | |
| | | //数据重载 |
| | | tableIns.reload({ |
| | | where: params, |
| | |
| | | <label for="L_appCode" class="layui-form-label"> |
| | | 内容</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" name="value" lay-verify="" placeholder="" autocomplete="off" |
| | | class="layui-input"> |
| | | <textarea type="text" rows="5" name="value" lay-verify="" placeholder="" autocomplete="off" |
| | | class="layui-textarea"></textarea> |
| | | </div> |
| | | |
| | | </div> |
| | |
| | | </div> |
| | | |
| | | </div> |
| | | |
| | | <div class="layui-form-item"> |
| | | <label for="L_appCode" class="layui-form-label"> |
| | | <span class="x-red">*</span> |
| | | 团队增益比例</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" name="teamGainRate" lay-verify="required|number" placeholder="团队增益比例(保留2位小数)" |
| | | autocomplete="off" |
| | | class="layui-input"> |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | <div class="layui-form-item"> |
| | | <label for="L_appCode" class="layui-form-label"> |
| | | <span class="x-red">*</span> |
| | | 是否二级分销</label> |
| | | <div class="layui-input-block"> |
| | | <input type="checkbox" name="teamDivide" lay-skin="switch"> |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | <div class="layui-form-item"> |
| | | <label for="L_appCode" class="layui-form-label"> |
| | | <span class="x-red">*</span> |
| | |
| | | {field: 'id', width: 150, sort: false, title: "ID"}, |
| | | {field: 'type', width: 120, sort: false, title: "类型"}, |
| | | {field: 'cornNum', width: 120, sort: false, title: "金币数量"}, |
| | | {field: 'teamGainRate', width: 120, sort: false, title: "团队增益比例"}, |
| | | { |
| | | field: 'teamDivide', |
| | | width: 100, |
| | | sort: false, |
| | | title: "是否二级分销", |
| | | templet: function (res) { |
| | | if (res.teamDivide) { |
| | | return " <input type=\"checkbox\" checked='true' disabled lay-skin=\"switch\""; |
| | | } else { |
| | | return " <input type=\"checkbox\" disabled lay-skin=\"switch\""; |
| | | } |
| | | } |
| | | }, |
| | | {field: 'validateTime', width: 150, sort: false, title: "生效时间"}, |
| | | {field: 'remarks', width: 120, sort: false, title: "备注"}, |
| | | {field: 'createTime', width: 150, sort: false, title: "创建时间"}, |
| | |
| | | <label for="L_appCode" class="layui-form-label"> |
| | | 类型</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" name="type" lay-verify="" placeholder="" autocomplete="off" |
| | | <input type="text" name="type" lay-verify="" placeholder="" autocomplete="off" disabled |
| | | class="layui-input"> |
| | | </div> |
| | | |
| | |
| | | <span class="x-red">*</span> |
| | | 金币数量</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" name="cornNum" lay-verify="required|number" placeholder="请输入金币数量" autocomplete="off" |
| | | <input type="text" name="cornNum" lay-verify="required|number" placeholder="请输入金币数量" |
| | | autocomplete="off" |
| | | class="layui-input"> |
| | | </div> |
| | | |
| | | </div> |
| | | |
| | | <div class="layui-form-item"> |
| | | <label for="L_appCode" class="layui-form-label"> |
| | | <span class="x-red">*</span> |
| | | 团队增益比例</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" name="teamGainRate" lay-verify="required|number" placeholder="团队增益比例(保留2位小数)" |
| | | autocomplete="off" |
| | | class="layui-input"> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-form-item"> |
| | | <label for="L_appCode" class="layui-form-label"> |
| | | <span class="x-red">*</span> |
| | | 是否二级分销</label> |
| | | <div class="layui-input-block"> |
| | | <input type="checkbox" name="teamDivide" lay-skin="switch"> |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | <div class="layui-form-item"> |
| | | <label for="L_appCode" class="layui-form-label"> |
| | | <span class="x-red">*</span> |
| | | 生效日期</label> |
| | | <div class="layui-input-block"> |
| | | <input type="datetime" name="validateTime" id="validateTime" lay-verify="required|datetime" placeholder="请选择生效时间" autocomplete="off" |
| | | <input type="datetime" name="validateTime" id="validateTime" lay-verify="required|datetime" |
| | | placeholder="请选择生效时间" autocomplete="off" |
| | | class="layui-input"> |
| | | </div> |
| | | |
| | |
| | | {field: 'uid', width: 80, sort: false, title: "用户ID"}, |
| | | {field: 'cornNum', width: 120, sort: false, title: "金币数量"}, |
| | | {field: 'fromUid', width: 120, sort: false, title: "缘由用户ID"}, |
| | | { |
| | | field: 'isDouble', width: 120, sort: false, title: "是否加倍", templet: function (res) { |
| | | if (res.isDouble) { |
| | | return "是"; |
| | | } |
| | | return "否"; |
| | | } |
| | | }, |
| | | {field: 'remarks', width: 120, sort: false, title: "备注"}, |
| | | {field: 'createTime', width: 150, sort: false, title: "创建时间"}, |
| | | {fixed: 'right', width: 80, title: "操作", toolbar: '#optContainer'}]], |
| | |
| | | <i class="iconfont"></i> |
| | | <cite>APP页面通知</cite></a> |
| | | </li> |
| | | <li> |
| | | <a onclick="xadmin.add_tab('邀请图素材','team/spread_img_list.html')"> |
| | | <i class="iconfont"></i> |
| | | <cite>邀请图素材</cite></a> |
| | | </li> |
| | | |
| | | |
| | | |
| | | </ul> |
| | | </li> |
| | |
| | | </li> |
| | | |
| | | <li> |
| | | <a onclick="xadmin.add_tab('用户邀请图','team/user_spread_img_list.html')"> |
| | | <i class="iconfont"></i> |
| | | <cite>用户邀请图</cite></a> |
| | | </li> |
| | | |
| | | <li> |
| | | <a href="javascript:;"> |
| | | <i class="left-nav-li" lay-tips="会员"></i> |
| | | <cite>会员</cite> |
| | |
| | | <a onclick="xadmin.add_tab('金币汇率','goldcorn/gold_corn_money_exchange_rate_record_list.html')"> |
| | | <i class="iconfont"></i> |
| | | <cite>金币汇率</cite></a> |
| | | </li> |
| | | |
| | | <li> |
| | | <a onclick="xadmin.add_tab('团队分成比例','config/system_config_list.html?type=team')"> |
| | | <i class="iconfont"></i> |
| | | <cite>团队分成比例</cite></a> |
| | | </li> |
| | | |
| | | <li> |
| | |
| | | <cite>资金管理</cite> |
| | | <i class="iconfont nav_right"></i></a> |
| | | <ul class="sub-menu"> |
| | | |
| | | <li> |
| | | <a onclick="xadmin.add_tab('提现','money/extract_list.html')"> |
| | | <a onclick="xadmin.add_tab('提现设置','money/extract_setting.html')"> |
| | | <i class="iconfont"></i> |
| | | <cite>提现</cite></a> |
| | | <cite>提现设置</cite></a> |
| | | </li> |
| | | |
| | | <li> |
| | | <a onclick="xadmin.add_tab('提现记录','money/extract_list.html')"> |
| | | <i class="iconfont"></i> |
| | | <cite>提现记录</cite></a> |
| | | </li> |
| | | |
| | | <li> |
| | |
| | | <i class="iconfont nav_right"></i></a> |
| | | <ul class="sub-menu"> |
| | | <li> |
| | | <a onclick="xadmin.add_tab('系统参数','config/system_config_list.html')"> |
| | | <a onclick="xadmin.add_tab('系统参数','config/system_config_list.html?type=system')"> |
| | | <i class="iconfont"></i> |
| | | <cite>系统参数</cite></a> |
| | | </li> |
| | | |
| | | <li> |
| | | <a onclick="xadmin.add_tab('客户端参数','config/system_config_list.html')"> |
| | | <i class="iconfont"></i> |
| | | <cite>客户端参数</cite></a> |
| | | </li> |
| | | |
| | | </ul> |
| | | </li> |
| | | </ul> |
New file |
| | |
| | | <!DOCTYPE html> |
| | | <html class="x-admin-sm"> |
| | | |
| | | <head> |
| | | <meta charset="UTF-8"> |
| | | <title>新增系统配置信息</title> |
| | | <meta name="renderer" content="webkit"> |
| | | <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
| | | <meta name="viewport" |
| | | content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi"/> |
| | | <link rel="stylesheet" href="../css/font.css"> |
| | | <link rel="stylesheet" href="../css/xadmin.css"> |
| | | <script type="text/javascript" src="../lib/layui/layui.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../js/xadmin.js"></script> |
| | | <script src="../js/vue.min.js" type="text/javascript" charset="utf-8"></script> |
| | | <script src="../js/http.js" type="text/javascript" charset="utf-8"></script> |
| | | <script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script> |
| | | <!-- 让IE8/9支持媒体查询,从而兼容栅格 --> |
| | | <!--[if lt IE 9]> |
| | | <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script> |
| | | <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script> |
| | | <![endif]--> |
| | | </head> |
| | | <body> |
| | | <div class="x-nav"> |
| | | <span class="layui-breadcrumb"> |
| | | <a href="">###</a> |
| | | <a> |
| | | <cite>###</cite></a> |
| | | </span> |
| | | <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" |
| | | onclick="location.reload()" title="刷新"> |
| | | <i class="layui-icon layui-icon-refresh" style="line-height:30px"></i> |
| | | </a> |
| | | </div> |
| | | <div class="layui-fluid"> |
| | | <div class="layui-row" style="max-width: 500px"> |
| | | <form class="layui-form" lay-filter="update"> |
| | | |
| | | <div class="layui-form-item"> |
| | | <label for="L_appCode" class="layui-form-label"> |
| | | <span class="x-red">*</span> |
| | | 单次提现的最大金额</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" name="maxMoney" lay-verify="required|number" placeholder="" autocomplete="off" |
| | | class="layui-input"> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-form-item"> |
| | | <label for="L_appCode" class="layui-form-label"> |
| | | <span class="x-red">*</span> |
| | | 单次提现的最小金额</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" name="minMoney" lay-verify="required|number" placeholder="" autocomplete="off" |
| | | class="layui-input"> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-form-item"> |
| | | <label for="L_appCode" class="layui-form-label"> |
| | | <span class="x-red">*</span> |
| | | 每天最多提现几次</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" name="maxNumPerDay" lay-verify="required|number" placeholder="" |
| | | autocomplete="off" |
| | | class="layui-input"> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-form-item"> |
| | | <label for="L_appCode" class="layui-form-label"> |
| | | <span class="x-red">*</span> |
| | | 每天最多提多少钱</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" name="maxMoneyPerDay" lay-verify="required|number" placeholder="" |
| | | autocomplete="off" |
| | | class="layui-input"> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-form-item"> |
| | | <label for="L_appCode" class="layui-form-label"> |
| | | <span class="x-red">*</span> |
| | | 新人小金额提现次数</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" name="newerLittleMoneyNum" lay-verify="required|number" placeholder="" |
| | | autocomplete="off" |
| | | class="layui-input"> |
| | | </div> |
| | | <div class="layui-form-mid layui-word-aux">小金额:小于1元</div> |
| | | </div> |
| | | |
| | | <div class="layui-form-item"> |
| | | <label for="L_appCode" class="layui-form-label"> |
| | | <span class="x-red">*</span> |
| | | 提现面额</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" name="extractMoneyList" lay-verify="required" placeholder="" |
| | | autocomplete="off" |
| | | class="layui-input"> |
| | | <div class="layui-form-mid layui-word-aux">采用英文逗号分隔</div> |
| | | </div> |
| | | |
| | | |
| | | </div> |
| | | |
| | | |
| | | <div class="layui-form-item"> |
| | | <label for="L_remarks" class="layui-form-label"></label> |
| | | <button class="layui-btn" lay-filter="update" lay-submit="">确定</button> |
| | | </div> |
| | | </form> |
| | | </div> |
| | | </div> |
| | | <script> |
| | | //初始化上传控件 |
| | | var uploadTool = { |
| | | callback: null, |
| | | chooseImage: {}, |
| | | uploadArray: new Array(), |
| | | init: function (upload) { |
| | | this.uploadArray = new Array(); |
| | | |
| | | }, |
| | | upload: function (result) { |
| | | if (this.uploadArray.length > 0) { |
| | | this.callback = result; |
| | | //同时上传 |
| | | for (var i = 0; i < this.uploadArray.length; i++) { |
| | | this.uploadArray[i].upload(); |
| | | } |
| | | } else { |
| | | result(); |
| | | } |
| | | } |
| | | }; |
| | | |
| | | |
| | | </script> |
| | | |
| | | <script> |
| | | //填充数据 |
| | | function fillData(form) { |
| | | ksapp.post('/admin/api/money/extract/getExtractConfig', {}, function (res) { |
| | | if (res.code == 0) { |
| | | form.val("update", res.data); |
| | | } else { |
| | | layer.msg(res.msg); |
| | | } |
| | | }, function (res) { |
| | | layer.msg("详情获取失败"); |
| | | }); |
| | | } |
| | | </script> |
| | | |
| | | <script> |
| | | layui.use(['form', 'layer', 'jquery', 'upload'], function () { |
| | | $ = layui.jquery; |
| | | var form = layui.form, |
| | | layer = layui.layer, |
| | | upload = layui.upload; |
| | | |
| | | var verify = {}; |
| | | //自定义验证规则 |
| | | form.verify(verify); |
| | | |
| | | //渲染上传控件 |
| | | uploadTool.init(upload); |
| | | |
| | | var params = {}; |
| | | var type = ksapp.getQueryParam("type"); |
| | | if (type != null && type.length > 0) { |
| | | params["type"] = type; |
| | | } |
| | | |
| | | //监听提交 |
| | | form.on('submit(update)', |
| | | function (data) { |
| | | console.log(data.field); |
| | | //转换json对象 |
| | | for (key in data.field) { |
| | | if (key.indexOf(".") > -1) { |
| | | var value = data.field[key]; |
| | | delete data.field[key]; |
| | | var onkeys = key.split("."); |
| | | //创建对象 |
| | | if (data.field[onkeys[0]] == undefined) { |
| | | data.field[onkeys[0]] = {}; |
| | | } |
| | | data.field[onkeys[0]][onkeys[1]] = value; |
| | | } |
| | | } |
| | | uploadTool.upload(function () { |
| | | data.field["extractMoneyList"] = eval("["+data.field["extractMoneyList"]+"]") |
| | | //发异步,把数据提交给php |
| | | ksapp.postJSON('/admin/api/money/extract/updateExtractConfig', data.field, function (res) { |
| | | if (res.code == 0) { |
| | | var index = layer.alert("修改成功", { |
| | | icon: 6 |
| | | }, |
| | | function () { |
| | | layer.close(index); |
| | | }); |
| | | } else { |
| | | layer.msg(res.msg); |
| | | } |
| | | |
| | | }, function (res) { |
| | | }); |
| | | }); |
| | | return false; |
| | | }); |
| | | fillData(form); |
| | | }) |
| | | ; |
| | | </script> |
| | | </body> |
| | | |
| | | </html> |
New file |
| | |
| | | <!DOCTYPE html> |
| | | <html class="x-admin-sm"> |
| | | |
| | | <head> |
| | | <meta charset="UTF-8"> |
| | | <title>新增邀请图素材</title> |
| | | <meta name="renderer" content="webkit"> |
| | | <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
| | | <meta name="viewport" |
| | | content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi"/> |
| | | <link rel="stylesheet" href="../css/font.css"> |
| | | <link rel="stylesheet" href="../css/xadmin.css"> |
| | | <script type="text/javascript" src="../lib/layui/layui.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../js/xadmin.js"></script> |
| | | <script src="../js/vue.min.js" type="text/javascript" charset="utf-8"></script> |
| | | <script src="../js/http.js" type="text/javascript" charset="utf-8"></script> |
| | | <script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script> |
| | | <!-- 让IE8/9支持媒体查询,从而兼容栅格 --> |
| | | <!--[if lt IE 9]> |
| | | <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script> |
| | | <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script> |
| | | <![endif]--> |
| | | </head> |
| | | <body> |
| | | <div class="layui-fluid"> |
| | | <div class="layui-row"> |
| | | <form class="layui-form" lay-filter="add"> |
| | | |
| | | <div class="layui-form-item"> |
| | | <label for="L_appCode" class="layui-form-label"> |
| | | 素材图</label> |
| | | <div class="layui-input-block"> |
| | | |
| | | <img id="img_url" style="display: block;margin-bottom: 10px; max-height:100px; "/> |
| | | <button type="button" class="layui-btn" id="upload_url" style="margin-bottom: 5px"> |
| | | <i class="layui-icon"></i>上传图片 |
| | | </button> |
| | | <input class="layui-input" type="text" name="url" placeholder="请输入图片链接"> |
| | | </div> |
| | | |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label for="L_appCode" class="layui-form-label"> |
| | | 是否显示</label> |
| | | <div class="layui-input-block"> |
| | | <input type="checkbox" name="show" lay-skin="switch"></div> |
| | | |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label for="L_appCode" class="layui-form-label"> |
| | | 显示开始时间</label> |
| | | <div class="layui-input-block"> |
| | | <input type="datetime" name="startTime" lay-verify="required|datetime" placeholder="" |
| | | autocomplete="off" |
| | | class="layui-input"> |
| | | </div> |
| | | |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label for="L_appCode" class="layui-form-label"> |
| | | 显示结束时间</label> |
| | | <div class="layui-input-block"> |
| | | <input type="datetime" name="endTime" lay-verify="required|datetime" placeholder="" |
| | | autocomplete="off" |
| | | class="layui-input"> |
| | | </div> |
| | | |
| | | </div> |
| | | |
| | | <div class="layui-form-item"> |
| | | <label for="L_remarks" class="layui-form-label"></label> |
| | | <button class="layui-btn" lay-filter="add" lay-submit="">确定</button> |
| | | </div> |
| | | </form> |
| | | </div> |
| | | </div> |
| | | <script> |
| | | //初始化上传控件 |
| | | var uploadTool = { |
| | | callback: null, |
| | | chooseImage: {}, |
| | | uploadArray: new Array(), |
| | | init: function (upload) { |
| | | this.uploadArray = new Array(); |
| | | this.uploadArray.push(upload.render({ |
| | | elem: '#upload_url', //绑定元素 |
| | | url: '/admin/api/file/uploadImg', //上传接口 |
| | | data: { |
| | | "type": "spreadimg", |
| | | }, |
| | | auto: false, |
| | | accept: 'images', |
| | | acceptMime: 'image/*', |
| | | field: "file_url", |
| | | choose: function (obj) { |
| | | //将每次选择的文件追加到文件队列 |
| | | var files = obj.pushFile(); |
| | | //预读本地文件,如果是多文件,则会遍历。(不支持ie8/9) |
| | | obj.preview(function (index, file, result) { |
| | | $("#img_url").attr("src", result); |
| | | //记录选中的文件 |
| | | uploadTool.chooseImage["url"] = "1"; |
| | | }); |
| | | }, |
| | | before: function (obj) { |
| | | layer.load(); |
| | | }, |
| | | done: function (res, index, upload) { |
| | | console.log("done"); |
| | | layer.closeAll('loading'); //关闭loading |
| | | //上传完毕后删除 |
| | | if (res.code == 0) { |
| | | //获取链接 |
| | | $("input[name='url']").val(res.data.url); |
| | | delete uploadTool.chooseImage["url"]; |
| | | if (Object.keys(uploadTool.chooseImage).length == 0) { |
| | | //全部上传成功 |
| | | uploadTool.callback(); |
| | | } |
| | | } else { |
| | | layer.msg(res.msg); |
| | | } |
| | | }, |
| | | error: function (index, upload) { |
| | | layer.msg("素材图上传出错"); |
| | | layer.closeAll('loading'); //关闭loading |
| | | } |
| | | })); |
| | | |
| | | }, |
| | | upload: function (result) { |
| | | |
| | | if (this.uploadArray.length > 0&&Object.keys(this.chooseImage).length>0) { |
| | | this.callback = result; |
| | | //同时上传 |
| | | for (var i = 0; i < this.uploadArray.length; i++) { |
| | | this.uploadArray[i].upload(); |
| | | } |
| | | } else { |
| | | result(); |
| | | } |
| | | } |
| | | }; |
| | | |
| | | |
| | | </script> |
| | | |
| | | <script> |
| | | layui.use(['form', 'layer', 'jquery', 'upload', 'laydate'], function () { |
| | | $ = layui.jquery; |
| | | var form = layui.form, |
| | | layer = layui.layer, |
| | | upload = layui.upload, |
| | | laydate = layui.laydate; |
| | | |
| | | var verify = {}; |
| | | //自定义验证规则 |
| | | form.verify(verify); |
| | | |
| | | //渲染上传控件 |
| | | uploadTool.init(upload); |
| | | |
| | | laydate.render({ |
| | | elem: "input[name=startTime]" //指定元素 |
| | | , type: 'datetime' |
| | | }); |
| | | laydate.render({ |
| | | elem: "input[name=endTime]", //指定元素 |
| | | type: 'datetime' |
| | | }); |
| | | |
| | | |
| | | //监听提交 |
| | | form.on('submit(add)', |
| | | function (data) { |
| | | console.log(data.field); |
| | | //转换json对象 |
| | | for (key in data.field) { |
| | | if (key.indexOf(".") > -1) { |
| | | var value = data.field[key]; |
| | | delete data.field[key]; |
| | | var onkeys = key.split("."); |
| | | //创建对象 |
| | | if (data.field[onkeys[0]] == undefined) { |
| | | data.field[onkeys[0]] = {}; |
| | | } |
| | | data.field[onkeys[0]][onkeys[1]] = value; |
| | | } |
| | | } |
| | | uploadTool.upload(function () { |
| | | console.log("开始上传表单"); |
| | | //发异步,把数据提交给php |
| | | ksapp.post('/admin/api/team/spreadimg/add', data.field, function (res) { |
| | | if (res.code == 0) { |
| | | layer.alert("增加成功", { |
| | | icon: 6 |
| | | }, |
| | | function () { |
| | | //关闭当前frame |
| | | xadmin.close(); |
| | | // 可以对父窗口进行刷新 |
| | | // xadmin.father_reload(); |
| | | }); |
| | | } else { |
| | | layer.msg(res.msg); |
| | | } |
| | | |
| | | }, function (res) { |
| | | }); |
| | | }); |
| | | return false; |
| | | }); |
| | | //请求select的数据API |
| | | }) |
| | | ; |
| | | </script> |
| | | </body> |
| | | |
| | | </html> |
New file |
| | |
| | | <!DOCTYPE html> |
| | | <html class="x-admin-sm"> |
| | | |
| | | <head> |
| | | <meta charset="UTF-8"> |
| | | <title>邀请图素材列表</title> |
| | | <meta name="renderer" content="webkit"> |
| | | <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
| | | <meta name="viewport" |
| | | content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi"/> |
| | | <link rel="stylesheet" href="../css/font.css"> |
| | | <link rel="stylesheet" href="../css/xadmin.css"> |
| | | <script src="../lib/layui/layui.js" charset="utf-8"></script> |
| | | <link rel="stylesheet" href="../css/theme3049.min.css"> |
| | | <script src="../js/vue.min.js" type="text/javascript" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../js/xadmin.js"></script> |
| | | <script src="../js/http.js" type="text/javascript" charset="utf-8"></script> |
| | | <script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script> |
| | | <!--[if lt IE 9]> |
| | | <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script> |
| | | <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script> |
| | | <![endif]--> |
| | | <script src="../js/utils.js"></script> |
| | | |
| | | <style> |
| | | tbody .layui-table-cell { |
| | | height: 100px; |
| | | line-height: 100px; |
| | | } |
| | | </style> |
| | | </head> |
| | | |
| | | <body> |
| | | <div class="x-nav"> |
| | | <span class="layui-breadcrumb"> |
| | | <a href="">###</a> |
| | | <a> |
| | | <cite>###</cite></a> |
| | | </span> |
| | | <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" |
| | | onclick="location.reload()" title="刷新"> |
| | | <i class="layui-icon layui-icon-refresh" style="line-height:30px"></i> |
| | | </a> |
| | | </div> |
| | | <div class="layui-fluid" id="app"> |
| | | <div class="layui-row layui-col-space15"> |
| | | <div class="layui-col-md12"> |
| | | <div class="layui-card"> |
| | | <div class="layui-card-body"> |
| | | <form class="layui-form layui-col-space5"> |
| | | <div class="layui-inline layui-show-xs-block"> |
| | | <input type="text" name="kw" lay-verify="" placeholder="内容关键词" autocomplete="off" |
| | | class="layui-input"> |
| | | </div> |
| | | <div class="layui-inline layui-show-xs-block"> |
| | | <button id="search" class="layui-btn" lay-submit="" lay-filter="search"> |
| | | <i class="layui-icon"></i></button> |
| | | </div> |
| | | </form> |
| | | </div> |
| | | <div class="layui-card-body "> |
| | | <table class="layui-table" id="table_list" lay-filter="app" lay-size="lg"> |
| | | </table> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </body> |
| | | <script type="text/html" id="toolbar"> |
| | | <div class="layui-btn-container"> |
| | | <button class="layui-btn" onclick="xadmin.open('添加邀请图素材','spread_img_add.html',500,580)"><i |
| | | class="layui-icon"></i>添加 |
| | | </button> |
| | | <button class="layui-btn layui-btn-danger" lay-event="delete"> |
| | | <i class="layui-icon"></i> |
| | | 删除 |
| | | </button> |
| | | </div> |
| | | </script> |
| | | |
| | | <script type="text/html" id="optContainer"> |
| | | <div class="layui-btn-container"> |
| | | <a title="修改" onclick="xadmin.open('修改邀请图素材','spread_img_update.html?id={{d.id}}',500,580)" href="javascript:;"> |
| | | <i class="layui-icon"></i> |
| | | </a> |
| | | <a title="删除" onclick="member_del(this,{{d.LAY_INDEX }},'{{d.id}}')" href="javascript:;"> |
| | | <i class="layui-icon"></i> |
| | | </a> |
| | | </div> |
| | | </script> |
| | | |
| | | <script type="text/html" id="statusContainer"> |
| | | <div class="layui-btn-container"> |
| | | {{# if(d.status==0){ }} |
| | | <span class="layui-btn layui-btn-mini"> |
| | | 正常 |
| | | </span> |
| | | {{# }else{ }} |
| | | <span class="layui-btn layui-btn-danger layui-btn-mini"> |
| | | 已删除 |
| | | </span> |
| | | {{# } }} |
| | | </div> |
| | | </script> |
| | | |
| | | <script type="text/html" id="switchTpl"> |
| | | <!-- 这里的checked的状态只是演示 --> |
| | | <input type="checkbox" name="sex" value="{{d.id}}" lay-skin="switch" lay-text="女|男" lay-filter="sexDemo" {{ d.id== |
| | | 10003 ? 'checked': ''}} > |
| | | </script> |
| | | |
| | | |
| | | <script type="text/html" id="imgshow"> |
| | | <!-- 这里的checked的状态只是演示 --> |
| | | <img src="{{d.}}"/> |
| | | <input type="checkbox" name="sex" value="{{d.id}}" lay-skin="switch" lay-text="女|男" lay-filter="sexDemo" {{ d.id== |
| | | 10003 ? 'checked': ''}} > |
| | | </script> |
| | | |
| | | <script> |
| | | |
| | | function member_del(obj, index, id) { |
| | | layer.confirm('确认要删除吗?', function (index) { |
| | | //发异步删除数据 |
| | | app.delete(obj, index, id); |
| | | }); |
| | | } |
| | | |
| | | </script> |
| | | |
| | | <script> |
| | | var tableIns = null; |
| | | var app = null; |
| | | $(function () { |
| | | app = new Vue({ |
| | | el: "#app", |
| | | data: { |
| | | key: '', |
| | | start: '', |
| | | end: '', |
| | | appList: [] |
| | | }, |
| | | watch: {}, |
| | | created: function () { |
| | | |
| | | }, |
| | | methods: { |
| | | init: function () { |
| | | //初始化 |
| | | layui.use(['laydate', 'form', 'table'], function () { |
| | | var laydate = layui.laydate, |
| | | form = layui.form, |
| | | table = layui.table; |
| | | //渲染日期输入框 |
| | | //搜索条件 |
| | | form.on('submit(search)', function (data) { |
| | | app.search(data.field); |
| | | return false; |
| | | }); |
| | | |
| | | tableIns = table.render({ |
| | | elem: '#table_list', |
| | | url: "/admin/api/team/spreadimg/list", |
| | | toolbar: "#toolbar", |
| | | totalRow: true, |
| | | cols: [[{type: 'checkbox', title: "ID"}, |
| | | {field: 'id', width: 120, sort: false, title: "ID"}, |
| | | { |
| | | field: 'url', width: 80, sort: false, title: "素材图", templet: function (res) { |
| | | return "<img src='" + res.url + "' style='height:100px;'>"; |
| | | } |
| | | }, |
| | | { |
| | | field: 'show', width: 80, sort: false, title: "是否显示", templet: function (res) { |
| | | if (res.show) { |
| | | return " <input type=\"checkbox\" checked='true' disabled lay-skin=\"switch\""; |
| | | } else { |
| | | return " <input type=\"checkbox\" disabled lay-skin=\"switch\""; |
| | | } |
| | | } |
| | | }, |
| | | {field: 'startTime', width: 150, sort: false, title: "显示开始时间"}, |
| | | {field: 'endTime', width: 150, sort: false, title: "显示结束时间"}, |
| | | {field: 'createTime', width: 150, sort: false, title: "创建时间"}, |
| | | {field: 'updateTime', width: 150, sort: false, title: "修改时间"}, |
| | | {fixed: 'right', width: 80, title: "操作", toolbar: '#optContainer'}]], |
| | | page: true, |
| | | parseData: function (res) { //res 即为原始返回的数据 |
| | | if (res.code != 0) |
| | | return; |
| | | if (res.data.list == null) |
| | | return; |
| | | console.log(res.data.list) |
| | | return { |
| | | "code": res.code, //解析接口状态 |
| | | "msg": res.msg, //解析提示文本 |
| | | "count": res.data.count, //解析数据长度 |
| | | "data": res.data.list //解析数据列表 |
| | | }; |
| | | }, |
| | | error: function (e, msg) { |
| | | ksapp.tableError(e) |
| | | } |
| | | //,…… //其他参数 |
| | | }); |
| | | |
| | | //头工具栏事件 |
| | | table.on('toolbar(app)', |
| | | function (obj) { |
| | | var checkStatus = table.checkStatus(obj.config.id); |
| | | switch (obj.event) { |
| | | case 'delete': |
| | | var data = checkStatus.data; |
| | | if (data == null || data.length == 0) { |
| | | layer.msg("未选择选项"); |
| | | return; |
| | | } |
| | | var ids = new Array(); |
| | | for (var i = 0; i < data.length; i++) |
| | | ids.push(data[i].id); |
| | | layer.confirm('确认要删除吗?', function (index) { |
| | | //发异步删除数据 |
| | | app.deleteList(ids, function () { |
| | | layer.msg("删除成功"); |
| | | $("form").submit(); |
| | | }); |
| | | }); |
| | | |
| | | break; |
| | | } |
| | | ; |
| | | }); |
| | | //请求搜索表单中需要的数据 |
| | | $('#search').trigger("click"); |
| | | }); |
| | | |
| | | }, |
| | | delete: function (obj, index, id) { |
| | | var ids = new Array(); |
| | | ids.push(id); |
| | | app.deleteList(ids, function () { |
| | | $(obj).parents("tr").remove(); |
| | | layer.msg('已删除!', {icon: 1, time: 1000}); |
| | | }); |
| | | }, |
| | | deleteList: function (ids, success) { |
| | | ksapp.post("/admin/api/team/spreadimg/delete", {ids: JSON.stringify(ids)}, function (e) { |
| | | if (e.code == 0) { |
| | | success(); |
| | | } else { |
| | | layer.msg(e.msg); |
| | | } |
| | | }, function (e) { |
| | | }); |
| | | }, |
| | | search: function (params) { |
| | | |
| | | var ps = {}; |
| | | for (var key in params) { |
| | | if (params[key].length > 0) { |
| | | ps[key] = params[key]; |
| | | } |
| | | } |
| | | //数据重载 |
| | | tableIns.reload({ |
| | | where: ps, |
| | | page: { |
| | | curr: 1 //重新从第 1 页开始 |
| | | } |
| | | }); |
| | | }, |
| | | } |
| | | }); |
| | | app.init(); |
| | | }); |
| | | |
| | | </script> |
| | | |
| | | <script> |
| | | |
| | | </script> |
| | | </html> |
New file |
| | |
| | | <!DOCTYPE html> |
| | | <html class="x-admin-sm"> |
| | | |
| | | <head> |
| | | <meta charset="UTF-8"> |
| | | <title>修改邀请图素材</title> |
| | | <meta name="renderer" content="webkit"> |
| | | <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
| | | <meta name="viewport" |
| | | content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi"/> |
| | | <link rel="stylesheet" href="../css/font.css"> |
| | | <link rel="stylesheet" href="../css/xadmin.css"> |
| | | <script type="text/javascript" src="../lib/layui/layui.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../js/xadmin.js"></script> |
| | | <script src="../js/vue.min.js" type="text/javascript" charset="utf-8"></script> |
| | | <script src="../js/http.js" type="text/javascript" charset="utf-8"></script> |
| | | <script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script> |
| | | <!-- 让IE8/9支持媒体查询,从而兼容栅格 --> |
| | | <!--[if lt IE 9]> |
| | | <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script> |
| | | <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script> |
| | | <![endif]--> |
| | | </head> |
| | | <body> |
| | | <div class="layui-fluid"> |
| | | <div class="layui-row"> |
| | | <form class="layui-form" lay-filter="update"> |
| | | |
| | | <div class="layui-form-item"> |
| | | <label for="L_appCode" class="layui-form-label"> |
| | | 是否显示</label> |
| | | <div class="layui-input-block"> |
| | | <input type="checkbox" name="show" lay-skin="switch"> </div> |
| | | |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label for="L_appCode" class="layui-form-label"> |
| | | 显示开始时间</label> |
| | | <div class="layui-input-block"> |
| | | <input type="datetime" name="startTime" lay-verify="datetime" placeholder="" autocomplete="off" |
| | | class="layui-input"> |
| | | </div> |
| | | |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label for="L_appCode" class="layui-form-label"> |
| | | 显示结束时间</label> |
| | | <div class="layui-input-block"> |
| | | <input type="datetime" name="endTime" lay-verify="datetime" placeholder="" autocomplete="off" |
| | | class="layui-input"> |
| | | </div> |
| | | |
| | | </div> |
| | | |
| | | <div class="layui-form-item"> |
| | | <label for="L_remarks" class="layui-form-label"></label> |
| | | <button class="layui-btn" lay-filter="update" lay-submit="">确定修改</button> |
| | | </div> |
| | | </form> |
| | | </div> |
| | | </div> |
| | | <script> |
| | | //初始化上传控件 |
| | | var uploadTool = { |
| | | callback: null, |
| | | chooseImage: {}, |
| | | uploadArray: new Array(), |
| | | init: function (upload) { |
| | | this.uploadArray = new Array(); |
| | | |
| | | }, |
| | | upload: function (result) { |
| | | if (this.uploadArray.length > 0) { |
| | | this.callback = result; |
| | | //同时上传 |
| | | for (var i = 0; i < this.uploadArray.length; i++) { |
| | | this.uploadArray[i].upload(); |
| | | } |
| | | } else { |
| | | result(); |
| | | } |
| | | } |
| | | }; |
| | | |
| | | |
| | | </script> |
| | | |
| | | <script> |
| | | //填充数据 |
| | | function fillData(form) { |
| | | var id = ksapp.getQueryParam("id"); |
| | | if (id) { |
| | | } else { |
| | | layer.msg("id为空"); |
| | | return; |
| | | } |
| | | |
| | | ksapp.post('/admin/api/team/spreadimg/get', {id: id}, function (res) { |
| | | if (res.code == 0) { |
| | | form.val("update",res.data); |
| | | } else { |
| | | layer.msg(res.msg); |
| | | } |
| | | }, function (res) { |
| | | layer.msg("详情获取失败"); |
| | | }); |
| | | } |
| | | </script> |
| | | |
| | | <script> |
| | | layui.use(['form', 'layer', 'jquery', 'upload','laydate'], function () { |
| | | $ = layui.jquery; |
| | | var form = layui.form, |
| | | layer = layui.layer, |
| | | upload = layui.upload, |
| | | laydate= layui.laydate; |
| | | |
| | | var verify = {}; |
| | | //自定义验证规则 |
| | | form.verify(verify); |
| | | |
| | | laydate.render({ |
| | | elem: "input[name=startTime]", //指定元素 |
| | | type: 'datetime' |
| | | }); |
| | | laydate.render({ |
| | | elem: "input[name=endTime]", //指定元素 |
| | | type: 'datetime' |
| | | }); |
| | | |
| | | //渲染上传控件 |
| | | uploadTool.init(upload); |
| | | |
| | | //填充表单数据 |
| | | //请求数据 |
| | | //form.data(); |
| | | |
| | | |
| | | //监听提交 |
| | | form.on('submit(update)', |
| | | function (data) { |
| | | console.log(data.field); |
| | | //转换json对象 |
| | | for (key in data.field) { |
| | | if (key.indexOf(".") > -1) { |
| | | var value = data.field[key]; |
| | | delete data.field[key]; |
| | | var onkeys = key.split("."); |
| | | //创建对象 |
| | | if (data.field[onkeys[0]] == undefined) { |
| | | data.field[onkeys[0]] = {}; |
| | | } |
| | | data.field[onkeys[0]][onkeys[1]] = value; |
| | | } |
| | | } |
| | | uploadTool.upload(function () { |
| | | //发异步,把数据提交给php |
| | | var params = data.field; |
| | | params.id = ksapp.getQueryParam("id"); |
| | | |
| | | ksapp.post('/admin/api/team/spreadimg/update', data.field, function (res) { |
| | | if (res.code == 0) { |
| | | layer.alert("修改成功", { |
| | | icon: 6 |
| | | }, |
| | | function () { |
| | | //关闭当前frame |
| | | xadmin.close(); |
| | | // 可以对父窗口进行刷新 |
| | | // xadmin.father_reload(); |
| | | }); |
| | | } else { |
| | | layer.msg(res.msg); |
| | | } |
| | | |
| | | }, function (res) { |
| | | }); |
| | | }); |
| | | return false; |
| | | }); |
| | | //请求select的数据API |
| | | |
| | | fillData(form) |
| | | }) |
| | | ; |
| | | </script> |
| | | </body> |
| | | |
| | | </html> |
New file |
| | |
| | | <!DOCTYPE html> |
| | | <html class="x-admin-sm"> |
| | | |
| | | <head> |
| | | <meta charset="UTF-8"> |
| | | <title>用户邀请图列表</title> |
| | | <meta name="renderer" content="webkit"> |
| | | <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
| | | <meta name="viewport" |
| | | content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi"/> |
| | | <link rel="stylesheet" href="../css/font.css"> |
| | | <link rel="stylesheet" href="../css/xadmin.css"> |
| | | <script src="../lib/layui/layui.js" charset="utf-8"></script> |
| | | <link rel="stylesheet" href="../css/theme3049.min.css"> |
| | | <script src="../js/vue.min.js" type="text/javascript" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../js/xadmin.js"></script> |
| | | <script src="../js/http.js" type="text/javascript" charset="utf-8"></script> |
| | | <script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script> |
| | | <!--[if lt IE 9]> |
| | | <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script> |
| | | <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script> |
| | | <![endif]--> |
| | | <script src="../js/utils.js"></script> |
| | | </head> |
| | | |
| | | <body> |
| | | <div class="x-nav"> |
| | | <span class="layui-breadcrumb"> |
| | | <a href="">###</a> |
| | | <a> |
| | | <cite>###</cite></a> |
| | | </span> |
| | | <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" |
| | | onclick="location.reload()" title="刷新"> |
| | | <i class="layui-icon layui-icon-refresh" style="line-height:30px"></i> |
| | | </a> |
| | | </div> |
| | | <div class="layui-fluid" id="app"> |
| | | <div class="layui-row layui-col-space15"> |
| | | <div class="layui-col-md12"> |
| | | <div class="layui-card"> |
| | | <div class="layui-card-body"> |
| | | <form class="layui-form layui-col-space5"> |
| | | <div class="layui-inline layui-show-xs-block"> |
| | | <input type="text" name="uid" lay-verify="" placeholder="用户ID" autocomplete="off" |
| | | class="layui-input"> |
| | | </div> |
| | | <div class="layui-inline layui-show-xs-block"> |
| | | <button id="search" class="layui-btn" lay-submit="" lay-filter="search"> |
| | | <i class="layui-icon"></i></button> |
| | | </div> |
| | | </form> |
| | | </div> |
| | | <div class="layui-card-body "> |
| | | <table class="layui-table" id="table_list" lay-filter="app"> |
| | | </table> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </body> |
| | | <script type="text/html" id="toolbar"> |
| | | <div class="layui-btn-container"> |
| | | <button class="layui-btn layui-btn-danger" lay-event="delete"> |
| | | <i class="layui-icon"></i> |
| | | 删除 |
| | | </button> |
| | | </div> |
| | | </script> |
| | | |
| | | <script type="text/html" id="optContainer"> |
| | | <div class="layui-btn-container"> |
| | | <a title="删除" onclick="member_del(this,{{d.LAY_INDEX }},'{{d.id}}')" href="javascript:;"> |
| | | <i class="layui-icon"></i> |
| | | </a> |
| | | </div> |
| | | </script> |
| | | |
| | | <script type="text/html" id="statusContainer"> |
| | | <div class="layui-btn-container"> |
| | | {{# if(d.status==0){ }} |
| | | <span class="layui-btn layui-btn-mini"> |
| | | 正常 |
| | | </span> |
| | | {{# }else{ }} |
| | | <span class="layui-btn layui-btn-danger layui-btn-mini"> |
| | | 已删除 |
| | | </span> |
| | | {{# } }} |
| | | </div> |
| | | </script> |
| | | |
| | | <script type="text/html" id="switchTpl"> |
| | | <!-- 这里的checked的状态只是演示 --> |
| | | <input type="checkbox" name="sex" value="{{d.id}}" lay-skin="switch" lay-text="女|男" lay-filter="sexDemo" {{ d.id== |
| | | 10003 ? 'checked': ''}} > |
| | | </script> |
| | | |
| | | |
| | | <script type="text/html" id="imgshow"> |
| | | <!-- 这里的checked的状态只是演示 --> |
| | | <img src="{{d.}}"/> |
| | | <input type="checkbox" name="sex" value="{{d.id}}" lay-skin="switch" lay-text="女|男" lay-filter="sexDemo" {{ d.id== |
| | | 10003 ? 'checked': ''}} > |
| | | </script> |
| | | |
| | | <script> |
| | | |
| | | function member_del(obj, index, id) { |
| | | layer.confirm('确认要删除吗?', function (index) { |
| | | //发异步删除数据 |
| | | app.delete(obj, index, id); |
| | | }); |
| | | } |
| | | |
| | | </script> |
| | | |
| | | <script> |
| | | var tableIns = null; |
| | | var app=null; |
| | | $(function () { |
| | | app = new Vue({ |
| | | el: "#app", |
| | | data: { |
| | | key: '', |
| | | start: '', |
| | | end: '', |
| | | appList: [] |
| | | }, |
| | | watch: {}, |
| | | created: function () { |
| | | |
| | | }, |
| | | methods: { |
| | | init: function () { |
| | | //初始化 |
| | | layui.use(['laydate', 'form', 'table'], function () { |
| | | var laydate = layui.laydate, |
| | | form = layui.form, |
| | | table = layui.table; |
| | | //渲染日期输入框 |
| | | //搜索条件 |
| | | form.on('submit(search)', function (data) { |
| | | app.search(data.field); |
| | | return false; |
| | | }); |
| | | |
| | | tableIns = table.render({ |
| | | elem: '#table_list', |
| | | url: "/admin/api/team/userspreadimg/list", |
| | | toolbar: "#toolbar", |
| | | totalRow: true, |
| | | cols: [[{type: 'checkbox', title: "ID"}, |
| | | {field: 'id', width: 120, sort: false, title: "ID"}, |
| | | {field: 'uid', width: 120, sort: false, title: "用户ID"}, |
| | | {field: 'url', width: 120, sort: false, title: "邀请图",templet:function(res){ |
| | | return "<img src='"+res.url+"' style='height:50px;'>"; |
| | | } |
| | | }, |
| | | {field: 'sourceMD5', width: 120, sort: false, title: "原图MD5"}, |
| | | {field: 'createTime', width: 150, sort: false, title: "创建时间"}, |
| | | {field: 'updateTime', width: 150, sort: false, title: "修改时间"}, |
| | | {fixed: 'right', width: 80, title: "操作", toolbar: '#optContainer'}]], |
| | | page: true, |
| | | parseData: function (res) { //res 即为原始返回的数据 |
| | | if (res.code != 0) |
| | | return; |
| | | if (res.data.list == null) |
| | | return; |
| | | console.log(res.data.list) |
| | | return { |
| | | "code": res.code, //解析接口状态 |
| | | "msg": res.msg, //解析提示文本 |
| | | "count": res.data.count, //解析数据长度 |
| | | "data": res.data.list //解析数据列表 |
| | | }; |
| | | }, |
| | | error: function (e, msg) { |
| | | ksapp.tableError(e) |
| | | } |
| | | //,…… //其他参数 |
| | | }); |
| | | |
| | | //头工具栏事件 |
| | | table.on('toolbar(app)', |
| | | function (obj) { |
| | | var checkStatus = table.checkStatus(obj.config.id); |
| | | switch (obj.event) { |
| | | case 'delete': |
| | | var data = checkStatus.data; |
| | | if (data == null || data.length == 0) { |
| | | layer.msg("未选择选项"); |
| | | return; |
| | | } |
| | | var ids = new Array(); |
| | | for (var i = 0; i < data.length; i++) |
| | | ids.push(data[i].id); |
| | | layer.confirm('确认要删除吗?', function (index) { |
| | | //发异步删除数据 |
| | | app.deleteList(ids, function () { |
| | | layer.msg("删除成功"); |
| | | $("form").submit(); |
| | | }); |
| | | }); |
| | | |
| | | break; |
| | | }; |
| | | }); |
| | | //请求搜索表单中需要的数据 |
| | | $('#search').trigger("click"); |
| | | }); |
| | | |
| | | }, |
| | | delete: function (obj, index, id) { |
| | | var ids = new Array(); |
| | | ids.push(id); |
| | | app.deleteList(ids, function () { |
| | | $(obj).parents("tr").remove(); |
| | | layer.msg('已删除!', {icon: 1, time: 1000}); |
| | | }); |
| | | }, |
| | | deleteList: function (ids, success) { |
| | | ksapp.post("/admin/api/team/userspreadimg/delete", {ids: JSON.stringify(ids)}, function (e) { |
| | | if (e.code == 0) { |
| | | success(); |
| | | } else { |
| | | layer.msg(e.msg); |
| | | } |
| | | }, function (e) { |
| | | }); |
| | | }, |
| | | search: function (params) { |
| | | |
| | | var ps = {}; |
| | | for (var key in params) { |
| | | if (params[key].length > 0) { |
| | | ps[key] = params[key]; |
| | | } |
| | | } |
| | | //数据重载 |
| | | tableIns.reload({ |
| | | where: ps, |
| | | page: { |
| | | curr: 1 //重新从第 1 页开始 |
| | | } |
| | | }); |
| | | }, |
| | | } |
| | | }); |
| | | app.init(); |
| | | }); |
| | | |
| | | </script> |
| | | |
| | | <script> |
| | | |
| | | </script> |
| | | </html> |
| | |
| | | @Test |
| | | public void makeGoldCorn() { |
| | | try { |
| | | goldCornMakeService.addGoldCorn(22380L, GoldCornGetType.watchVideo, new Date()); |
| | | goldCornMakeService.addGoldCorn(22380L, GoldCornGetType.watchVideo,false,new Date()); |
| | | // goldCornMakeService.addGoldCorn(22380L,GoldCornGetType.readNovel,new Date()); |
| | | } catch (UserInfoException e) { |
| | | e.printStackTrace(); |
| | |
| | | <dependency> |
| | | <groupId>com.yeshi</groupId> |
| | | <artifactId>utils</artifactId> |
| | | <version>0.3.2</version> |
| | | <version>0.3.5</version> |
| | | <exclusions> |
| | | <exclusion> |
| | | <groupId>org.springframework.data</groupId> |
| | |
| | | </exclusions> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>commons-fileupload</groupId> |
| | | <artifactId>commons-fileupload</artifactId> |
| | | <version>1.3.1</version> |
| | | </dependency> |
| | | |
| | | </dependencies> |
| | | |
| | | |