| | |
| | | Object[] args = joinPoint.getArgs(); |
| | | ServletRequestAttributes servletContainer = (ServletRequestAttributes) RequestContextHolder |
| | | .getRequestAttributes(); |
| | | servletContainer.getResponse().setCharacterEncoding("UTF-8"); |
| | | |
| | | AcceptAdminData acceptAdminData = null; |
| | | for (Object obj : args) { |
| | |
| | | |
| | | if (acceptAdminData != null) { |
| | | acceptAdminData.setSystem(SystemInfoUtil.getAdminSelectedSystem(servletContainer.getRequest().getSession())); |
| | | if(acceptAdminData.getSystem()==null){ |
| | | PrintWriter out = servletContainer.getResponse().getWriter(); |
| | | out.print(JsonUtil.loadFalseResult(ApiCodeConstant.CODE_ERROR_IN_SERVER, "未选择系统")); |
| | | out.close(); |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | try { |
| | | return joinPoint.proceed(args); |
| | | } catch (Throwable e) { |
| | | e.printStackTrace(); |
| | | PrintWriter out = servletContainer.getResponse().getWriter(); |
| | | out.print(JsonUtil.loadFalseResult(ApiCodeConstant.CODE_ERROR_IN_SERVER, "服务器内部错误")); |
| | | out.close(); |
| | |
| | | import com.google.gson.*; |
| | | import com.yeshi.makemoney.app.entity.config.SystemConfig; |
| | | import com.yeshi.makemoney.app.entity.config.SystemConfigKey; |
| | | import com.yeshi.makemoney.app.entity.config.SystemConfigType; |
| | | import com.yeshi.makemoney.app.service.inter.config.SystemConfigService; |
| | | import com.yeshi.makemoney.app.service.query.config.SystemConfigQuery; |
| | | import com.yeshi.makemoney.app.vo.AcceptAdminData; |
| | |
| | | @ResponseBody |
| | | @RequestMapping("list") |
| | | public String list(SystemConfigQuery query, int page, int limit, String callback) { |
| | | List<SystemConfig> list = systemConfigService.list(query, page, limit); |
| | | long count = systemConfigService.count(query); |
| | | List<SystemConfig> list = systemConfigService.listByType(SystemConfigType.common); |
| | | long count = list.size(); |
| | | JSONObject data = new JSONObject(); |
| | | Gson gson = new GsonBuilder().registerTypeAdapter(Date.class, new JsonSerializer<Date>() { |
| | | |
| | |
| | | public String getKeyList() { |
| | | JSONArray array = new JSONArray(); |
| | | for (SystemConfigKey key : SystemConfigKey.values()) { |
| | | JSONObject data = new JSONObject(); |
| | | data.put("key", key.name()); |
| | | data.put("value", key.getDesc()); |
| | | array.add(data); |
| | | if (key.getType() == SystemConfigType.common) { |
| | | JSONObject data = new JSONObject(); |
| | | data.put("key", key.name()); |
| | | data.put("value", key.getDesc()); |
| | | array.add(data); |
| | | } |
| | | } |
| | | return JsonUtil.loadTrueResult(array); |
| | | } |
| | |
| | | package com.yeshi.makemoney.app.controller.admin.goldcorn; |
| | | |
| | | import com.google.gson.*; |
| | | import com.yeshi.makemoney.app.entity.goldcorn.GoldCornConsumeType; |
| | | import net.sf.json.JSONArray; |
| | | import net.sf.json.JSONObject; |
| | | import org.springframework.stereotype.Controller; |
| | |
| | | import java.lang.reflect.Type; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | import com.yeshi.makemoney.app.entity.goldcorn.GoldCornConsumeRecord; |
| | | import com.yeshi.makemoney.app.service.inter.goldcorn.GoldCornConsumeRecordService; |
| | | import com.yeshi.makemoney.app.service.query.goldcorn.GoldCornConsumeRecordQuery; |
| | | |
| | | @Controller |
| | | @RequestMapping("admin/api/goldcorn/consume/record") |
| | | public class GoldCornConsumeRecordAdminController { |
| | |
| | | private GoldCornConsumeRecordService goldCornConsumeRecordService; |
| | | |
| | | |
| | | @ResponseBody |
| | | @ResponseBody |
| | | @RequestMapping("list") |
| | | public String list(GoldCornConsumeRecordQuery query, int page, int limit ) { |
| | | List<GoldCornConsumeRecord> list = goldCornConsumeRecordService.list(query,page,limit); |
| | | public String list(GoldCornConsumeRecordQuery query, int page, int limit) { |
| | | List<GoldCornConsumeRecord> list = goldCornConsumeRecordService.list(query, page, limit); |
| | | long count = goldCornConsumeRecordService.count(query); |
| | | JSONObject data = new JSONObject(); |
| | | Gson gson = new GsonBuilder().registerTypeAdapter(Date.class, new JsonSerializer<Date>() { |
| | |
| | | @ResponseBody |
| | | @RequestMapping("delete") |
| | | public String delete(String ids) { |
| | | Type type = new TypeToken<List<String>>(){}.getType(); |
| | | List<String> idList=new Gson().fromJson(ids,type); |
| | | Type type = new TypeToken<List<String>>() { |
| | | }.getType(); |
| | | List<String> idList = new Gson().fromJson(ids, type); |
| | | goldCornConsumeRecordService.delete(idList); |
| | | return JsonUtil.loadTrueResult(""); |
| | | |
| | |
| | | @RequestMapping("get") |
| | | public String get(String id, HttpSession session) { |
| | | GoldCornConsumeRecord entity = goldCornConsumeRecordService.get(id); |
| | | if (entity !=null){ |
| | | if (entity != null) { |
| | | return JsonUtil.loadTrueResult(entity); |
| | | |
| | | } else { |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @RequestMapping("getTypeList") |
| | | public String getTypeList(String id, HttpSession session) { |
| | | JSONArray array = new JSONArray(); |
| | | for (GoldCornConsumeType type : GoldCornConsumeType.values()) { |
| | | JSONObject data = new JSONObject(); |
| | | data.put("key", type.name()); |
| | | data.put("value", type.getName()); |
| | | array.add(data); |
| | | } |
| | | return JsonUtil.loadTrueResult(array); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | package com.yeshi.makemoney.app.controller.admin.goldcorn; |
| | | |
| | | import com.google.gson.*; |
| | | import com.yeshi.makemoney.app.aop.AdminApiFilter; |
| | | import com.yeshi.makemoney.app.entity.goldcorn.GoldCornGetType; |
| | | import com.yeshi.makemoney.app.vo.AcceptAdminData; |
| | | import com.yeshi.makemoney.app.vo.admin.goldcorn.GoldCornGetFrequencyAdminVO; |
| | | import net.sf.json.JSONArray; |
| | | import net.sf.json.JSONObject; |
| | | import org.springframework.stereotype.Controller; |
| | |
| | | import java.lang.reflect.Type; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | import com.yeshi.makemoney.app.entity.goldcorn.GoldCornGetFrequencyConfig; |
| | | import com.yeshi.makemoney.app.service.inter.goldcorn.GoldCornGetFrequencyConfigService; |
| | | import com.yeshi.makemoney.app.service.query.goldcorn.GoldCornGetFrequencyConfigQuery; |
| | | |
| | | @Controller |
| | | @RequestMapping("admin/api/goldcorn/get/config") |
| | | @RequestMapping("admin/api/goldcorn/getfrequency") |
| | | public class GoldCornGetFrequencyConfigAdminController { |
| | | |
| | | @Resource |
| | | private GoldCornGetFrequencyConfigService goldCornGetFrequencyConfigService; |
| | | |
| | | |
| | | @ResponseBody |
| | | @ResponseBody |
| | | @RequestMapping("list") |
| | | public String list(GoldCornGetFrequencyConfigQuery query, int page, int limit ) { |
| | | List<GoldCornGetFrequencyConfig> list = goldCornGetFrequencyConfigService.list(query,page,limit); |
| | | public String list(GoldCornGetFrequencyConfigQuery query, int page, int limit) { |
| | | List<GoldCornGetFrequencyConfig> list = goldCornGetFrequencyConfigService.list(query, page, limit); |
| | | long count = goldCornGetFrequencyConfigService.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")); |
| | | } |
| | | }).registerTypeAdapter(GoldCornGetType.class, new JsonSerializer<GoldCornGetType>() { |
| | | |
| | | @Override |
| | | public JsonElement serialize(GoldCornGetType date, Type type, JsonSerializationContext jsonSerializationContext) { |
| | | return date == null ? new JsonPrimitive("") : new JsonPrimitive(date.getName()); |
| | | } |
| | | }).registerTypeAdapter(GoldCornGetFrequencyConfig.GoldCornGetFrequencyTimeUnit.class, new JsonSerializer<GoldCornGetFrequencyConfig.GoldCornGetFrequencyTimeUnit>() { |
| | | |
| | | @Override |
| | | public JsonElement serialize(GoldCornGetFrequencyConfig.GoldCornGetFrequencyTimeUnit date, Type type, JsonSerializationContext jsonSerializationContext) { |
| | | return date == null ? new JsonPrimitive("") : new JsonPrimitive(date.getName()); |
| | | } |
| | | }).create(); |
| | | |
| | |
| | | @ResponseBody |
| | | @RequestMapping("delete") |
| | | public String delete(String ids) { |
| | | Type type = new TypeToken<List<String>>(){}.getType(); |
| | | List<String> idList=new Gson().fromJson(ids,type); |
| | | Type type = new TypeToken<List<String>>() { |
| | | }.getType(); |
| | | List<String> idList = new Gson().fromJson(ids, type); |
| | | goldCornGetFrequencyConfigService.delete(idList); |
| | | return JsonUtil.loadTrueResult(""); |
| | | |
| | | } |
| | | |
| | | @ResponseBody |
| | | @RequestMapping("add") |
| | | public String add(GoldCornGetFrequencyConfig bean, HttpSession session) { |
| | | try{ |
| | | goldCornGetFrequencyConfigService.add(bean); |
| | | public String add(GoldCornGetFrequencyAdminVO vo, AcceptAdminData acceptAdminData) { |
| | | try { |
| | | goldCornGetFrequencyConfigService.add(vo.toEntity(acceptAdminData.getSystem())); |
| | | return JsonUtil.loadTrueResult(""); |
| | | |
| | | }catch(Exception e){ |
| | | } catch (Exception e) { |
| | | return JsonUtil.loadFalseResult(e.getMessage()); |
| | | |
| | | } |
| | |
| | | @RequestMapping("get") |
| | | public String get(String id, HttpSession session) { |
| | | GoldCornGetFrequencyConfig entity = goldCornGetFrequencyConfigService.get(id); |
| | | if (entity !=null){ |
| | | return JsonUtil.loadTrueResult(entity); |
| | | if (entity != null) { |
| | | return JsonUtil.loadTrueResult(GoldCornGetFrequencyAdminVO.create(entity)); |
| | | |
| | | } else { |
| | | return JsonUtil.loadFalseResult("ID不存在"); |
| | |
| | | |
| | | @ResponseBody |
| | | @RequestMapping("update") |
| | | public String update(GoldCornGetFrequencyConfig bean, HttpSession session) { |
| | | if (bean.getId() == null) { |
| | | return JsonUtil.loadFalseResult("ID不能为空"); |
| | | public String update(GoldCornGetFrequencyAdminVO vo, HttpSession session) { |
| | | if (vo.getId() == null) { |
| | | return JsonUtil.loadFalseResult("ID不能为空"); |
| | | |
| | | } |
| | | try{ |
| | | goldCornGetFrequencyConfigService.update(bean); |
| | | }catch(Exception e){ |
| | | try { |
| | | goldCornGetFrequencyConfigService.update(vo.toEntity(null)); |
| | | } catch (Exception e) { |
| | | return JsonUtil.loadFalseResult(e.getMessage()); |
| | | |
| | | } |
| | |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @RequestMapping("getTimeUnits") |
| | | public String getTimeUnits() { |
| | | JSONArray array = new JSONArray(); |
| | | for (GoldCornGetFrequencyConfig.GoldCornGetFrequencyTimeUnit unit : GoldCornGetFrequencyConfig.GoldCornGetFrequencyTimeUnit.values()) { |
| | | JSONObject data = new JSONObject(); |
| | | data.put("key", unit.name()); |
| | | data.put("value", unit.getName()); |
| | | array.add(data); |
| | | } |
| | | return JsonUtil.loadTrueResult(array); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | @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")); |
| | | return date == null ? new JsonPrimitive("") : new JsonPrimitive(TimeUtil.getGernalTime(date.getTime(), "yyyy.MM.dd HH:mm:ss")); |
| | | } |
| | | }).registerTypeAdapter(GoldCornGetType.class, new JsonSerializer<GoldCornGetType>() { |
| | | |
| | |
| | | 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); |
| | | goldCornGetRecordService.delete(idList); |
| | | return JsonUtil.loadTrueResult(""); |
| | | |
| | | } |
| | | |
| | |
| | | package com.yeshi.makemoney.app.controller.admin.money; |
| | | |
| | | import com.google.gson.*; |
| | | import com.yeshi.makemoney.app.entity.money.ExtractPayType; |
| | | import net.sf.json.JSONArray; |
| | | import net.sf.json.JSONObject; |
| | | import org.springframework.stereotype.Controller; |
| | |
| | | import java.lang.reflect.Type; |
| | | import java.util.Date; |
| | | 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; |
| | | |
| | | @Controller |
| | | @RequestMapping("admin/api/money/extract") |
| | | public class ExtractAdminController { |
| | |
| | | private ExtractService extractService; |
| | | |
| | | |
| | | @ResponseBody |
| | | @ResponseBody |
| | | @RequestMapping("list") |
| | | public String list(ExtractQuery query, int page, int limit, String callback ) { |
| | | List<Extract> list = extractService.list(query,page,limit); |
| | | public String list(ExtractQuery query, int page, int limit, String callback) { |
| | | List<Extract> list = extractService.list(query, page, limit); |
| | | long count = extractService.count(query); |
| | | JSONObject data = new JSONObject(); |
| | | Gson gson = new GsonBuilder().registerTypeAdapter(Date.class, new JsonSerializer<Date>() { |
| | |
| | | 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")); |
| | | } |
| | | }).registerTypeAdapter(ExtractPayType.class, new JsonSerializer<ExtractPayType>() { |
| | | |
| | | @Override |
| | | public JsonElement serialize(ExtractPayType date, Type type, JsonSerializationContext jsonSerializationContext) { |
| | | return date == null ? new JsonPrimitive("") : new JsonPrimitive(date.getName()); |
| | | } |
| | | }).create(); |
| | | |
| | | data.put("list", gson.toJson(list)); |
| | | data.put("count", count); |
| | | return JsonUtil.loadJSONP(callback,JsonUtil.loadTrueResult(data)); |
| | | return JsonUtil.loadJSONP(callback, JsonUtil.loadTrueResult(data)); |
| | | |
| | | } |
| | | |
| | |
| | | @RequestMapping("get") |
| | | public String get(Long id, HttpSession session, String callback) { |
| | | Extract entity = extractService.get(id); |
| | | if (entity !=null){ |
| | | return JsonUtil.loadJSONP(callback,JsonUtil.loadTrueResult(entity)); |
| | | if (entity != null) { |
| | | return JsonUtil.loadJSONP(callback, JsonUtil.loadTrueResult(entity)); |
| | | |
| | | } else { |
| | | return JsonUtil.loadJSONP(callback,JsonUtil.loadFalseResult("ID不存在")); |
| | | return JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult("ID不存在")); |
| | | |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | package com.yeshi.makemoney.app.controller.admin.money; |
| | | |
| | | import com.google.gson.*; |
| | | import com.yeshi.makemoney.app.entity.money.UserMoneyType; |
| | | import net.sf.json.JSONArray; |
| | | import net.sf.json.JSONObject; |
| | | import org.springframework.stereotype.Controller; |
| | |
| | | import java.lang.reflect.Type; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | import com.yeshi.makemoney.app.entity.money.UserMoneyRecord; |
| | | import com.yeshi.makemoney.app.service.inter.money.UserMoneyRecordService; |
| | | import com.yeshi.makemoney.app.service.query.money.UserMoneyRecordQuery; |
| | | |
| | | @Controller |
| | | @RequestMapping("admin/api/money/record") |
| | | public class UserMoneyRecordAdminController { |
| | |
| | | private UserMoneyRecordService userMoneyRecordService; |
| | | |
| | | |
| | | @ResponseBody |
| | | @ResponseBody |
| | | @RequestMapping("list") |
| | | public String list(UserMoneyRecordQuery query, int page, int limit, String callback ) { |
| | | List<UserMoneyRecord> list = userMoneyRecordService.list(query,page,limit); |
| | | public String list(UserMoneyRecordQuery query, int page, int limit, String callback) { |
| | | List<UserMoneyRecord> list = userMoneyRecordService.list(query, page, limit); |
| | | long count = userMoneyRecordService.count(query); |
| | | JSONObject data = new JSONObject(); |
| | | Gson gson = new GsonBuilder().registerTypeAdapter(Date.class, new JsonSerializer<Date>() { |
| | |
| | | |
| | | data.put("list", gson.toJson(list)); |
| | | data.put("count", count); |
| | | return JsonUtil.loadJSONP(callback,JsonUtil.loadTrueResult(data)); |
| | | return JsonUtil.loadJSONP(callback, JsonUtil.loadTrueResult(data)); |
| | | |
| | | } |
| | | |
| | | @ResponseBody |
| | | @RequestMapping("delete") |
| | | public String delete(String ids, String callback) { |
| | | Type type = new TypeToken<List<Long>>(){}.getType(); |
| | | List<Long> idList=new Gson().fromJson(ids,type); |
| | | Type type = new TypeToken<List<Long>>() { |
| | | }.getType(); |
| | | List<Long> idList = new Gson().fromJson(ids, type); |
| | | userMoneyRecordService.delete(idList); |
| | | return JsonUtil.loadJSONP(callback,JsonUtil.loadTrueResult("")); |
| | | return JsonUtil.loadJSONP(callback, JsonUtil.loadTrueResult("")); |
| | | |
| | | } |
| | | |
| | |
| | | @RequestMapping("get") |
| | | public String get(Long id, HttpSession session, String callback) { |
| | | UserMoneyRecord entity = userMoneyRecordService.get(id); |
| | | if (entity !=null){ |
| | | return JsonUtil.loadJSONP(callback,JsonUtil.loadTrueResult(entity)); |
| | | if (entity != null) { |
| | | return JsonUtil.loadJSONP(callback, JsonUtil.loadTrueResult(entity)); |
| | | |
| | | } else { |
| | | return JsonUtil.loadJSONP(callback,JsonUtil.loadFalseResult("ID不存在")); |
| | | return JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult("ID不存在")); |
| | | |
| | | } |
| | | } |
| | | |
| | | @ResponseBody |
| | | @RequestMapping("getMoneyTypes") |
| | | public String getMoneyTypes() { |
| | | |
| | | JSONArray array = new JSONArray(); |
| | | for (UserMoneyType type : UserMoneyType.values()) { |
| | | JSONObject data = new JSONObject(); |
| | | data.put("key", type.name()); |
| | | data.put("value", type.getName()); |
| | | array.add(data); |
| | | } |
| | | return JsonUtil.loadTrueResult(array); |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.yeshi.makemoney.app.controller.admin.msg; |
| | | |
| | | import com.google.gson.*; |
| | | import com.yeshi.makemoney.app.entity.msg.UserMsgType; |
| | | import com.yeshi.makemoney.app.vo.AcceptAdminData; |
| | | import com.yeshi.makemoney.app.vo.admin.msg.AppPageNotifyAdminVO; |
| | | 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.msg.AppPageNotifyMsg; |
| | | import com.yeshi.makemoney.app.service.inter.msg.AppPageNotifyMsgService; |
| | | import com.yeshi.makemoney.app.service.query.msg.AppPageNotifyMsgQuery; |
| | | |
| | | @Controller |
| | | @RequestMapping("/admin/api/msg/appnotify") |
| | | public class AppPageNotifyMsgAdminController { |
| | | |
| | | @Resource |
| | | private AppPageNotifyMsgService appPageNotifyMsgService; |
| | | |
| | | |
| | | @ResponseBody |
| | | @RequestMapping("list") |
| | | public String list(AppPageNotifyMsgQuery query, int page, int limit) { |
| | | List<AppPageNotifyMsg> list = appPageNotifyMsgService.list(query, page, limit); |
| | | long count = appPageNotifyMsgService.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")); |
| | | } |
| | | }).registerTypeAdapter(AppPageNotifyMsg.AppPageNotifyMsgType.class, new JsonSerializer<AppPageNotifyMsg.AppPageNotifyMsgType>() { |
| | | |
| | | @Override |
| | | public JsonElement serialize(AppPageNotifyMsg.AppPageNotifyMsgType date, Type type, JsonSerializationContext jsonSerializationContext) { |
| | | return date == null ? new JsonPrimitive("") : new JsonPrimitive(date.getName()); |
| | | } |
| | | }).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); |
| | | appPageNotifyMsgService.delete(idList); |
| | | return JsonUtil.loadTrueResult(""); |
| | | |
| | | } |
| | | |
| | | @ResponseBody |
| | | @RequestMapping("add") |
| | | public String add(AppPageNotifyAdminVO bean, AcceptAdminData acceptAdminData) { |
| | | try { |
| | | appPageNotifyMsgService.add(bean.toEntity(acceptAdminData.getSystem())); |
| | | return JsonUtil.loadTrueResult(""); |
| | | } catch (Exception e) { |
| | | return JsonUtil.loadFalseResult(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | @ResponseBody |
| | | @RequestMapping("get") |
| | | public String get(String id, HttpSession session) { |
| | | AppPageNotifyMsg entity = appPageNotifyMsgService.get(id); |
| | | if (entity != null) { |
| | | return JsonUtil.loadTrueResult(AppPageNotifyAdminVO.create(entity)); |
| | | } else { |
| | | return JsonUtil.loadFalseResult("ID不存在"); |
| | | } |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @RequestMapping("update") |
| | | public String update(AppPageNotifyAdminVO bean, HttpSession session) { |
| | | if (bean.getId() == null) { |
| | | return JsonUtil.loadFalseResult("ID不能为空"); |
| | | } |
| | | try { |
| | | AppPageNotifyMsg entity = bean.toEntity(null); |
| | | entity.setMd5(entity.toMD5()); |
| | | appPageNotifyMsgService.update(entity); |
| | | } catch (Exception e) { |
| | | return JsonUtil.loadFalseResult(e.getMessage()); |
| | | } |
| | | return JsonUtil.loadTrueResult(""); |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @RequestMapping("getMsgTypes") |
| | | public String getMsgTypes() { |
| | | JSONArray array = new JSONArray(); |
| | | for (AppPageNotifyMsg.AppPageNotifyMsgType type : AppPageNotifyMsg.AppPageNotifyMsgType.values()) { |
| | | JSONObject data = new JSONObject(); |
| | | data.put("key", type.name()); |
| | | data.put("value", type.getName()); |
| | | array.add(data); |
| | | } |
| | | return JsonUtil.loadTrueResult(array); |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.yeshi.makemoney.app.controller.admin.msg; |
| | | |
| | | import com.google.gson.*; |
| | | import com.yeshi.makemoney.app.entity.msg.UserMsgType; |
| | | 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.msg.UserMsg; |
| | | import com.yeshi.makemoney.app.service.inter.msg.UserMsgService; |
| | | import com.yeshi.makemoney.app.service.query.msg.UserMsgQuery; |
| | | |
| | | @Controller |
| | | @RequestMapping("admin/api/msg/usermsg") |
| | | public class UserMsgAdminController { |
| | | |
| | | @Resource |
| | | private UserMsgService userMsgService; |
| | | |
| | | |
| | | @ResponseBody |
| | | @RequestMapping("list") |
| | | public String list(UserMsgQuery query, int page, int limit) { |
| | | List<UserMsg> list = userMsgService.list(query, page, limit); |
| | | long count = userMsgService.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("getMsgTypes") |
| | | public String getMsgTypes() { |
| | | JSONArray array = new JSONArray(); |
| | | for (UserMsgType type : UserMsgType.values()) { |
| | | JSONObject data = new JSONObject(); |
| | | data.put("key", type.name()); |
| | | data.put("value", type.getName()); |
| | | array.add(data); |
| | | } |
| | | return JsonUtil.loadTrueResult(array); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | |
| | | @Repository |
| | | public class GoldCornGetFrequencyConfigDao extends MongodbBaseDao<GoldCornGetFrequencyConfig>{ |
| | | public class GoldCornGetFrequencyConfigDao extends MongodbBaseDao<GoldCornGetFrequencyConfig> { |
| | | |
| | | public void updateSelective(GoldCornGetFrequencyConfig bean) { |
| | | public void updateSelective(GoldCornGetFrequencyConfig bean) { |
| | | Query query = new Query(); |
| | | Update update=new Update(); |
| | | Update update = new Update(); |
| | | query.addCriteria(Criteria.where("id").is(bean.getId())); |
| | | if(bean.getSystem() != null) { |
| | | if (bean.getSystem() != null) { |
| | | update.set("system", bean.getSystem()); |
| | | } |
| | | if(bean.getType() != null) { |
| | | if (bean.getType() != null) { |
| | | update.set("type", bean.getType()); |
| | | } |
| | | if(bean.getLimitCount() != null) { |
| | | if (bean.getLimitCount() != null) { |
| | | update.set("limitCount", bean.getLimitCount()); |
| | | } |
| | | if(bean.getTimeUnit() != null) { |
| | | if (bean.getTimeUnit() != null) { |
| | | update.set("timeUnit", bean.getTimeUnit()); |
| | | } |
| | | if(bean.getValidateTime() != null) { |
| | | if (bean.getValidateTime() != null) { |
| | | update.set("validateTime", bean.getValidateTime()); |
| | | } |
| | | if(bean.getRemarks() != null) { |
| | | |
| | | if (bean.getMinSpaceTime() != null) { |
| | | update.set("minSpaceTime", bean.getMinSpaceTime()); |
| | | } |
| | | |
| | | if (bean.getRemarks() != null) { |
| | | update.set("remarks", bean.getRemarks()); |
| | | } |
| | | if(bean.getCreateTime() != null) { |
| | | if (bean.getCreateTime() != null) { |
| | | update.set("createTime", bean.getCreateTime()); |
| | | } |
| | | update.set("updateTime", new Date()); |
| | | update(query, update); |
| | | } |
| | | } |
| | | |
| | | |
| | | public List<GoldCornGetFrequencyConfig> list(DaoQuery daoQuery){ |
| | | public List<GoldCornGetFrequencyConfig> list(DaoQuery daoQuery) { |
| | | Query query = getQuery(daoQuery); |
| | | if (daoQuery.sortList!=null && daoQuery.sortList.size()>0){ |
| | | 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); |
| | | public long count(DaoQuery daoQuery) { |
| | | Query query = getQuery(daoQuery); |
| | | return count(query); |
| | | } |
| | | } |
| | | |
| | | private Query getQuery(DaoQuery daoQuery){ |
| | | List<Criteria> andList=new ArrayList<>(); |
| | | if(daoQuery.system!=null){ |
| | | private Query getQuery(DaoQuery daoQuery) { |
| | | List<Criteria> andList = new ArrayList<>(); |
| | | if (daoQuery.system != null) { |
| | | andList.add(Criteria.where("system").is(daoQuery.system)); |
| | | } |
| | | if(daoQuery.type!=null){ |
| | | if (daoQuery.type != null) { |
| | | andList.add(Criteria.where("type").is(daoQuery.type)); |
| | | } |
| | | if(daoQuery.maxValidateTime!=null){ |
| | | if (daoQuery.maxValidateTime != null) { |
| | | andList.add(Criteria.where("validateTime").lt(daoQuery.maxValidateTime)); |
| | | } |
| | | if(daoQuery.minValidateTime!=null){ |
| | | if (daoQuery.minValidateTime != null) { |
| | | andList.add(Criteria.where("validateTime").gte(daoQuery.minValidateTime)); |
| | | } |
| | | Query query=new Query(); |
| | | Criteria[] ands=new Criteria[andList.size()]; |
| | | Query query = new Query(); |
| | | Criteria[] ands = new Criteria[andList.size()]; |
| | | andList.toArray(ands); |
| | | if(ands.length>0){ |
| | | if (ands.length > 0) { |
| | | query.addCriteria(new Criteria().andOperator(ands)); |
| | | } |
| | | return query; |
| | | } |
| | | } |
| | | |
| | | public static class DaoQuery{ |
| | | public static class DaoQuery { |
| | | public SystemEnum system; |
| | | public GoldCornGetType type; |
| | | public Date maxValidateTime; |
| | |
| | | public int start; |
| | | public int count; |
| | | public List<Sort.Order> sortList; |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.yeshi.makemoney.app.dao.msg; |
| | | |
| | | import com.yeshi.makemoney.app.entity.msg.AppPageNotifyMsg; |
| | | import org.springframework.data.domain.Sort; |
| | | 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.stereotype.Repository; |
| | | import org.yeshi.utils.mongo.MongodbBaseDao; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | |
| | | @Repository |
| | | public class AppPageNotifyMsgDao extends MongodbBaseDao<AppPageNotifyMsg>{ |
| | | |
| | | public void updateSelective(AppPageNotifyMsg bean) { |
| | | Query query = new Query(); |
| | | Update update=new Update(); |
| | | query.addCriteria(Criteria.where("id").is(bean.getId())); |
| | | if(bean.getSystem() != null) { |
| | | update.set("system", bean.getSystem()); |
| | | } |
| | | if(bean.getType() != null) { |
| | | update.set("type", bean.getType()); |
| | | } |
| | | if(bean.getShow() != null) { |
| | | update.set("show", bean.getShow()); |
| | | } |
| | | if(bean.getCanClose() != null) { |
| | | update.set("canClose", bean.getCanClose()); |
| | | } |
| | | if(bean.getContent() != null) { |
| | | update.set("content", bean.getContent()); |
| | | } |
| | | if(bean.getContentUrl() != null) { |
| | | update.set("contentUrl", bean.getContentUrl()); |
| | | } |
| | | if(bean.getMd5() != null) { |
| | | update.set("md5", bean.getMd5()); |
| | | } |
| | | 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<AppPageNotifyMsg> 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.type!=null){ |
| | | andList.add(Criteria.where("type").is(daoQuery.type)); |
| | | } |
| | | if(daoQuery.show!=null){ |
| | | andList.add(Criteria.where("show").is(daoQuery.show)); |
| | | } |
| | | if(daoQuery.content!=null){ |
| | | andList.add(Criteria.where("content").regex(daoQuery.content)); |
| | | } |
| | | 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 AppPageNotifyMsg.AppPageNotifyMsgType type; |
| | | public Boolean show; |
| | | public String content; |
| | | public int start; |
| | | public int count; |
| | | public List<Sort.Order> sortList; |
| | | } |
| | | } |
New file |
| | |
| | | package com.yeshi.makemoney.app.dao.msg; |
| | | |
| | | import com.yeshi.makemoney.app.entity.msg.UserMsg; |
| | | import com.yeshi.makemoney.app.entity.msg.UserMsgType; |
| | | import org.springframework.data.domain.Sort; |
| | | 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.stereotype.Repository; |
| | | import org.yeshi.utils.mongo.MongodbBaseDao; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | |
| | | @Repository |
| | | public class UserMsgDao extends MongodbBaseDao<UserMsg>{ |
| | | |
| | | public void updateSelective(UserMsg 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.getType() != null) { |
| | | update.set("type", bean.getType()); |
| | | } |
| | | if(bean.getContentList() != null) { |
| | | update.set("contentList", bean.getContentList()); |
| | | } |
| | | if(bean.getCreateTime() != null) { |
| | | update.set("createTime", bean.getCreateTime()); |
| | | } |
| | | update.set("updateTime", new Date()); |
| | | update(query, update); |
| | | } |
| | | |
| | | |
| | | public List<UserMsg> 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.type!=null){ |
| | | andList.add(Criteria.where("type").is(daoQuery.type)); |
| | | } |
| | | if(daoQuery.maxCreateTime!=null){ |
| | | andList.add(Criteria.where("createTime").lt(daoQuery.maxCreateTime)); |
| | | } |
| | | if(daoQuery.minCreateTime!=null){ |
| | | andList.add(Criteria.where("createTime").gte(daoQuery.minCreateTime)); |
| | | } |
| | | 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 UserMsgType type; |
| | | public Date maxCreateTime; |
| | | public Date minCreateTime; |
| | | public int start; |
| | | public int count; |
| | | public List<Sort.Order> sortList; |
| | | } |
| | | } |
| | |
| | | package com.yeshi.makemoney.app.dao.team; |
| | | |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import java.util.List; |
| | | import java.util.Date; |
| | | |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import org.yeshi.utils.mybatis.BaseMapper; |
| | |
| | | @Repository |
| | | public interface TeamInviteRelationMapper extends BaseMapper<TeamInviteRelation> { |
| | | |
| | | TeamInviteRelation selectByPrimaryKeyForUpdate(@Param("id") java.lang.Long id); |
| | | TeamInviteRelation selectByPrimaryKeyForUpdate(@Param("id") java.lang.Long id); |
| | | |
| | | List<TeamInviteRelation> list(@Param("query") DaoQuery query); |
| | | List<TeamInviteRelation> list(@Param("query") DaoQuery query); |
| | | |
| | | long count(@Param("query") DaoQuery query); |
| | | long count(@Param("query") DaoQuery query); |
| | | |
| | | public static class DaoQuery{ |
| | | List<TeamInviteRelation> listSecondTeam(@Param("uid") Long uid, @Param("start") long start, @Param("count") int count); |
| | | |
| | | long countSecondTeam(@Param("uid") Long uid); |
| | | |
| | | |
| | | public static class DaoQuery { |
| | | public Long uid; |
| | | public Long targetUid; |
| | | //tuid 表示 值为uid或targetUid |
| | | public Long tuid; |
| | | public Integer state; |
| | | public Date maxCreateTime; |
| | | public Date minCreateTime; |
| | | public long start; |
| | | public int count; |
| | | public List<String> sortList; |
| | | } |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.yeshi.makemoney.app.dto.mq; |
| | | |
| | | import com.yeshi.makemoney.app.entity.goldcorn.GoldCornGetType; |
| | | |
| | | /** |
| | | * @author hxh |
| | | * @title: AddGoldCornMQMsg |
| | | * @description: TODO |
| | | * @date 2022/4/6 19:16 |
| | | */ |
| | | public class AddGoldCornMQMsg { |
| | | |
| | | private Long uid; |
| | | private GoldCornGetType type; |
| | | private long currentTime; |
| | | |
| | | public Long getUid() { |
| | | return uid; |
| | | } |
| | | |
| | | public void setUid(Long uid) { |
| | | this.uid = uid; |
| | | } |
| | | |
| | | public GoldCornGetType getType() { |
| | | return type; |
| | | } |
| | | |
| | | public void setType(GoldCornGetType type) { |
| | | this.type = type; |
| | | } |
| | | |
| | | public long getCurrentTime() { |
| | | return currentTime; |
| | | } |
| | | |
| | | public void setCurrentTime(long currentTime) { |
| | | this.currentTime = currentTime; |
| | | } |
| | | } |
New file |
| | |
| | | package com.yeshi.makemoney.app.dto.mq; |
| | | |
| | | /** |
| | | * @author hxh |
| | | * @title: GoldCornSettleMQMsg |
| | | * @description: 金币结算消息 |
| | | * @date 2022/4/7 13:42 |
| | | */ |
| | | public class GoldCornSettleMQMsg { |
| | | |
| | | private Long uid; |
| | | private String day; |
| | | private long createTime; |
| | | |
| | | public GoldCornSettleMQMsg() { |
| | | } |
| | | |
| | | |
| | | public GoldCornSettleMQMsg(Long uid, String day, long createTime) { |
| | | this.uid = uid; |
| | | this.day = day; |
| | | this.createTime = createTime; |
| | | } |
| | | |
| | | 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 long getCreateTime() { |
| | | return createTime; |
| | | } |
| | | |
| | | public void setCreateTime(long createTime) { |
| | | this.createTime = createTime; |
| | | } |
| | | } |
| | |
| | | @Document(collection = "goldCornGetFrequencyConfig") |
| | | public class GoldCornGetFrequencyConfig { |
| | | |
| | | enum GoldCornGetFrequencyTimeUnit { |
| | | hour, day, week, month, year |
| | | public enum GoldCornGetFrequencyTimeUnit { |
| | | minute("分钟"), hour("小时"), day("天"), week("周"), month("月"), year("年"); |
| | | |
| | | private String name; |
| | | |
| | | private GoldCornGetFrequencyTimeUnit(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | } |
| | | |
| | | @Id |
| | |
| | | * 单位 |
| | | */ |
| | | private GoldCornGetFrequencyTimeUnit timeUnit; |
| | | |
| | | |
| | | /** |
| | | * 最小间隔时间(秒) |
| | | */ |
| | | private Long minSpaceTime; |
| | | |
| | | @Indexed |
| | | private Date validateTime; |
| | | |
| | |
| | | private Date createTime; |
| | | private Date updateTime; |
| | | |
| | | public String toId() { |
| | | return system.name()+"-"+type.name(); |
| | | public String toId() { |
| | | return system.name() + "-" + type.name() + "-" + validateTime.getTime(); |
| | | } |
| | | |
| | | public String getId() { |
| | |
| | | public void setRemarks(String remarks) { |
| | | this.remarks = remarks; |
| | | } |
| | | |
| | | |
| | | public Long getMinSpaceTime() { |
| | | return minSpaceTime; |
| | | } |
| | | |
| | | public void setMinSpaceTime(Long minSpaceTime) { |
| | | this.minSpaceTime = minSpaceTime; |
| | | } |
| | | } |
| | |
| | | */ |
| | | @Document(collection = "goldCornGetRecord") |
| | | public class GoldCornGetRecord { |
| | | public final static int LEVEL_OWN = 0; |
| | | public final static int LEVEL_FIRST = 1; |
| | | public final static int LEVEL_SECOND = 2; |
| | | |
| | | |
| | | @Id |
| | | private String id; |
| | | @Indexed |
| | |
| | | @Indexed |
| | | private Date createTime; |
| | | private Date updateTime; |
| | | |
| | | /** |
| | | * 等级,0-由自己获取 1-下级获取 2-下下级获取 |
| | | **/ |
| | | private Integer level; |
| | | |
| | | public String toId() { |
| | | return uid + "-" + type.name() + "-" + createTime.getTime(); |
| | |
| | | public void setUpdateTime(Date updateTime) { |
| | | this.updateTime = updateTime; |
| | | } |
| | | |
| | | public Integer getLevel() { |
| | | return level; |
| | | } |
| | | |
| | | public void setLevel(Integer level) { |
| | | this.level = level; |
| | | } |
| | | } |
| | |
| | | * @description: 提现 |
| | | * @date 2022/4/1 11:57 |
| | | */ |
| | | @Table("yeshi_ec_extract") |
| | | @Table("mm_ec_extract") |
| | | public class Extract { |
| | | // 未处理 |
| | | public static int STATE_NOT_PROCESS = 0; |
| | |
| | | * @date 2022/4/1 12:01 |
| | | */ |
| | | public enum ExtractPayType { |
| | | wx, alipay; |
| | | wx("微信"), alipay("支付宝"); |
| | | |
| | | private String name; |
| | | |
| | | private ExtractPayType(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | } |
| | |
| | | goldCorn("金币兑换"), |
| | | shopping("购物"); |
| | | |
| | | private String name; |
| | | |
| | | private UserMoneyType(String name) { |
| | | this.name = name; |
| | | |
| | | } |
| | | |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | } |
| | |
| | | import org.springframework.data.annotation.Id; |
| | | import org.springframework.data.mongodb.core.index.Indexed; |
| | | import org.springframework.data.mongodb.core.mapping.Document; |
| | | import org.yeshi.utils.StringUtil; |
| | | |
| | | import java.util.Date; |
| | | |
| | |
| | | public class AppPageNotifyMsg { |
| | | |
| | | public enum AppPageNotifyMsgType { |
| | | mine("我的"); |
| | | |
| | | private String name; |
| | | |
| | | private AppPageNotifyMsgType(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | return system.name() + "-" + type.name(); |
| | | } |
| | | |
| | | public String toMD5() { |
| | | return StringUtil.Md5(type.name() + "#" + content + "#" + contentUrl); |
| | | } |
| | | |
| | | |
| | | public String getId() { |
| | | return id; |
New file |
| | |
| | | package com.yeshi.makemoney.app.entity.msg; |
| | | |
| | | 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; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author hxh |
| | | * @title: UserMsg |
| | | * @description: 用户消息 |
| | | * @date 2022/4/7 15:42 |
| | | */ |
| | | @Document(collection = "userMsg") |
| | | public class UserMsg { |
| | | |
| | | @Id |
| | | private String id; |
| | | @Indexed |
| | | private Long uid; |
| | | @Indexed |
| | | private UserMsgType type; |
| | | |
| | | private List<UserMsgItem> contentList; |
| | | |
| | | @Indexed |
| | | private Date createTime; |
| | | private Date updateTime; |
| | | |
| | | public String toId() { |
| | | return uid + "-" + type.name() + "-" + createTime.getTime(); |
| | | } |
| | | |
| | | 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 UserMsgType getType() { |
| | | return type; |
| | | } |
| | | |
| | | public void setType(UserMsgType type) { |
| | | this.type = type; |
| | | } |
| | | |
| | | public List<UserMsgItem> getContentList() { |
| | | return contentList; |
| | | } |
| | | |
| | | public void setContentList(List<UserMsgItem> contentList) { |
| | | this.contentList = contentList; |
| | | } |
| | | |
| | | 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 static class UserMsgItem { |
| | | private String key; |
| | | private String value; |
| | | |
| | | public UserMsgItem(String key, String value) { |
| | | this.key = key; |
| | | this.value = value; |
| | | } |
| | | |
| | | public String getKey() { |
| | | return key; |
| | | } |
| | | |
| | | public void setKey(String key) { |
| | | this.key = key; |
| | | } |
| | | |
| | | public String getValue() { |
| | | return value; |
| | | } |
| | | |
| | | public void setValue(String value) { |
| | | this.value = value; |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.yeshi.makemoney.app.entity.msg; |
| | | |
| | | /** |
| | | * @author hxh |
| | | * @title: UserMsgType |
| | | * @description: TODO |
| | | * @date 2022/4/7 15:19 |
| | | */ |
| | | public enum UserMsgType { |
| | | |
| | | goldcornexchange("金币折算"), extract("余额提现"), system("系统消息"); |
| | | |
| | | private String name; |
| | | |
| | | private UserMsgType(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | } |
| | |
| | | //被封禁 |
| | | public final static int STATUS_FORBIDDEN = 3; |
| | | |
| | | public UserInfo() { |
| | | } |
| | | |
| | | public UserInfo(Long id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | @Expose |
| | | @Id |
New file |
| | |
| | | package com.yeshi.makemoney.app.exception.goldcorn; |
| | | |
| | | import com.ks.lib.common.exception.BaseException; |
| | | |
| | | public class GoldCornMakeException extends BaseException { |
| | | |
| | | //获取频率受限 |
| | | public final static int CODE_GET_FREQUENCY_LIMIT = 101; |
| | | |
| | | //添加记录出错 |
| | | public final static int CODE_ADD_RECORD_ERROR = 201; |
| | | |
| | | |
| | | private int code; |
| | | private String msg; |
| | | |
| | | public GoldCornMakeException(int code, String msg) { |
| | | super(code, msg); |
| | | this.code = code; |
| | | this.msg = msg; |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.yeshi.makemoney.app.exception.msg; |
| | | |
| | | import com.ks.lib.common.exception.BaseException; |
| | | |
| | | public class AppPageNotifyMsgException extends BaseException { |
| | | |
| | | public AppPageNotifyMsgException(int code, String msg) { |
| | | super(code, msg); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.yeshi.makemoney.app.exception.msg; |
| | | |
| | | import com.ks.lib.common.exception.BaseException; |
| | | |
| | | public class UserMsgException extends BaseException { |
| | | |
| | | public UserMsgException(int code, String msg) { |
| | | super(code, msg); |
| | | } |
| | | |
| | | } |
| | |
| | | package com.yeshi.makemoney.app.exception.team; |
| | | |
| | | import java.lang.Exception; |
| | | import com.ks.lib.common.exception.BaseException; |
| | | |
| | | public class TeamInviteRelationException extends Exception{ |
| | | public class TeamInviteRelationException extends BaseException { |
| | | |
| | | //已经被邀请 |
| | | public final static int CODE_ALREADY_INVITED = 101; |
| | | |
| | | public TeamInviteRelationException(int code, String msg) { |
| | | // super(code, msg); |
| | | super(code, msg); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.yeshi.makemoney.app.exception.user; |
| | | |
| | | import com.ks.lib.common.exception.BaseException; |
| | | |
| | | /** |
| | | * @author hxh |
| | | * @title: UserInfoException |
| | | * @description: 用户信息异常 |
| | | * @date 2022/4/6 18:10 |
| | | */ |
| | | public class UserInfoException extends BaseException { |
| | | |
| | | public UserInfoException(int code, String msg) { |
| | | super(code, msg); |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | import java.lang.Exception; |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.yeshi.makemoney.app.exception.goldcorn.GoldCornConsumeRecordException; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Date; |
| | | |
| | | import org.yeshi.utils.StringUtil; |
| | | import org.yeshi.utils.TimeUtil; |
| | | import org.yeshi.utils.bean.BeanUtil; |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.yeshi.makemoney.app.dao.goldcorn.GoldCornConsumeRecordDao; |
| | | import com.yeshi.makemoney.app.entity.goldcorn.GoldCornConsumeRecord; |
| | | import com.yeshi.makemoney.app.service.inter.goldcorn.GoldCornConsumeRecordService; |
| | |
| | | import org.springframework.data.mongodb.core.query.Query; |
| | | |
| | | @Service |
| | | public class GoldCornConsumeRecordServiceImpl implements GoldCornConsumeRecordService{ |
| | | public class GoldCornConsumeRecordServiceImpl implements GoldCornConsumeRecordService { |
| | | |
| | | @Resource |
| | | private GoldCornConsumeRecordDao goldCornConsumeRecordDao; |
| | | @Resource |
| | | private GoldCornConsumeRecordDao goldCornConsumeRecordDao; |
| | | |
| | | @Override |
| | | public List<GoldCornConsumeRecord> list(GoldCornConsumeRecordQuery goldCornConsumeRecordQuery, int page, int pageSize) { |
| | | DaoQuery daoQuery = new DaoQuery(); |
| | | try { |
| | | BeanUtil.copyProperties(goldCornConsumeRecordQuery, daoQuery); |
| | | } catch (IllegalAccessException e) { |
| | | e.printStackTrace(); |
| | | @Override |
| | | public List<GoldCornConsumeRecord> list(GoldCornConsumeRecordQuery goldCornConsumeRecordQuery, int page, int pageSize) { |
| | | DaoQuery daoQuery = new DaoQuery(); |
| | | daoQuery.type = goldCornConsumeRecordQuery.getType(); |
| | | daoQuery.uid = goldCornConsumeRecordQuery.getUid(); |
| | | daoQuery.minCreateTime = goldCornConsumeRecordQuery.toStartTime(); |
| | | daoQuery.maxCreateTime = goldCornConsumeRecordQuery.toEndTime(); |
| | | |
| | | daoQuery.start = (page - 1) * pageSize; |
| | | daoQuery.count = pageSize; |
| | | return goldCornConsumeRecordDao.list(daoQuery); |
| | | } |
| | | daoQuery.start=(page-1)*pageSize; |
| | | daoQuery.count=pageSize; |
| | | return goldCornConsumeRecordDao.list(daoQuery); |
| | | } |
| | | |
| | | @Override |
| | | public long count(GoldCornConsumeRecordQuery goldCornConsumeRecordQuery) { |
| | | DaoQuery daoQuery = new DaoQuery(); |
| | | try { |
| | | BeanUtil.copyProperties(goldCornConsumeRecordQuery, daoQuery); |
| | | } catch (IllegalAccessException e) { |
| | | e.printStackTrace(); |
| | | @Override |
| | | public long count(GoldCornConsumeRecordQuery goldCornConsumeRecordQuery) { |
| | | DaoQuery daoQuery = new DaoQuery(); |
| | | daoQuery.type = goldCornConsumeRecordQuery.getType(); |
| | | daoQuery.uid = goldCornConsumeRecordQuery.getUid(); |
| | | daoQuery.minCreateTime = goldCornConsumeRecordQuery.toStartTime(); |
| | | daoQuery.maxCreateTime = goldCornConsumeRecordQuery.toEndTime(); |
| | | return goldCornConsumeRecordDao.count(daoQuery); |
| | | } |
| | | return goldCornConsumeRecordDao.count(daoQuery); |
| | | } |
| | | |
| | | @Override |
| | | public GoldCornConsumeRecord get(String id) { |
| | | Query query=new Query(); |
| | | query.addCriteria(Criteria.where("_id").is(id)); |
| | | return goldCornConsumeRecordDao.findOne(query); |
| | | } |
| | | @Override |
| | | public GoldCornConsumeRecord get(String id) { |
| | | Query query = new Query(); |
| | | query.addCriteria(Criteria.where("_id").is(id)); |
| | | return goldCornConsumeRecordDao.findOne(query); |
| | | } |
| | | |
| | | @Override |
| | | public void add(GoldCornConsumeRecord goldCornConsumeRecord) throws Exception { |
| | | //查询主键ID是否存在 |
| | | if(goldCornConsumeRecordDao.get(goldCornConsumeRecord.getId())!=null){ |
| | | throw new Exception("已存在"); |
| | | } |
| | | @Override |
| | | public void add(GoldCornConsumeRecord goldCornConsumeRecord) throws GoldCornConsumeRecordException { |
| | | |
| | | if(goldCornConsumeRecord.getCreateTime()==null){ |
| | | goldCornConsumeRecord.setCreateTime(new Date()); |
| | | } |
| | | //保存 |
| | | goldCornConsumeRecordDao.save(goldCornConsumeRecord); |
| | | } |
| | | if (goldCornConsumeRecord.getType() == null || goldCornConsumeRecord.getUid() == null || goldCornConsumeRecord.getCornNum() == null) { |
| | | throw new GoldCornConsumeRecordException(GoldCornConsumeRecordException.CODE_PARAMS_NOT_ENOUGH, "参数不完整"); |
| | | } |
| | | |
| | | @Override |
| | | public void update(GoldCornConsumeRecord goldCornConsumeRecord) { |
| | | if(goldCornConsumeRecord.getUpdateTime()==null){ |
| | | goldCornConsumeRecord.setUpdateTime(new Date()); |
| | | } |
| | | //更新 |
| | | goldCornConsumeRecordDao.updateSelective(goldCornConsumeRecord); |
| | | } |
| | | |
| | | @Override |
| | | public void delete(List<String> idList) { |
| | | for (String id : idList){ |
| | | goldCornConsumeRecordDao.delete(id); |
| | | } |
| | | } |
| | | if (goldCornConsumeRecord.getCreateTime() == null) { |
| | | goldCornConsumeRecord.setCreateTime(new Date()); |
| | | } |
| | | |
| | | if (goldCornConsumeRecord.getId() == null) { |
| | | goldCornConsumeRecord.setId(goldCornConsumeRecord.toId()); |
| | | } |
| | | |
| | | //查询主键ID是否存在 |
| | | if (goldCornConsumeRecordDao.get(goldCornConsumeRecord.getId()) != null) { |
| | | throw new GoldCornConsumeRecordException(GoldCornConsumeRecordException.CODE_EXIST, "记录已存在"); |
| | | } |
| | | |
| | | |
| | | //保存 |
| | | goldCornConsumeRecordDao.save(goldCornConsumeRecord); |
| | | } |
| | | |
| | | @Override |
| | | public void update(GoldCornConsumeRecord goldCornConsumeRecord) { |
| | | if (goldCornConsumeRecord.getUpdateTime() == null) { |
| | | goldCornConsumeRecord.setUpdateTime(new Date()); |
| | | } |
| | | //更新 |
| | | goldCornConsumeRecordDao.updateSelective(goldCornConsumeRecord); |
| | | } |
| | | |
| | | @Override |
| | | public void delete(List<String> idList) { |
| | | for (String id : idList) { |
| | | goldCornConsumeRecordDao.delete(id); |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | import java.lang.Exception; |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.yeshi.makemoney.app.entity.SystemEnum; |
| | | import com.yeshi.makemoney.app.entity.goldcorn.GoldCornGetType; |
| | | import org.springframework.data.domain.Sort; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Arrays; |
| | | import java.util.Date; |
| | | |
| | | import org.yeshi.utils.StringUtil; |
| | | import org.yeshi.utils.TimeUtil; |
| | | import org.yeshi.utils.bean.BeanUtil; |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.yeshi.makemoney.app.dao.goldcorn.GoldCornGetFrequencyConfigDao; |
| | | import com.yeshi.makemoney.app.entity.goldcorn.GoldCornGetFrequencyConfig; |
| | | import com.yeshi.makemoney.app.service.inter.goldcorn.GoldCornGetFrequencyConfigService; |
| | |
| | | import org.springframework.data.mongodb.core.query.Query; |
| | | |
| | | @Service |
| | | public class GoldCornGetFrequencyConfigServiceImpl implements GoldCornGetFrequencyConfigService{ |
| | | public class GoldCornGetFrequencyConfigServiceImpl implements GoldCornGetFrequencyConfigService { |
| | | |
| | | @Resource |
| | | private GoldCornGetFrequencyConfigDao goldCornGetFrequencyConfigDao; |
| | | @Resource |
| | | private GoldCornGetFrequencyConfigDao goldCornGetFrequencyConfigDao; |
| | | |
| | | @Override |
| | | public List<GoldCornGetFrequencyConfig> list(GoldCornGetFrequencyConfigQuery goldCornGetFrequencyConfigQuery, int page, int pageSize) { |
| | | DaoQuery daoQuery = new DaoQuery(); |
| | | try { |
| | | BeanUtil.copyProperties(goldCornGetFrequencyConfigQuery, daoQuery); |
| | | } catch (IllegalAccessException e) { |
| | | e.printStackTrace(); |
| | | @Override |
| | | public List<GoldCornGetFrequencyConfig> list(GoldCornGetFrequencyConfigQuery goldCornGetFrequencyConfigQuery, int page, int pageSize) { |
| | | DaoQuery daoQuery = new DaoQuery(); |
| | | daoQuery.type = goldCornGetFrequencyConfigQuery.getType(); |
| | | daoQuery.minValidateTime = goldCornGetFrequencyConfigQuery.toStartTime(); |
| | | daoQuery.maxValidateTime = goldCornGetFrequencyConfigQuery.toEndTime(); |
| | | daoQuery.start = (page - 1) * pageSize; |
| | | daoQuery.count = pageSize; |
| | | return goldCornGetFrequencyConfigDao.list(daoQuery); |
| | | } |
| | | daoQuery.start=(page-1)*pageSize; |
| | | daoQuery.count=pageSize; |
| | | return goldCornGetFrequencyConfigDao.list(daoQuery); |
| | | } |
| | | |
| | | @Override |
| | | public long count(GoldCornGetFrequencyConfigQuery goldCornGetFrequencyConfigQuery) { |
| | | DaoQuery daoQuery = new DaoQuery(); |
| | | try { |
| | | BeanUtil.copyProperties(goldCornGetFrequencyConfigQuery, daoQuery); |
| | | } catch (IllegalAccessException e) { |
| | | e.printStackTrace(); |
| | | @Override |
| | | public long count(GoldCornGetFrequencyConfigQuery goldCornGetFrequencyConfigQuery) { |
| | | DaoQuery daoQuery = new DaoQuery(); |
| | | daoQuery.type = goldCornGetFrequencyConfigQuery.getType(); |
| | | daoQuery.minValidateTime = goldCornGetFrequencyConfigQuery.toStartTime(); |
| | | daoQuery.maxValidateTime = goldCornGetFrequencyConfigQuery.toEndTime(); |
| | | return goldCornGetFrequencyConfigDao.count(daoQuery); |
| | | } |
| | | return goldCornGetFrequencyConfigDao.count(daoQuery); |
| | | } |
| | | |
| | | @Override |
| | | public GoldCornGetFrequencyConfig get(String id) { |
| | | Query query=new Query(); |
| | | query.addCriteria(Criteria.where("_id").is(id)); |
| | | return goldCornGetFrequencyConfigDao.findOne(query); |
| | | } |
| | | @Override |
| | | public GoldCornGetFrequencyConfig get(String id) { |
| | | Query query = new Query(); |
| | | query.addCriteria(Criteria.where("_id").is(id)); |
| | | return goldCornGetFrequencyConfigDao.findOne(query); |
| | | } |
| | | |
| | | @Override |
| | | public void add(GoldCornGetFrequencyConfig goldCornGetFrequencyConfig) throws Exception { |
| | | //查询主键ID是否存在 |
| | | if(goldCornGetFrequencyConfigDao.get(goldCornGetFrequencyConfig.getId())!=null){ |
| | | throw new Exception("已存在"); |
| | | } |
| | | @Override |
| | | public void add(GoldCornGetFrequencyConfig goldCornGetFrequencyConfig) throws Exception { |
| | | |
| | | if(goldCornGetFrequencyConfig.getCreateTime()==null){ |
| | | goldCornGetFrequencyConfig.setCreateTime(new Date()); |
| | | } |
| | | //保存 |
| | | goldCornGetFrequencyConfigDao.save(goldCornGetFrequencyConfig); |
| | | } |
| | | if (goldCornGetFrequencyConfig.getId() == null) { |
| | | goldCornGetFrequencyConfig.setId(goldCornGetFrequencyConfig.toId()); |
| | | } |
| | | |
| | | @Override |
| | | public void update(GoldCornGetFrequencyConfig goldCornGetFrequencyConfig) { |
| | | if(goldCornGetFrequencyConfig.getUpdateTime()==null){ |
| | | goldCornGetFrequencyConfig.setUpdateTime(new Date()); |
| | | } |
| | | //更新 |
| | | goldCornGetFrequencyConfigDao.updateSelective(goldCornGetFrequencyConfig); |
| | | } |
| | | //查询主键ID是否存在 |
| | | if (goldCornGetFrequencyConfigDao.get(goldCornGetFrequencyConfig.getId()) != null) { |
| | | throw new Exception("已存在"); |
| | | } |
| | | |
| | | @Override |
| | | public void delete(List<String> idList) { |
| | | for (String id : idList){ |
| | | goldCornGetFrequencyConfigDao.delete(id); |
| | | } |
| | | } |
| | | if (goldCornGetFrequencyConfig.getCreateTime() == null) { |
| | | goldCornGetFrequencyConfig.setCreateTime(new Date()); |
| | | } |
| | | //保存 |
| | | goldCornGetFrequencyConfigDao.save(goldCornGetFrequencyConfig); |
| | | } |
| | | |
| | | @Override |
| | | public void update(GoldCornGetFrequencyConfig goldCornGetFrequencyConfig) { |
| | | if (goldCornGetFrequencyConfig.getUpdateTime() == null) { |
| | | goldCornGetFrequencyConfig.setUpdateTime(new Date()); |
| | | } |
| | | //更新 |
| | | goldCornGetFrequencyConfigDao.updateSelective(goldCornGetFrequencyConfig); |
| | | } |
| | | |
| | | @Override |
| | | public void delete(List<String> idList) { |
| | | for (String id : idList) { |
| | | goldCornGetFrequencyConfigDao.delete(id); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public GoldCornGetFrequencyConfig getConfig(SystemEnum system, GoldCornGetType type, Date time) { |
| | | DaoQuery daoQuery = new DaoQuery(); |
| | | daoQuery.maxValidateTime = time; |
| | | daoQuery.type = type; |
| | | daoQuery.system = system; |
| | | daoQuery.count = 1; |
| | | daoQuery.sortList = Arrays.asList(new Sort.Order[]{Sort.Order.desc("validateTime")}); |
| | | |
| | | |
| | | List<GoldCornGetFrequencyConfig> list = goldCornGetFrequencyConfigDao.list(daoQuery); |
| | | if (list != null && list.size() > 0) { |
| | | return list.get(0); |
| | | } |
| | | |
| | | return null; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | import java.lang.Exception; |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.yeshi.makemoney.app.entity.SystemEnum; |
| | | import com.yeshi.makemoney.app.entity.goldcorn.GoldCornGetType; |
| | | import org.springframework.data.domain.Sort; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Arrays; |
| | | import java.util.Date; |
| | | |
| | | import org.yeshi.utils.StringUtil; |
| | |
| | | public List<GoldCornGetPrice> list(GoldCornGetPriceQuery goldCornGetPriceQuery, int page, int pageSize) { |
| | | DaoQuery daoQuery = new DaoQuery(); |
| | | daoQuery.type = goldCornGetPriceQuery.getType(); |
| | | if (!StringUtil.isNullOrEmpty(goldCornGetPriceQuery.getStartTime())) { |
| | | daoQuery.minValidateTime = new Date(TimeUtil.convertToTimeTemp(goldCornGetPriceQuery.getStartTime(), "yyyy-MM-dd")); |
| | | } |
| | | if (!StringUtil.isNullOrEmpty(goldCornGetPriceQuery.getEndTime())) { |
| | | daoQuery.maxValidateTime = new Date(TimeUtil.convertToTimeTemp(goldCornGetPriceQuery.getEndTime(), "yyyy-MM-dd") + 1000 * 60 * 60 * 24L); |
| | | } |
| | | daoQuery.minValidateTime = goldCornGetPriceQuery.toStartTime(); |
| | | daoQuery.maxValidateTime = goldCornGetPriceQuery.toEndTime(); |
| | | |
| | | |
| | | daoQuery.start = (page - 1) * pageSize; |
| | |
| | | public long count(GoldCornGetPriceQuery goldCornGetPriceQuery) { |
| | | DaoQuery daoQuery = new DaoQuery(); |
| | | daoQuery.type = goldCornGetPriceQuery.getType(); |
| | | if (!StringUtil.isNullOrEmpty(goldCornGetPriceQuery.getStartTime())) { |
| | | daoQuery.minValidateTime = new Date(TimeUtil.convertToTimeTemp(goldCornGetPriceQuery.getStartTime(), "yyyy-MM-dd")); |
| | | } |
| | | if (!StringUtil.isNullOrEmpty(goldCornGetPriceQuery.getEndTime())) { |
| | | daoQuery.maxValidateTime = new Date(TimeUtil.convertToTimeTemp(goldCornGetPriceQuery.getEndTime(), "yyyy-MM-dd") + 1000 * 60 * 60 * 24L); |
| | | } |
| | | daoQuery.minValidateTime = goldCornGetPriceQuery.toStartTime(); |
| | | daoQuery.maxValidateTime = goldCornGetPriceQuery.toEndTime(); |
| | | return goldCornGetPriceDao.count(daoQuery); |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public GoldCornGetPrice getPrice(SystemEnum system, GoldCornGetType type, Date date) { |
| | | DaoQuery daoQuery = new DaoQuery(); |
| | | daoQuery.maxValidateTime = date; |
| | | daoQuery.system = system; |
| | | daoQuery.type = type; |
| | | daoQuery.sortList = Arrays.asList(new Sort.Order[]{Sort.Order.desc("validateTime")}); |
| | | daoQuery.count = 1; |
| | | |
| | | List<GoldCornGetPrice> list = goldCornGetPriceDao.list(daoQuery); |
| | | if (list != null && list.size() > 0) { |
| | | return list.get(0); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | package com.yeshi.makemoney.app.service.impl.goldcorn; |
| | | |
| | | import java.lang.Exception; |
| | | import javax.annotation.Resource; |
| | | |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Date; |
| | | |
| | | import org.yeshi.utils.StringUtil; |
| | | import org.yeshi.utils.TimeUtil; |
| | | import org.yeshi.utils.bean.BeanUtil; |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.yeshi.makemoney.app.dao.goldcorn.GoldCornGetRecordDao; |
| | | import com.yeshi.makemoney.app.dao.goldcorn.GoldCornGetRecordDao.DaoQuery; |
| | | import com.yeshi.makemoney.app.entity.goldcorn.GoldCornGetRecord; |
| | | import com.yeshi.makemoney.app.exception.goldcorn.GoldCornGetRecordException; |
| | | import com.yeshi.makemoney.app.service.inter.goldcorn.GoldCornGetRecordService; |
| | | import com.yeshi.makemoney.app.service.query.goldcorn.GoldCornGetRecordQuery; |
| | | import com.yeshi.makemoney.app.dao.goldcorn.GoldCornGetRecordDao.DaoQuery; |
| | | |
| | | import org.springframework.data.domain.Sort; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.data.mongodb.core.aggregation.Aggregation; |
| | | import org.springframework.data.mongodb.core.aggregation.AggregationOperation; |
| | | import org.springframework.data.mongodb.core.aggregation.AggregationResults; |
| | | import org.springframework.data.mongodb.core.query.Criteria; |
| | | import org.springframework.data.mongodb.core.query.Query; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.*; |
| | | |
| | | @Service |
| | | public class GoldCornGetRecordServiceImpl implements GoldCornGetRecordService { |
| | |
| | | DaoQuery daoQuery = new DaoQuery(); |
| | | daoQuery.type = goldCornGetRecordQuery.getType(); |
| | | daoQuery.uid = goldCornGetRecordQuery.getUid(); |
| | | if (!StringUtil.isNullOrEmpty(goldCornGetRecordQuery.getStartTime())) { |
| | | daoQuery.minCreateTime = new Date(TimeUtil.convertToTimeTemp(goldCornGetRecordQuery.getStartTime(), "yyyy-MM-dd")); |
| | | } |
| | | |
| | | if (!StringUtil.isNullOrEmpty(goldCornGetRecordQuery.getEndTime())) { |
| | | daoQuery.maxCreateTime = new Date(TimeUtil.convertToTimeTemp(goldCornGetRecordQuery.getEndTime(), "yyyy-MM-dd")); |
| | | } |
| | | |
| | | daoQuery.minCreateTime = goldCornGetRecordQuery.toStartTime(); |
| | | daoQuery.maxCreateTime = goldCornGetRecordQuery.toEndTime(); |
| | | |
| | | daoQuery.start = (page - 1) * pageSize; |
| | | daoQuery.count = pageSize; |
| | | daoQuery.sortList = Arrays.asList(new Sort.Order[]{Sort.Order.desc("createTime")}); |
| | | return goldCornGetRecordDao.list(daoQuery); |
| | | } |
| | | |
| | |
| | | DaoQuery daoQuery = new DaoQuery(); |
| | | daoQuery.type = goldCornGetRecordQuery.getType(); |
| | | daoQuery.uid = goldCornGetRecordQuery.getUid(); |
| | | if (!StringUtil.isNullOrEmpty(goldCornGetRecordQuery.getStartTime())) { |
| | | daoQuery.minCreateTime = new Date(TimeUtil.convertToTimeTemp(goldCornGetRecordQuery.getStartTime(), "yyyy-MM-dd")); |
| | | } |
| | | |
| | | if (!StringUtil.isNullOrEmpty(goldCornGetRecordQuery.getEndTime())) { |
| | | daoQuery.maxCreateTime = new Date(TimeUtil.convertToTimeTemp(goldCornGetRecordQuery.getEndTime(), "yyyy-MM-dd")); |
| | | } |
| | | daoQuery.minCreateTime = goldCornGetRecordQuery.toStartTime(); |
| | | daoQuery.maxCreateTime = goldCornGetRecordQuery.toEndTime(); |
| | | return goldCornGetRecordDao.count(daoQuery); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | @Override |
| | | public void add(GoldCornGetRecord goldCornGetRecord) throws Exception { |
| | | //查询主键ID是否存在 |
| | | if (goldCornGetRecordDao.get(goldCornGetRecord.getId()) != null) { |
| | | throw new Exception("已存在"); |
| | | } |
| | | public void add(GoldCornGetRecord goldCornGetRecord) throws GoldCornGetRecordException { |
| | | |
| | | if (goldCornGetRecord.getCreateTime() == null) { |
| | | goldCornGetRecord.setCreateTime(new Date()); |
| | | } |
| | | |
| | | goldCornGetRecord.setId(goldCornGetRecord.toId()); |
| | | |
| | | //查询主键ID是否存在 |
| | | if (goldCornGetRecordDao.get(goldCornGetRecord.getId()) != null) { |
| | | throw new GoldCornGetRecordException(GoldCornGetRecordException.CODE_EXIST, "已存在"); |
| | | } |
| | | |
| | | |
| | | //保存 |
| | | goldCornGetRecordDao.save(goldCornGetRecord); |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public void delete(List<String> idList) { |
| | | for (String id : idList) { |
| | | goldCornGetRecordDao.delete(id); |
| | | public Long getGoldCornByDay(Long uid, String day) { |
| | | List<Criteria> andList = new ArrayList<>(); |
| | | if (uid != null) { |
| | | andList.add(Criteria.where("uid").is(uid)); |
| | | } |
| | | if (day != null) { |
| | | andList.add(Criteria.where("day").is(day)); |
| | | } |
| | | |
| | | Criteria[] ands = new Criteria[andList.size()]; |
| | | andList.toArray(ands); |
| | | List<AggregationOperation> list = new ArrayList<>(); |
| | | if (ands.length > 0) { |
| | | list.add(Aggregation.match(new Criteria().andOperator(ands))); |
| | | } |
| | | list.add(Aggregation.group().sum("cornNum").as("goldcorn")); |
| | | AggregationResults<Map> results = goldCornGetRecordDao.aggregate(list, Map.class); |
| | | return results.getUniqueMappedResult() == null ? 0L : Long.parseLong(results.getUniqueMappedResult().get("goldcorn") + ""); |
| | | } |
| | | |
| | | @Override |
| | | public List<Long> getUidsByDay(String day, int page, int pageSize) { |
| | | List<Long> uidList = new ArrayList<>(); |
| | | List<AggregationOperation> list = new ArrayList<>(); |
| | | list.add(Aggregation.match(Criteria.where("day").is(day))); |
| | | list.add(Aggregation.group("uid")); |
| | | list.add(Aggregation.project("uid")); |
| | | list.add(Aggregation.skip((long) ((page - 1) * pageSize))); |
| | | list.add(Aggregation.limit((long) pageSize)); |
| | | AggregationResults<Map> results = goldCornGetRecordDao.aggregate(list, Map.class); |
| | | List<Map> resultList = results.getMappedResults(); |
| | | if (resultList != null) { |
| | | for (Map map : resultList) { |
| | | uidList.add(Long.parseLong(map.get("_id") + "")); |
| | | } |
| | | } |
| | | return uidList; |
| | | } |
| | | |
| | | @Override |
| | | public long countUidsByDay(String day) { |
| | | List<AggregationOperation> list = new ArrayList<>(); |
| | | list.add(Aggregation.match(Criteria.where("day").is(day))); |
| | | list.add(Aggregation.group("uid")); |
| | | list.add(Aggregation.group().count().as("count")); |
| | | AggregationResults<Map> results = goldCornGetRecordDao.aggregate(list, Map.class); |
| | | return results.getUniqueMappedResult() == null ? 0L : Long.parseLong(results.getUniqueMappedResult().get("count") + ""); |
| | | } |
| | | |
| | | |
New file |
| | |
| | | package com.yeshi.makemoney.app.service.impl.goldcorn; |
| | | |
| | | import com.yeshi.makemoney.app.entity.config.SystemConfigKey; |
| | | import com.yeshi.makemoney.app.entity.goldcorn.GoldCornGetFrequencyConfig; |
| | | import com.yeshi.makemoney.app.entity.goldcorn.GoldCornGetPrice; |
| | | import com.yeshi.makemoney.app.entity.goldcorn.GoldCornGetRecord; |
| | | import com.yeshi.makemoney.app.entity.goldcorn.GoldCornGetType; |
| | | import com.yeshi.makemoney.app.entity.user.UserInfo; |
| | | import com.yeshi.makemoney.app.exception.goldcorn.GoldCornGetFrequencyConfigException; |
| | | import com.yeshi.makemoney.app.exception.goldcorn.GoldCornGetPriceException; |
| | | import com.yeshi.makemoney.app.exception.goldcorn.GoldCornGetRecordException; |
| | | import com.yeshi.makemoney.app.exception.goldcorn.GoldCornMakeException; |
| | | import com.yeshi.makemoney.app.exception.user.UserInfoException; |
| | | import com.yeshi.makemoney.app.service.inter.config.SystemConfigService; |
| | | import com.yeshi.makemoney.app.service.inter.goldcorn.GoldCornGetFrequencyConfigService; |
| | | import com.yeshi.makemoney.app.service.inter.goldcorn.GoldCornGetPriceService; |
| | | import com.yeshi.makemoney.app.service.inter.goldcorn.GoldCornGetRecordService; |
| | | import com.yeshi.makemoney.app.service.inter.goldcorn.GoldCornMakeService; |
| | | import com.yeshi.makemoney.app.service.inter.team.TeamInviteRelationService; |
| | | import com.yeshi.makemoney.app.service.inter.user.UserInfoService; |
| | | import com.yeshi.makemoney.app.service.query.goldcorn.GoldCornGetRecordQuery; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | import org.springframework.stereotype.Service; |
| | | import org.yeshi.utils.TimeUtil; |
| | | import org.yeshi.utils.annotation.RequestSerializableByKey; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.util.Calendar; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author hxh |
| | | * @title: GoldCornMakeServiceImpl |
| | | * @description: 挣金币服务 |
| | | * @date 2022/4/6 16:56 |
| | | */ |
| | | @Service |
| | | public class GoldCornMakeServiceImpl implements GoldCornMakeService { |
| | | |
| | | @Resource |
| | | private GoldCornGetFrequencyConfigService goldCornGetFrequencyConfigService; |
| | | |
| | | @Resource |
| | | private GoldCornGetRecordService goldCornGetRecordService; |
| | | |
| | | @Resource |
| | | private RedisTemplate<String, String> redisTemplate; |
| | | |
| | | @Resource |
| | | private GoldCornGetPriceService goldCornGetPriceService; |
| | | |
| | | @Resource |
| | | private UserInfoService userInfoService; |
| | | |
| | | @Resource |
| | | private TeamInviteRelationService teamInviteRelationService; |
| | | |
| | | @Resource |
| | | private SystemConfigService systemConfigService; |
| | | |
| | | |
| | | private void frequencyVerify(UserInfo user, GoldCornGetType type, Date time) throws GoldCornGetFrequencyConfigException, GoldCornMakeException { |
| | | GoldCornGetFrequencyConfig config = goldCornGetFrequencyConfigService.getConfig(user.getSystem(), type, time); |
| | | if (config == null) { |
| | | throw new GoldCornGetFrequencyConfigException(GoldCornGetFrequencyConfigException.CODE_NOT_EXIST, "频率配置不存在"); |
| | | } |
| | | |
| | | |
| | | GoldCornGetRecordQuery query = new GoldCornGetRecordQuery(); |
| | | query.setUid(user.getId()); |
| | | query.setType(type); |
| | | |
| | | //间隔判断 |
| | | if (config.getMinSpaceTime() != null) { |
| | | List<GoldCornGetRecord> list = goldCornGetRecordService.list(query, 1, 1); |
| | | if (list != null && list.size() > 0 && System.currentTimeMillis() - list.get(0).getCreateTime().getTime() < config.getMinSpaceTime() * 1000L) { |
| | | String msg = String.format("需要间隔%s秒以上", config.getMinSpaceTime()); |
| | | throw new GoldCornMakeException(GoldCornMakeException.CODE_GET_FREQUENCY_LIMIT, msg); |
| | | } |
| | | } |
| | | |
| | | Date startTime = null; |
| | | Date endTime = time; |
| | | if (config.getTimeUnit() == GoldCornGetFrequencyConfig.GoldCornGetFrequencyTimeUnit.minute) { |
| | | startTime = new Date(TimeUtil.convertToTimeTemp(TimeUtil.getGernalTime(endTime.getTime(), "yyyyMMdd HHmm"), "yyyyMMdd HHmm")); |
| | | } else if (config.getTimeUnit() == GoldCornGetFrequencyConfig.GoldCornGetFrequencyTimeUnit.hour) { |
| | | startTime = new Date(TimeUtil.convertToTimeTemp(TimeUtil.getGernalTime(endTime.getTime(), "yyyyMMdd HH"), "yyyyMMdd HH")); |
| | | } else if (config.getTimeUnit() == GoldCornGetFrequencyConfig.GoldCornGetFrequencyTimeUnit.day) { |
| | | startTime = new Date(TimeUtil.convertToTimeTemp(TimeUtil.getGernalTime(endTime.getTime(), "yyyyMMdd"), "yyyyMMdd")); |
| | | } else if (config.getTimeUnit() == GoldCornGetFrequencyConfig.GoldCornGetFrequencyTimeUnit.week) { |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.setTimeInMillis(endTime.getTime()); |
| | | int subDay = (Calendar.getInstance().get(Calendar.DAY_OF_WEEK) - 2 + 7) % 7; |
| | | startTime = new Date(TimeUtil.convertToTimeTemp(TimeUtil.getGernalTime(endTime.getTime() - 1000 * 60 * 60 * 24L * subDay, "yyyyMMdd"), "yyyyMMdd")); |
| | | } else if (config.getTimeUnit() == GoldCornGetFrequencyConfig.GoldCornGetFrequencyTimeUnit.month) { |
| | | startTime = new Date(TimeUtil.convertToTimeTemp(TimeUtil.getGernalTime(endTime.getTime(), "yyyyMM"), "yyyyMM")); |
| | | } else if (config.getTimeUnit() == GoldCornGetFrequencyConfig.GoldCornGetFrequencyTimeUnit.year) { |
| | | startTime = new Date(TimeUtil.convertToTimeTemp(TimeUtil.getGernalTime(endTime.getTime(), "yyyy"), "yyyy")); |
| | | } |
| | | query.setFormat("yyyyMMdd HH:mm:ss"); |
| | | query.setStartTime(TimeUtil.getGernalTime(startTime.getTime(), query.getFormat())); |
| | | //service里面有减去1天 |
| | | query.setEndTime(TimeUtil.getGernalTime(endTime.getTime() - 1000 * 60 * 60 * 24L, query.getFormat())); |
| | | |
| | | long count = goldCornGetRecordService.count(query); |
| | | if (count >= config.getLimitCount()) { |
| | | String msg = String.format("超出%s次/%s的限制", config.getLimitCount(), config.getTimeUnit().getName()); |
| | | throw new GoldCornMakeException(GoldCornMakeException.CODE_GET_FREQUENCY_LIMIT, msg); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | @RequestSerializableByKey(key = "'addgoldcorn-'+#uid+'-'+#type") |
| | | @Override |
| | | public void addGoldCorn(Long uid, GoldCornGetType type, Date currentTime) throws UserInfoException, GoldCornGetPriceException, GoldCornGetFrequencyConfigException, GoldCornMakeException { |
| | | if (uid == null || type == null || currentTime == null) { |
| | | throw new GoldCornMakeException(GoldCornMakeException.CODE_PARAMS_NOT_ENOUGH, "参数不完整"); |
| | | } |
| | | UserInfo user = userInfoService.get(uid); |
| | | if (user == null) { |
| | | throw new UserInfoException(UserInfoException.CODE_NOT_EXIST, "用户不存在"); |
| | | } |
| | | //判断是否超出了次数限制 |
| | | frequencyVerify(user, type, currentTime); |
| | | //获取价格 |
| | | GoldCornGetPrice price = goldCornGetPriceService.getPrice(user.getSystem(), type, currentTime); |
| | | if (price == null) { |
| | | throw new GoldCornGetPriceException(GoldCornGetPriceException.CODE_NOT_EXIST, "价格信息缺失"); |
| | | } |
| | | GoldCornGetRecord record = new GoldCornGetRecord(); |
| | | record.setCornNum(price.getCornNum()); |
| | | record.setDay(TimeUtil.getGernalTime(currentTime.getTime(), "yyyy-MM-dd")); |
| | | record.setType(type); |
| | | record.setUid(uid); |
| | | record.setLevel(GoldCornGetRecord.LEVEL_OWN); |
| | | record.setCreateTime(currentTime); |
| | | |
| | | try { |
| | | goldCornGetRecordService.add(record); |
| | | //是否有上级 |
| | | Long bossUid = teamInviteRelationService.getBossUid(uid); |
| | | 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.setFromId(record.getId()); |
| | | cRecord.setFromUid(record.getUid()); |
| | | cRecord.setLevel(GoldCornGetRecord.LEVEL_FIRST); |
| | | cRecord.setCreateTime(currentTime); |
| | | if (cRecord.getCornNum() > 0) { |
| | | goldCornGetRecordService.add(cRecord); |
| | | } |
| | | //是否有上上级 |
| | | bossUid = teamInviteRelationService.getBossUid(bossUid); |
| | | 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.setLevel(GoldCornGetRecord.LEVEL_SECOND); |
| | | ccRecord.setCreateTime(currentTime); |
| | | if (ccRecord.getCornNum() > 0) { |
| | | goldCornGetRecordService.add(ccRecord); |
| | | } |
| | | } |
| | | } |
| | | } catch (GoldCornGetRecordException e) { |
| | | throw new GoldCornMakeException(GoldCornMakeException.CODE_ADD_RECORD_ERROR, e.getMsg()); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public Long getGoldCornByDay(Long uid, String day) { |
| | | //TODO redis缓存 |
| | | return goldCornGetRecordService.getGoldCornByDay(uid, day); |
| | | } |
| | | } |
| | |
| | | import java.lang.Exception; |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.ks.lib.common.exception.ParamsException; |
| | | import com.yeshi.makemoney.app.entity.SystemEnum; |
| | | import org.springframework.data.domain.Sort; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Arrays; |
| | | import java.util.Date; |
| | | |
| | | import org.yeshi.utils.StringUtil; |
| | | import org.yeshi.utils.bean.BeanUtil; |
| | | |
| | | import java.util.List; |
| | |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public BigDecimal getRate(String day, SystemEnum system, Date time) throws ParamsException { |
| | | if (StringUtil.isNullOrEmpty(day) || system == null || time == null) { |
| | | throw new ParamsException(ParamsException.CODE_PARAMS_NOT_ENOUGH, "参数不完整"); |
| | | } |
| | | DaoQuery daoQuery = new DaoQuery(); |
| | | daoQuery.day = day; |
| | | daoQuery.maxValidateTime = time; |
| | | daoQuery.sortList = Arrays.asList(new Sort.Order[]{Sort.Order.desc("validateTime")}); |
| | | daoQuery.count = 1; |
| | | daoQuery.system = system; |
| | | List<GoldCornMoneyExchangeRateRecord> list = goldCornMoneyExchangeRateRecordDao.list(daoQuery); |
| | | if (list != null && list.size() > 0) { |
| | | return list.get(0).getRate(); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.yeshi.makemoney.app.service.impl.goldcorn; |
| | | |
| | | import com.ks.lib.common.exception.ParamsException; |
| | | import com.yeshi.makemoney.app.dto.mq.GoldCornSettleMQMsg; |
| | | import com.yeshi.makemoney.app.entity.goldcorn.GoldCornConsumeRecord; |
| | | import com.yeshi.makemoney.app.entity.goldcorn.GoldCornConsumeType; |
| | | import com.yeshi.makemoney.app.entity.money.UserMoneyRecord; |
| | | import com.yeshi.makemoney.app.entity.user.UserInfo; |
| | | import com.yeshi.makemoney.app.exception.goldcorn.GoldCornConsumeRecordException; |
| | | import com.yeshi.makemoney.app.exception.goldcorn.GoldCornMoneyExchangeRateRecordException; |
| | | import com.yeshi.makemoney.app.exception.money.UserMoneyRecordException; |
| | | import com.yeshi.makemoney.app.exception.user.UserInfoException; |
| | | import com.yeshi.makemoney.app.service.inter.goldcorn.GoldCornConsumeRecordService; |
| | | import com.yeshi.makemoney.app.service.inter.goldcorn.GoldCornGetRecordService; |
| | | import com.yeshi.makemoney.app.service.inter.goldcorn.GoldCornMoneyExchangeRateRecordService; |
| | | import com.yeshi.makemoney.app.service.inter.goldcorn.GoldCornSettleService; |
| | | import com.yeshi.makemoney.app.service.inter.money.UserMoneyService; |
| | | import com.yeshi.makemoney.app.service.inter.user.UserInfoService; |
| | | import com.yeshi.makemoney.app.utils.factory.UserMoneyRecordFactory; |
| | | import com.yeshi.makemoney.app.utils.mq.CMQManager; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author hxh |
| | | * @title: GoldCornSettleServiceImpl |
| | | * @description: TODO |
| | | * @date 2022/4/7 11:47 |
| | | */ |
| | | @Service |
| | | public class GoldCornSettleServiceImpl implements GoldCornSettleService { |
| | | |
| | | @Resource |
| | | private GoldCornGetRecordService goldCornGetRecordService; |
| | | |
| | | @Resource |
| | | private GoldCornConsumeRecordService goldCornConsumeRecordService; |
| | | |
| | | @Resource |
| | | private GoldCornMoneyExchangeRateRecordService goldCornMoneyExchangeRateRecordService; |
| | | |
| | | @Resource |
| | | private UserInfoService userInfoService; |
| | | |
| | | @Resource |
| | | private UserMoneyService userMoneyService; |
| | | |
| | | @Override |
| | | public void startSettle(String day) { |
| | | long count = goldCornGetRecordService.countUidsByDay(day); |
| | | int pageSize = 1000; |
| | | int page = (int) (count % pageSize == 0 ? count / pageSize : count / pageSize + 1); |
| | | for (int i = 0; i < page; i++) { |
| | | List<Long> list = goldCornGetRecordService.getUidsByDay(day, i + 1, pageSize); |
| | | for (Long uid : list) { |
| | | //加入到CMQ |
| | | CMQManager.getInstance().addGoldCornSettleMsg(new GoldCornSettleMQMsg(uid, day, System.currentTimeMillis())); |
| | | } |
| | | } |
| | | } |
| | | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Override |
| | | public void settle(Long uid, String day, BigDecimal rate) throws GoldCornConsumeRecordException, UserMoneyRecordException { |
| | | long cornNum = goldCornGetRecordService.getGoldCornByDay(uid, day); |
| | | //金币数量 |
| | | GoldCornConsumeRecord record = new GoldCornConsumeRecord(); |
| | | record.setUid(uid); |
| | | record.setCornNum((int) cornNum); |
| | | record.setMoney(rate.multiply(new BigDecimal(record.getCornNum()).setScale(2, RoundingMode.FLOOR))); |
| | | record.setType(GoldCornConsumeType.changeMoney); |
| | | record.setId(uid + "-" + record.getType().name() + "-" + day); |
| | | try { |
| | | UserMoneyRecord moneyRecord = UserMoneyRecordFactory.createGoldCornExchange(record); |
| | | userMoneyService.addUserMoney(moneyRecord); |
| | | } catch (ParamsException e) { |
| | | throw new UserMoneyRecordException(e.getCode(), e.getMsg()); |
| | | } |
| | | goldCornConsumeRecordService.add(record); |
| | | } |
| | | |
| | | @Override |
| | | public void settle(Long uid, String day) throws UserInfoException, GoldCornMoneyExchangeRateRecordException, UserMoneyRecordException, GoldCornConsumeRecordException { |
| | | UserInfo user = userInfoService.get(uid); |
| | | if (user == null) { |
| | | throw new UserInfoException(UserInfoException.CODE_NOT_EXIST, "用户不存在"); |
| | | } |
| | | |
| | | BigDecimal rate = null; |
| | | try { |
| | | rate = goldCornMoneyExchangeRateRecordService.getRate(day, user.getSystem(), new Date()); |
| | | } catch (ParamsException e) { |
| | | throw new GoldCornMoneyExchangeRateRecordException(GoldCornMoneyExchangeRateRecordException.CODE_PARAMS_NOT_ENOUGH, e.getMsg()); |
| | | } |
| | | |
| | | if (rate == null) { |
| | | throw new GoldCornMoneyExchangeRateRecordException(GoldCornMoneyExchangeRateRecordException.CODE_NOT_EXIST, "未获取到汇率"); |
| | | } |
| | | |
| | | settle(uid, day, rate); |
| | | } |
| | | } |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.util.Arrays; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | @Override |
| | | public List<Extract> list(ExtractQuery extractQuery, int page, int pageSize) { |
| | | DaoQuery daoQuery = new DaoQuery(); |
| | | try { |
| | | BeanUtil.copyProperties(extractQuery, daoQuery); |
| | | } catch (IllegalAccessException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | daoQuery.uid = extractQuery.getUid(); |
| | | daoQuery.minCreateTime = extractQuery.toStartTime(); |
| | | daoQuery.maxCreateTime = extractQuery.toEndTime(); |
| | | daoQuery.sortList = Arrays.asList(new String[]{"create_time desc"}); |
| | | daoQuery.start = (page - 1) * pageSize; |
| | | daoQuery.count = pageSize; |
| | | return extractMapper.list(daoQuery); |
| | |
| | | @Override |
| | | public long count(ExtractQuery extractQuery) { |
| | | DaoQuery daoQuery = new DaoQuery(); |
| | | try { |
| | | BeanUtil.copyProperties(extractQuery, daoQuery); |
| | | } catch (IllegalAccessException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | daoQuery.uid = extractQuery.getUid(); |
| | | daoQuery.minCreateTime = extractQuery.toStartTime(); |
| | | daoQuery.maxCreateTime = extractQuery.toEndTime(); |
| | | return extractMapper.count(daoQuery); |
| | | } |
| | | |
| | |
| | | import com.yeshi.makemoney.app.exception.money.UserMoneyRecordException; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Arrays; |
| | | import java.util.Date; |
| | | |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | @Override |
| | | public List<UserMoneyRecord> list(UserMoneyRecordQuery userMoneyRecordQuery, int page, int pageSize) { |
| | | DaoQuery daoQuery = new DaoQuery(); |
| | | try { |
| | | BeanUtil.copyProperties(userMoneyRecordQuery, daoQuery); |
| | | } catch (IllegalAccessException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | daoQuery.add = userMoneyRecordQuery.getAdd(); |
| | | daoQuery.uid = userMoneyRecordQuery.getUid(); |
| | | daoQuery.sortList = Arrays.asList(new String[]{"create_time desc"}); |
| | | daoQuery.start = (page - 1) * pageSize; |
| | | daoQuery.count = pageSize; |
| | | return userMoneyRecordMapper.list(daoQuery); |
| | |
| | | @Override |
| | | public long count(UserMoneyRecordQuery userMoneyRecordQuery) { |
| | | DaoQuery daoQuery = new DaoQuery(); |
| | | try { |
| | | BeanUtil.copyProperties(userMoneyRecordQuery, daoQuery); |
| | | } catch (IllegalAccessException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | daoQuery.add = userMoneyRecordQuery.getAdd(); |
| | | daoQuery.uid = userMoneyRecordQuery.getUid(); |
| | | return userMoneyRecordMapper.count(daoQuery); |
| | | } |
| | | |
New file |
| | |
| | | package com.yeshi.makemoney.app.service.impl.msg; |
| | | |
| | | import java.lang.Exception; |
| | | import javax.annotation.Resource; |
| | | |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Date; |
| | | |
| | | import org.yeshi.utils.StringUtil; |
| | | import org.yeshi.utils.bean.BeanUtil; |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.yeshi.makemoney.app.dao.msg.AppPageNotifyMsgDao; |
| | | import com.yeshi.makemoney.app.entity.msg.AppPageNotifyMsg; |
| | | import com.yeshi.makemoney.app.service.inter.msg.AppPageNotifyMsgService; |
| | | import com.yeshi.makemoney.app.service.query.msg.AppPageNotifyMsgQuery; |
| | | import com.yeshi.makemoney.app.dao.msg.AppPageNotifyMsgDao.DaoQuery; |
| | | |
| | | import org.springframework.data.mongodb.core.query.Criteria; |
| | | import org.springframework.data.mongodb.core.query.Query; |
| | | |
| | | @Service |
| | | public class AppPageNotifyMsgServiceImpl implements AppPageNotifyMsgService { |
| | | |
| | | @Resource |
| | | private AppPageNotifyMsgDao appPageNotifyMsgDao; |
| | | |
| | | @Override |
| | | public List<AppPageNotifyMsg> list(AppPageNotifyMsgQuery appPageNotifyMsgQuery, int page, int pageSize) { |
| | | DaoQuery daoQuery = new DaoQuery(); |
| | | daoQuery.type = appPageNotifyMsgQuery.getType(); |
| | | daoQuery.content = appPageNotifyMsgQuery.getKw(); |
| | | daoQuery.start = (page - 1) * pageSize; |
| | | daoQuery.count = pageSize; |
| | | return appPageNotifyMsgDao.list(daoQuery); |
| | | } |
| | | |
| | | @Override |
| | | public long count(AppPageNotifyMsgQuery appPageNotifyMsgQuery) { |
| | | DaoQuery daoQuery = new DaoQuery(); |
| | | daoQuery.type = appPageNotifyMsgQuery.getType(); |
| | | daoQuery.content = appPageNotifyMsgQuery.getKw(); |
| | | return appPageNotifyMsgDao.count(daoQuery); |
| | | } |
| | | |
| | | @Override |
| | | public AppPageNotifyMsg get(String id) { |
| | | Query query = new Query(); |
| | | query.addCriteria(Criteria.where("_id").is(id)); |
| | | return appPageNotifyMsgDao.findOne(query); |
| | | } |
| | | |
| | | @Override |
| | | public void add(AppPageNotifyMsg appPageNotifyMsg) throws Exception { |
| | | |
| | | if (appPageNotifyMsg.getId() == null) { |
| | | appPageNotifyMsg.setId(appPageNotifyMsg.toId()); |
| | | } |
| | | |
| | | //查询主键ID是否存在 |
| | | if (appPageNotifyMsgDao.get(appPageNotifyMsg.getId()) != null) { |
| | | throw new Exception("已存在"); |
| | | } |
| | | |
| | | |
| | | appPageNotifyMsg.setMd5(appPageNotifyMsg.toMD5()); |
| | | |
| | | |
| | | if (appPageNotifyMsg.getCreateTime() == null) { |
| | | appPageNotifyMsg.setCreateTime(new Date()); |
| | | } |
| | | //保存 |
| | | appPageNotifyMsgDao.save(appPageNotifyMsg); |
| | | } |
| | | |
| | | @Override |
| | | public void update(AppPageNotifyMsg appPageNotifyMsg) { |
| | | if (appPageNotifyMsg.getUpdateTime() == null) { |
| | | appPageNotifyMsg.setUpdateTime(new Date()); |
| | | } |
| | | //更新 |
| | | appPageNotifyMsgDao.updateSelective(appPageNotifyMsg); |
| | | } |
| | | |
| | | @Override |
| | | public void delete(List<String> idList) { |
| | | for (String id : idList) { |
| | | appPageNotifyMsgDao.delete(id); |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.yeshi.makemoney.app.service.impl.msg; |
| | | |
| | | import java.lang.Exception; |
| | | import javax.annotation.Resource; |
| | | |
| | | import org.springframework.data.domain.Sort; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Arrays; |
| | | import java.util.Date; |
| | | |
| | | import org.yeshi.utils.bean.BeanUtil; |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.yeshi.makemoney.app.dao.msg.UserMsgDao; |
| | | import com.yeshi.makemoney.app.entity.msg.UserMsg; |
| | | import com.yeshi.makemoney.app.service.inter.msg.UserMsgService; |
| | | import com.yeshi.makemoney.app.service.query.msg.UserMsgQuery; |
| | | import com.yeshi.makemoney.app.dao.msg.UserMsgDao.DaoQuery; |
| | | |
| | | import org.springframework.data.mongodb.core.query.Criteria; |
| | | import org.springframework.data.mongodb.core.query.Query; |
| | | |
| | | @Service |
| | | public class UserMsgServiceImpl implements UserMsgService { |
| | | |
| | | @Resource |
| | | private UserMsgDao userMsgDao; |
| | | |
| | | @Override |
| | | public List<UserMsg> list(UserMsgQuery userMsgQuery, int page, int pageSize) { |
| | | DaoQuery daoQuery = new DaoQuery(); |
| | | daoQuery.uid = userMsgQuery.getUid(); |
| | | daoQuery.type = userMsgQuery.getType(); |
| | | daoQuery.minCreateTime = userMsgQuery.toStartTime(); |
| | | daoQuery.maxCreateTime = userMsgQuery.toEndTime(); |
| | | daoQuery.sortList = Arrays.asList(new Sort.Order[]{Sort.Order.desc("createTime")}); |
| | | daoQuery.start = (page - 1) * pageSize; |
| | | daoQuery.count = pageSize; |
| | | return userMsgDao.list(daoQuery); |
| | | } |
| | | |
| | | @Override |
| | | public long count(UserMsgQuery userMsgQuery) { |
| | | DaoQuery daoQuery = new DaoQuery(); |
| | | daoQuery.uid = userMsgQuery.getUid(); |
| | | daoQuery.type = userMsgQuery.getType(); |
| | | daoQuery.minCreateTime = userMsgQuery.toStartTime(); |
| | | daoQuery.maxCreateTime = userMsgQuery.toEndTime(); |
| | | return userMsgDao.count(daoQuery); |
| | | } |
| | | |
| | | @Override |
| | | public UserMsg get(String id) { |
| | | Query query = new Query(); |
| | | query.addCriteria(Criteria.where("_id").is(id)); |
| | | return userMsgDao.findOne(query); |
| | | } |
| | | |
| | | @Override |
| | | public void add(UserMsg userMsg) throws Exception { |
| | | //查询主键ID是否存在 |
| | | if (userMsgDao.get(userMsg.getId()) != null) { |
| | | throw new Exception("已存在"); |
| | | } |
| | | |
| | | if (userMsg.getCreateTime() == null) { |
| | | userMsg.setCreateTime(new Date()); |
| | | } |
| | | //保存 |
| | | userMsgDao.save(userMsg); |
| | | } |
| | | |
| | | @Override |
| | | public void update(UserMsg userMsg) { |
| | | if (userMsg.getUpdateTime() == null) { |
| | | userMsg.setUpdateTime(new Date()); |
| | | } |
| | | //更新 |
| | | userMsgDao.updateSelective(userMsg); |
| | | } |
| | | |
| | | @Override |
| | | public void delete(List<String> idList) { |
| | | for (String id : idList) { |
| | | userMsgDao.delete(id); |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | package com.yeshi.makemoney.app.service.impl.team; |
| | | |
| | | import java.lang.Exception; |
| | | import javax.annotation.Resource; |
| | | 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.TeamInviteRelationMapper; |
| | | import com.yeshi.makemoney.app.dao.team.TeamInviteRelationMapper.DaoQuery; |
| | | import com.yeshi.makemoney.app.entity.team.TeamInviteRelation; |
| | | import com.yeshi.makemoney.app.exception.team.TeamInviteRelationException; |
| | | import com.yeshi.makemoney.app.service.inter.team.TeamInviteRelationService; |
| | | import com.yeshi.makemoney.app.service.query.team.TeamInviteRelationQuery; |
| | | import com.yeshi.makemoney.app.dao.team.TeamInviteRelationMapper.DaoQuery; |
| | | import org.springframework.stereotype.Service; |
| | | import org.yeshi.utils.bean.BeanUtil; |
| | | |
| | | import org.springframework.data.mongodb.core.query.Criteria; |
| | | import org.springframework.data.mongodb.core.query.Query; |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class TeamInviteRelationServiceImpl implements TeamInviteRelationService{ |
| | | public class TeamInviteRelationServiceImpl implements TeamInviteRelationService { |
| | | |
| | | @Resource |
| | | private TeamInviteRelationMapper teamInviteRelationMapper; |
| | | @Resource |
| | | private TeamInviteRelationMapper teamInviteRelationMapper; |
| | | |
| | | @Override |
| | | public List<TeamInviteRelation> list(TeamInviteRelationQuery teamInviteRelationQuery, int page, int pageSize) { |
| | | DaoQuery daoQuery = new DaoQuery(); |
| | | try { |
| | | BeanUtil.copyProperties(teamInviteRelationQuery, daoQuery); |
| | | } catch (IllegalAccessException e) { |
| | | e.printStackTrace(); |
| | | @Override |
| | | public List<TeamInviteRelation> list(TeamInviteRelationQuery teamInviteRelationQuery, int page, int pageSize) { |
| | | DaoQuery daoQuery = new DaoQuery(); |
| | | daoQuery.minCreateTime = teamInviteRelationQuery.toStartTime(); |
| | | daoQuery.maxCreateTime = teamInviteRelationQuery.toEndTime(); |
| | | if (teamInviteRelationQuery.getBoss() != null) { |
| | | if (teamInviteRelationQuery.getBoss()) { |
| | | daoQuery.uid = teamInviteRelationQuery.getUid(); |
| | | } else { |
| | | daoQuery.targetUid = teamInviteRelationQuery.getUid(); |
| | | } |
| | | } else { |
| | | daoQuery.tuid = teamInviteRelationQuery.getUid(); |
| | | } |
| | | daoQuery.start = (page - 1) * pageSize; |
| | | daoQuery.count = pageSize; |
| | | return teamInviteRelationMapper.list(daoQuery); |
| | | } |
| | | daoQuery.start=(page-1)*pageSize; |
| | | daoQuery.count=pageSize; |
| | | return teamInviteRelationMapper.list(daoQuery); |
| | | } |
| | | |
| | | @Override |
| | | public long count(TeamInviteRelationQuery teamInviteRelationQuery) { |
| | | DaoQuery daoQuery = new DaoQuery(); |
| | | try { |
| | | BeanUtil.copyProperties(teamInviteRelationQuery, daoQuery); |
| | | } catch (IllegalAccessException e) { |
| | | e.printStackTrace(); |
| | | @Override |
| | | public long count(TeamInviteRelationQuery teamInviteRelationQuery) { |
| | | DaoQuery daoQuery = new DaoQuery(); |
| | | try { |
| | | BeanUtil.copyProperties(teamInviteRelationQuery, daoQuery); |
| | | } catch (IllegalAccessException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return teamInviteRelationMapper.count(daoQuery); |
| | | } |
| | | return teamInviteRelationMapper.count(daoQuery); |
| | | } |
| | | |
| | | @Override |
| | | public TeamInviteRelation get(Long id) { |
| | | return teamInviteRelationMapper.selectByPrimaryKey(id); |
| | | } |
| | | @Override |
| | | public TeamInviteRelation get(Long id) { |
| | | return teamInviteRelationMapper.selectByPrimaryKey(id); |
| | | } |
| | | |
| | | @Override |
| | | public void add(TeamInviteRelation teamInviteRelation) throws Exception { |
| | | if(teamInviteRelation.getCreateTime()==null){ |
| | | teamInviteRelation.setCreateTime(new Date()); |
| | | } |
| | | //保存 |
| | | teamInviteRelationMapper.insertSelective(teamInviteRelation); |
| | | } |
| | | @Override |
| | | public void add(TeamInviteRelation teamInviteRelation) throws TeamInviteRelationException { |
| | | |
| | | @Override |
| | | public void update(TeamInviteRelation teamInviteRelation) { |
| | | if(teamInviteRelation.getUpdateTime()==null){ |
| | | teamInviteRelation.setUpdateTime(new Date()); |
| | | } |
| | | //保存 |
| | | teamInviteRelationMapper.updateByPrimaryKey(teamInviteRelation); |
| | | } |
| | | if (teamInviteRelation.getUid() == null || teamInviteRelation.getTargetUid() == null) { |
| | | throw new TeamInviteRelationException(TeamInviteRelationException.CODE_PARAMS_NOT_ENOUGH, "参数不完整"); |
| | | } |
| | | |
| | | @Override |
| | | public void delete(List<Long> idList) { |
| | | for (Long id : idList){ |
| | | teamInviteRelationMapper.deleteByPrimaryKey(id); |
| | | } |
| | | } |
| | | //查询下家是否已经有上家 |
| | | if (getBossUid(teamInviteRelation.getTargetUid()) != null) { |
| | | throw new TeamInviteRelationException(TeamInviteRelationException.CODE_ALREADY_INVITED, "已被邀请"); |
| | | } |
| | | |
| | | if (teamInviteRelation.getState() == null) { |
| | | teamInviteRelation.setState(TeamInviteRelation.STATE_VALID); |
| | | } |
| | | |
| | | if (teamInviteRelation.getCreateTime() == null) { |
| | | teamInviteRelation.setCreateTime(new Date()); |
| | | } |
| | | //保存 |
| | | teamInviteRelationMapper.insertSelective(teamInviteRelation); |
| | | } |
| | | |
| | | @Override |
| | | public void update(TeamInviteRelation teamInviteRelation) { |
| | | if (teamInviteRelation.getUpdateTime() == null) { |
| | | teamInviteRelation.setUpdateTime(new Date()); |
| | | } |
| | | //保存 |
| | | teamInviteRelationMapper.updateByPrimaryKey(teamInviteRelation); |
| | | } |
| | | |
| | | @Override |
| | | public void delete(List<Long> idList) { |
| | | for (Long id : idList) { |
| | | teamInviteRelationMapper.deleteByPrimaryKey(id); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public Long getBossUid(Long uid) { |
| | | DaoQuery daoQuery = new DaoQuery(); |
| | | daoQuery.targetUid = uid; |
| | | daoQuery.state = TeamInviteRelation.STATE_VALID; |
| | | daoQuery.count = 1; |
| | | List<TeamInviteRelation> list = teamInviteRelationMapper.list(daoQuery); |
| | | if (list == null || list.size() == 0) { |
| | | return null; |
| | | } |
| | | return list.get(0).getUid(); |
| | | } |
| | | |
| | | @Override |
| | | public List<TeamInviteRelation> getFirstTeamList(Long uid, int page, int pageSize) { |
| | | DaoQuery daoQuery = new DaoQuery(); |
| | | daoQuery.uid = uid; |
| | | daoQuery.state = TeamInviteRelation.STATE_VALID; |
| | | daoQuery.start = (page - 1) * pageSize; |
| | | daoQuery.count = pageSize; |
| | | return teamInviteRelationMapper.list(daoQuery); |
| | | } |
| | | |
| | | @Override |
| | | public long countFirstTeam(Long uid) { |
| | | DaoQuery daoQuery = new DaoQuery(); |
| | | daoQuery.uid = uid; |
| | | daoQuery.state = TeamInviteRelation.STATE_VALID; |
| | | return teamInviteRelationMapper.count(daoQuery); |
| | | } |
| | | |
| | | @Override |
| | | public List<TeamInviteRelation> getSecondTeamList(Long uid, int page, int pageSize) { |
| | | return teamInviteRelationMapper.listSecondTeam(uid, (page - 1) * pageSize, pageSize); |
| | | } |
| | | |
| | | @Override |
| | | public long countSecondTeam(Long uid) { |
| | | return teamInviteRelationMapper.countSecondTeam(uid); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | import java.lang.Exception; |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | |
| | | import com.yeshi.makemoney.app.exception.goldcorn.GoldCornConsumeRecordException; |
| | | import org.yeshi.utils.bean.BeanUtil; |
| | | import java.util.List; |
| | | import com.yeshi.makemoney.app.entity.goldcorn.GoldCornConsumeRecord; |
| | |
| | | /** |
| | | * |
| | | */ |
| | | public void add(GoldCornConsumeRecord goldCornConsumeRecord) throws Exception; |
| | | public void add(GoldCornConsumeRecord goldCornConsumeRecord) throws GoldCornConsumeRecordException; |
| | | |
| | | /** |
| | | * |
| | |
| | | import java.lang.Exception; |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | |
| | | 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.GoldCornGetFrequencyConfig; |
| | | import com.yeshi.makemoney.app.service.inter.goldcorn.GoldCornGetFrequencyConfigService; |
| | | import com.yeshi.makemoney.app.service.query.goldcorn.GoldCornGetFrequencyConfigQuery; |
| | |
| | | public interface GoldCornGetFrequencyConfigService { |
| | | |
| | | /** |
| | | * 获取列表 |
| | | * @param goldCornGetFrequencyConfigQuery |
| | | * @param page |
| | | * @param pageSize |
| | | * @return |
| | | */ |
| | | public List<GoldCornGetFrequencyConfig> list(GoldCornGetFrequencyConfigQuery goldCornGetFrequencyConfigQuery, int page, int pageSize) ; |
| | | * 获取列表 |
| | | * |
| | | * @param goldCornGetFrequencyConfigQuery |
| | | * @param page |
| | | * @param pageSize |
| | | * @return |
| | | */ |
| | | public List<GoldCornGetFrequencyConfig> list(GoldCornGetFrequencyConfigQuery goldCornGetFrequencyConfigQuery, int page, int pageSize); |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | public long count(GoldCornGetFrequencyConfigQuery goldCornGetFrequencyConfigQuery) ; |
| | | * |
| | | */ |
| | | public long count(GoldCornGetFrequencyConfigQuery goldCornGetFrequencyConfigQuery); |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | public GoldCornGetFrequencyConfig get(String id) ; |
| | | * |
| | | */ |
| | | public GoldCornGetFrequencyConfig get(String id); |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | public void add(GoldCornGetFrequencyConfig goldCornGetFrequencyConfig) throws Exception; |
| | | * |
| | | */ |
| | | public void add(GoldCornGetFrequencyConfig goldCornGetFrequencyConfig) throws Exception; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | public void update(GoldCornGetFrequencyConfig goldCornGetFrequencyConfig) ; |
| | | * |
| | | */ |
| | | public void update(GoldCornGetFrequencyConfig goldCornGetFrequencyConfig); |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | public void delete(List<String> idList) ; |
| | | * |
| | | */ |
| | | public void delete(List<String> idList); |
| | | |
| | | |
| | | /** |
| | | * @return com.yeshi.makemoney.app.entity.goldcorn.GoldCornGetFrequencyConfig |
| | | * @author hxh |
| | | * @description 获取某个时间点的频率配置信息 |
| | | * @date 17:15 2022/4/6 |
| | | * @param: system |
| | | * @param: type |
| | | * @param: time |
| | | **/ |
| | | public GoldCornGetFrequencyConfig getConfig(SystemEnum system, GoldCornGetType type, Date time); |
| | | |
| | | |
| | | } |
| | |
| | | import java.lang.Exception; |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | |
| | | 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; |
| | |
| | | */ |
| | | public void delete(List<String> idList) ; |
| | | |
| | | /** |
| | | * @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); |
| | | |
| | | |
| | | } |
| | |
| | | import java.lang.Exception; |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | |
| | | import com.yeshi.makemoney.app.exception.goldcorn.GoldCornGetRecordException; |
| | | import org.yeshi.utils.bean.BeanUtil; |
| | | |
| | | 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; |
| | |
| | | public interface GoldCornGetRecordService { |
| | | |
| | | /** |
| | | * 获取列表 |
| | | * @param goldCornGetRecordQuery |
| | | * @param page |
| | | * @param pageSize |
| | | * @return |
| | | */ |
| | | public List<GoldCornGetRecord> list(GoldCornGetRecordQuery goldCornGetRecordQuery, int page, int pageSize) ; |
| | | * 获取列表 |
| | | * |
| | | * @param goldCornGetRecordQuery |
| | | * @param page |
| | | * @param pageSize |
| | | * @return |
| | | */ |
| | | public List<GoldCornGetRecord> list(GoldCornGetRecordQuery goldCornGetRecordQuery, int page, int pageSize); |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | public long count(GoldCornGetRecordQuery goldCornGetRecordQuery) ; |
| | | * |
| | | */ |
| | | public long count(GoldCornGetRecordQuery goldCornGetRecordQuery); |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | public GoldCornGetRecord get(String id) ; |
| | | * |
| | | */ |
| | | public GoldCornGetRecord get(String id); |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | public void add(GoldCornGetRecord goldCornGetRecord) throws Exception; |
| | | * |
| | | */ |
| | | public void add(GoldCornGetRecord goldCornGetRecord) throws GoldCornGetRecordException; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | public void update(GoldCornGetRecord goldCornGetRecord) ; |
| | | * |
| | | */ |
| | | public void update(GoldCornGetRecord goldCornGetRecord); |
| | | |
| | | |
| | | public Long getGoldCornByDay(Long uid, String day); |
| | | |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | public void delete(List<String> idList) ; |
| | | * @return java.util.List<java.lang.Long> |
| | | * @author hxh |
| | | * @description 根据日期获取用户ID集合 |
| | | * @date 11:18 2022/4/7 |
| | | * @param: day |
| | | **/ |
| | | public List<Long> getUidsByDay(String day, int page, int pageSize); |
| | | |
| | | |
| | | public long countUidsByDay(String day); |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.yeshi.makemoney.app.service.inter.goldcorn; |
| | | |
| | | import com.yeshi.makemoney.app.entity.goldcorn.GoldCornGetType; |
| | | import com.yeshi.makemoney.app.exception.goldcorn.GoldCornGetFrequencyConfigException; |
| | | import com.yeshi.makemoney.app.exception.goldcorn.GoldCornGetPriceException; |
| | | import com.yeshi.makemoney.app.exception.goldcorn.GoldCornGetRecordException; |
| | | import com.yeshi.makemoney.app.exception.goldcorn.GoldCornMakeException; |
| | | import com.yeshi.makemoney.app.exception.user.UserInfoException; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author hxh |
| | | * @title: GoldCornGetService |
| | | * @description:赚取金币服务 |
| | | * @date 2022/4/6 16:53 |
| | | */ |
| | | public interface GoldCornMakeService { |
| | | |
| | | /** |
| | | * @return void |
| | | * @author hxh |
| | | * @description 添加金币 |
| | | * @date 16:55 2022/4/6 |
| | | * @param: uid 用户ID |
| | | * @param: type 类型 |
| | | * @param: time 发生时间 |
| | | **/ |
| | | public void addGoldCorn(Long uid, GoldCornGetType type, Date time) throws UserInfoException, GoldCornGetPriceException, GoldCornGetFrequencyConfigException, GoldCornMakeException; |
| | | |
| | | |
| | | /** |
| | | * @return java.lang.Long |
| | | * @author hxh |
| | | * @description 根据日期计算金币 |
| | | * @date 18:43 2022/4/6 |
| | | * @param: uid |
| | | * @param: day |
| | | **/ |
| | | public Long getGoldCornByDay(Long uid, String day); |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | import java.lang.Exception; |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | import com.ks.lib.common.exception.ParamsException; |
| | | import com.yeshi.makemoney.app.entity.SystemEnum; |
| | | import org.yeshi.utils.bean.BeanUtil; |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.yeshi.makemoney.app.entity.goldcorn.GoldCornMoneyExchangeRateRecord; |
| | | import com.yeshi.makemoney.app.service.inter.goldcorn.GoldCornMoneyExchangeRateRecordService; |
| | | import com.yeshi.makemoney.app.service.query.goldcorn.GoldCornMoneyExchangeRateRecordQuery; |
| | |
| | | public interface GoldCornMoneyExchangeRateRecordService { |
| | | |
| | | /** |
| | | * 获取列表 |
| | | * @param goldCornMoneyExchangeRateRecordQuery |
| | | * @param page |
| | | * @param pageSize |
| | | * @return |
| | | */ |
| | | public List<GoldCornMoneyExchangeRateRecord> list(GoldCornMoneyExchangeRateRecordQuery goldCornMoneyExchangeRateRecordQuery, int page, int pageSize) ; |
| | | * 获取列表 |
| | | * |
| | | * @param goldCornMoneyExchangeRateRecordQuery |
| | | * @param page |
| | | * @param pageSize |
| | | * @return |
| | | */ |
| | | public List<GoldCornMoneyExchangeRateRecord> list(GoldCornMoneyExchangeRateRecordQuery goldCornMoneyExchangeRateRecordQuery, int page, int pageSize); |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | public long count(GoldCornMoneyExchangeRateRecordQuery goldCornMoneyExchangeRateRecordQuery) ; |
| | | * |
| | | */ |
| | | public long count(GoldCornMoneyExchangeRateRecordQuery goldCornMoneyExchangeRateRecordQuery); |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | public GoldCornMoneyExchangeRateRecord get(String id) ; |
| | | * |
| | | */ |
| | | public GoldCornMoneyExchangeRateRecord get(String id); |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | public void add(GoldCornMoneyExchangeRateRecord goldCornMoneyExchangeRateRecord) throws Exception; |
| | | * |
| | | */ |
| | | public void add(GoldCornMoneyExchangeRateRecord goldCornMoneyExchangeRateRecord) throws Exception; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | public void update(GoldCornMoneyExchangeRateRecord goldCornMoneyExchangeRateRecord) ; |
| | | * |
| | | */ |
| | | public void update(GoldCornMoneyExchangeRateRecord goldCornMoneyExchangeRateRecord); |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | public void delete(List<String> idList) ; |
| | | * |
| | | */ |
| | | public void delete(List<String> idList); |
| | | |
| | | |
| | | /** |
| | | * @return BigDecimal |
| | | * @author hxh |
| | | * @description 获取汇率 |
| | | * @date 13:52 2022/4/7 |
| | | * @param: day |
| | | * @param system |
| | | * @param: time |
| | | **/ |
| | | public BigDecimal getRate(String day, SystemEnum system, Date time) throws ParamsException; |
| | | |
| | | } |
New file |
| | |
| | | package com.yeshi.makemoney.app.service.inter.goldcorn; |
| | | |
| | | import com.yeshi.makemoney.app.exception.goldcorn.GoldCornConsumeRecordException; |
| | | import com.yeshi.makemoney.app.exception.goldcorn.GoldCornMoneyExchangeRateRecordException; |
| | | import com.yeshi.makemoney.app.exception.money.UserMoneyRecordException; |
| | | import com.yeshi.makemoney.app.exception.user.UserInfoException; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * @author hxh |
| | | * @title: GoldCornSettleService |
| | | * @description: 金币结算服务 |
| | | * @date 2022/4/7 11:14 |
| | | */ |
| | | public interface GoldCornSettleService { |
| | | //获取结算的用户 |
| | | |
| | | /** |
| | | * @return void |
| | | * @author hxh |
| | | * @description 开始结算 |
| | | * @date 11:46 2022/4/7 |
| | | * @param: day |
| | | **/ |
| | | public void startSettle(String day); |
| | | |
| | | |
| | | /** |
| | | * @return void |
| | | * @author hxh |
| | | * @description 结算某个用户某天的资金 |
| | | * @date 11:47 2022/4/7 |
| | | * @param: uid |
| | | * @param: day |
| | | * @param: rate 汇率 |
| | | **/ |
| | | public void settle(Long uid, String day, BigDecimal rate) throws GoldCornConsumeRecordException, UserMoneyRecordException; |
| | | |
| | | |
| | | /** |
| | | * @return void |
| | | * @author hxh |
| | | * @description 结算某个用户某天的资金 |
| | | * @date 11:47 2022/4/7 |
| | | * @param: uid |
| | | * @param: day |
| | | **/ |
| | | public void settle(Long uid, String day) throws UserInfoException, GoldCornMoneyExchangeRateRecordException, UserMoneyRecordException, GoldCornConsumeRecordException; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.yeshi.makemoney.app.service.inter.msg; |
| | | |
| | | import java.lang.Exception; |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | import org.yeshi.utils.bean.BeanUtil; |
| | | import java.util.List; |
| | | import com.yeshi.makemoney.app.entity.msg.AppPageNotifyMsg; |
| | | import com.yeshi.makemoney.app.service.inter.msg.AppPageNotifyMsgService; |
| | | import com.yeshi.makemoney.app.service.query.msg.AppPageNotifyMsgQuery; |
| | | |
| | | |
| | | public interface AppPageNotifyMsgService { |
| | | |
| | | /** |
| | | * 获取列表 |
| | | * @param appPageNotifyMsgQuery |
| | | * @param page |
| | | * @param pageSize |
| | | * @return |
| | | */ |
| | | public List<AppPageNotifyMsg> list(AppPageNotifyMsgQuery appPageNotifyMsgQuery, int page, int pageSize) ; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | public long count(AppPageNotifyMsgQuery appPageNotifyMsgQuery) ; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | public AppPageNotifyMsg get(String id) ; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | public void add(AppPageNotifyMsg appPageNotifyMsg) throws Exception; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | public void update(AppPageNotifyMsg appPageNotifyMsg) ; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | public void delete(List<String> idList) ; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.yeshi.makemoney.app.service.inter.msg; |
| | | |
| | | import java.lang.Exception; |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | import org.yeshi.utils.bean.BeanUtil; |
| | | import java.util.List; |
| | | import com.yeshi.makemoney.app.entity.msg.UserMsg; |
| | | import com.yeshi.makemoney.app.service.inter.msg.UserMsgService; |
| | | import com.yeshi.makemoney.app.service.query.msg.UserMsgQuery; |
| | | |
| | | |
| | | public interface UserMsgService { |
| | | |
| | | /** |
| | | * 获取列表 |
| | | * @param userMsgQuery |
| | | * @param page |
| | | * @param pageSize |
| | | * @return |
| | | */ |
| | | public List<UserMsg> list(UserMsgQuery userMsgQuery, int page, int pageSize) ; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | public long count(UserMsgQuery userMsgQuery) ; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | public UserMsg get(String id) ; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | public void add(UserMsg userMsg) throws Exception; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | public void update(UserMsg userMsg) ; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | public void delete(List<String> idList) ; |
| | | |
| | | |
| | | } |
| | |
| | | import java.lang.Exception; |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | |
| | | import com.yeshi.makemoney.app.exception.team.TeamInviteRelationException; |
| | | import org.yeshi.utils.bean.BeanUtil; |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.yeshi.makemoney.app.entity.team.TeamInviteRelation; |
| | | import com.yeshi.makemoney.app.service.inter.team.TeamInviteRelationService; |
| | | import com.yeshi.makemoney.app.service.query.team.TeamInviteRelationQuery; |
| | |
| | | public interface TeamInviteRelationService { |
| | | |
| | | /** |
| | | * 获取列表 |
| | | * @param teamInviteRelationQuery |
| | | * @param page |
| | | * @param pageSize |
| | | * @return |
| | | */ |
| | | public List<TeamInviteRelation> list(TeamInviteRelationQuery teamInviteRelationQuery, int page, int pageSize) ; |
| | | * 获取列表 |
| | | * |
| | | * @param teamInviteRelationQuery |
| | | * @param page |
| | | * @param pageSize |
| | | * @return |
| | | */ |
| | | public List<TeamInviteRelation> list(TeamInviteRelationQuery teamInviteRelationQuery, int page, int pageSize); |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | public long count(TeamInviteRelationQuery teamInviteRelationQuery) ; |
| | | * |
| | | */ |
| | | public long count(TeamInviteRelationQuery teamInviteRelationQuery); |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | public TeamInviteRelation get(Long id) ; |
| | | * |
| | | */ |
| | | public TeamInviteRelation get(Long id); |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | public void add(TeamInviteRelation teamInviteRelation) throws Exception; |
| | | * |
| | | */ |
| | | public void add(TeamInviteRelation teamInviteRelation) throws TeamInviteRelationException; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | public void update(TeamInviteRelation teamInviteRelation) ; |
| | | * |
| | | */ |
| | | public void update(TeamInviteRelation teamInviteRelation); |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | public void delete(List<Long> idList) ; |
| | | * |
| | | */ |
| | | public void delete(List<Long> idList); |
| | | |
| | | /** |
| | | * @return java.lang.Long |
| | | * @author hxh |
| | | * @description 获取上家用户ID |
| | | * @date 16:00 2022/4/6 |
| | | * @param: uid |
| | | **/ |
| | | public Long getBossUid(Long uid); |
| | | |
| | | /** |
| | | * @return java.util.List<com.yeshi.makemoney.app.entity.team.TeamInviteRelation> |
| | | * @author hxh |
| | | * @description 获取第一级邀请关系 |
| | | * @date 16:08 2022/4/6 |
| | | * @param: uid |
| | | * @param: page |
| | | * @param: pageSize |
| | | **/ |
| | | public List<TeamInviteRelation> getFirstTeamList(Long uid, int page, int pageSize); |
| | | |
| | | public long countFirstTeam(Long uid); |
| | | |
| | | |
| | | /** |
| | | * @return java.util.List<com.yeshi.makemoney.app.entity.team.TeamInviteRelation> |
| | | * @author hxh |
| | | * @description 获取二级邀请关系 |
| | | * @date 16:09 2022/4/6 |
| | | * @param: uid |
| | | * @param: page |
| | | * @param: pageSize |
| | | **/ |
| | | public List<TeamInviteRelation> getSecondTeamList(Long uid, int page, int pageSize); |
| | | |
| | | public long countSecondTeam(Long uid); |
| | | |
| | | } |
New file |
| | |
| | | package com.yeshi.makemoney.app.service.query; |
| | | |
| | | import org.yeshi.utils.StringUtil; |
| | | import org.yeshi.utils.TimeUtil; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author hxh |
| | | * @title: BaseQuery |
| | | * @description: 基础查询条件 |
| | | * @date 2022/4/6 14:58 |
| | | */ |
| | | public class BaseQuery implements Serializable { |
| | | |
| | | private String startTime; |
| | | |
| | | private String endTime; |
| | | |
| | | private String format; |
| | | |
| | | |
| | | 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 Date toStartTime() { |
| | | if (StringUtil.isNullOrEmpty(startTime)) { |
| | | return null; |
| | | } |
| | | return new Date(TimeUtil.convertToTimeTemp(startTime, format == null ? "yyyy-MM-dd" : format)); |
| | | } |
| | | |
| | | |
| | | |
| | | public Date toEndTime() { |
| | | if (StringUtil.isNullOrEmpty(endTime)) { |
| | | return null; |
| | | } |
| | | return new Date(TimeUtil.convertToTimeTemp(endTime, format == null ? "yyyy-MM-dd" : format) + 1000 * 60 * 60 * 24L); |
| | | } |
| | | |
| | | |
| | | public String getFormat() { |
| | | return format; |
| | | } |
| | | |
| | | public void setFormat(String format) { |
| | | this.format = format; |
| | | } |
| | | } |
| | |
| | | package com.yeshi.makemoney.app.service.query.goldcorn; |
| | | |
| | | public class GoldCornConsumeRecordQuery { |
| | | //搜索关键词 |
| | | private String kw; |
| | | import com.yeshi.makemoney.app.entity.goldcorn.GoldCornConsumeType; |
| | | import com.yeshi.makemoney.app.service.query.BaseQuery; |
| | | |
| | | private String getKw(){ |
| | | return kw; |
| | | public class GoldCornConsumeRecordQuery extends BaseQuery { |
| | | |
| | | |
| | | private GoldCornConsumeType type; |
| | | |
| | | private Long uid; |
| | | |
| | | |
| | | public GoldCornConsumeType getType() { |
| | | return type; |
| | | } |
| | | |
| | | private void setKw(String kw){ |
| | | this.kw = kw; |
| | | public void setType(GoldCornConsumeType type) { |
| | | this.type = type; |
| | | } |
| | | |
| | | public Long getUid() { |
| | | return uid; |
| | | } |
| | | |
| | | public void setUid(Long uid) { |
| | | this.uid = uid; |
| | | } |
| | | } |
| | |
| | | package com.yeshi.makemoney.app.service.query.goldcorn; |
| | | |
| | | public class GoldCornGetFrequencyConfigQuery { |
| | | import com.yeshi.makemoney.app.entity.goldcorn.GoldCornGetType; |
| | | import com.yeshi.makemoney.app.service.query.BaseQuery; |
| | | |
| | | public class GoldCornGetFrequencyConfigQuery extends BaseQuery { |
| | | |
| | | |
| | | private GoldCornGetType type; |
| | | |
| | | //搜索关键词 |
| | | private String kw; |
| | | |
| | | private String getKw(){ |
| | | |
| | | public GoldCornGetType getType() { |
| | | return type; |
| | | } |
| | | |
| | | public void setType(GoldCornGetType type) { |
| | | this.type = type; |
| | | } |
| | | |
| | | public String getKw() { |
| | | return kw; |
| | | } |
| | | |
| | | private void setKw(String kw){ |
| | | public void setKw(String kw) { |
| | | this.kw = kw; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | package com.yeshi.makemoney.app.service.query.goldcorn; |
| | | |
| | | import com.yeshi.makemoney.app.entity.goldcorn.GoldCornGetType; |
| | | import com.yeshi.makemoney.app.service.query.BaseQuery; |
| | | |
| | | public class GoldCornGetPriceQuery { |
| | | public class GoldCornGetPriceQuery extends BaseQuery { |
| | | |
| | | private GoldCornGetType type; |
| | | |
| | | private String startTime; |
| | | |
| | | private String endTime; |
| | | |
| | | public GoldCornGetType getType() { |
| | | return type; |
| | |
| | | this.type = type; |
| | | } |
| | | |
| | | 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; |
| | | } |
| | | } |
| | |
| | | package com.yeshi.makemoney.app.service.query.goldcorn; |
| | | |
| | | import com.yeshi.makemoney.app.entity.goldcorn.GoldCornGetType; |
| | | import com.yeshi.makemoney.app.service.query.BaseQuery; |
| | | |
| | | public class GoldCornGetRecordQuery { |
| | | private String startTime; |
| | | private String endTime; |
| | | public class GoldCornGetRecordQuery extends BaseQuery { |
| | | private GoldCornGetType type; |
| | | private Long uid; |
| | | |
| | | |
| | | 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 GoldCornGetType getType() { |
| | | return type; |
| | |
| | | package com.yeshi.makemoney.app.service.query.money; |
| | | |
| | | public class ExtractQuery { |
| | | //搜索关键词 |
| | | private String kw; |
| | | import com.yeshi.makemoney.app.service.query.BaseQuery; |
| | | |
| | | private String getKw(){ |
| | | return kw; |
| | | public class ExtractQuery extends BaseQuery { |
| | | private Long uid; |
| | | |
| | | |
| | | public Long getUid() { |
| | | return uid; |
| | | } |
| | | |
| | | private void setKw(String kw){ |
| | | this.kw = kw; |
| | | public void setUid(Long uid) { |
| | | this.uid = uid; |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | package com.yeshi.makemoney.app.service.query.money; |
| | | |
| | | public class UserMoneyRecordQuery { |
| | | //搜索关键词 |
| | | private String kw; |
| | | import com.yeshi.makemoney.app.service.query.BaseQuery; |
| | | |
| | | private String getKw(){ |
| | | return kw; |
| | | public class UserMoneyRecordQuery extends BaseQuery { |
| | | private Long uid; |
| | | private Boolean add; |
| | | |
| | | |
| | | public Long getUid() { |
| | | return uid; |
| | | } |
| | | |
| | | private void setKw(String kw){ |
| | | this.kw = kw; |
| | | public void setUid(Long uid) { |
| | | this.uid = uid; |
| | | } |
| | | |
| | | public Boolean getAdd() { |
| | | return add; |
| | | } |
| | | |
| | | public void setAdd(Boolean add) { |
| | | this.add = add; |
| | | } |
| | | } |
New file |
| | |
| | | package com.yeshi.makemoney.app.service.query.msg; |
| | | |
| | | import com.yeshi.makemoney.app.entity.msg.AppPageNotifyMsg; |
| | | |
| | | public class AppPageNotifyMsgQuery { |
| | | |
| | | private AppPageNotifyMsg.AppPageNotifyMsgType type; |
| | | |
| | | //搜索关键词 |
| | | private String kw; |
| | | |
| | | public String getKw() { |
| | | return kw; |
| | | } |
| | | |
| | | public void setKw(String kw) { |
| | | this.kw = kw; |
| | | } |
| | | |
| | | public AppPageNotifyMsg.AppPageNotifyMsgType getType() { |
| | | return type; |
| | | } |
| | | |
| | | public void setType(AppPageNotifyMsg.AppPageNotifyMsgType type) { |
| | | this.type = type; |
| | | } |
| | | } |
New file |
| | |
| | | package com.yeshi.makemoney.app.service.query.msg; |
| | | |
| | | import com.yeshi.makemoney.app.entity.msg.UserMsgType; |
| | | import com.yeshi.makemoney.app.service.query.BaseQuery; |
| | | |
| | | public class UserMsgQuery extends BaseQuery { |
| | | |
| | | private UserMsgType type; |
| | | private Long uid; |
| | | |
| | | |
| | | public UserMsgType getType() { |
| | | return type; |
| | | } |
| | | |
| | | public void setType(UserMsgType type) { |
| | | this.type = type; |
| | | } |
| | | |
| | | public Long getUid() { |
| | | return uid; |
| | | } |
| | | |
| | | public void setUid(Long uid) { |
| | | this.uid = uid; |
| | | } |
| | | } |
| | |
| | | package com.yeshi.makemoney.app.service.query.team; |
| | | |
| | | public class TeamInviteRelationQuery { |
| | | import com.yeshi.makemoney.app.service.query.BaseQuery; |
| | | |
| | | public class TeamInviteRelationQuery extends BaseQuery { |
| | | //搜索关键词 |
| | | private String kw; |
| | | private Long uid; |
| | | |
| | | private String getKw(){ |
| | | return kw; |
| | | private Boolean boss; |
| | | |
| | | |
| | | public Long getUid() { |
| | | return uid; |
| | | } |
| | | |
| | | private void setKw(String kw){ |
| | | this.kw = kw; |
| | | public void setUid(Long uid) { |
| | | this.uid = uid; |
| | | } |
| | | |
| | | public Boolean getBoss() { |
| | | return boss; |
| | | } |
| | | |
| | | public void setBoss(Boolean boss) { |
| | | this.boss = boss; |
| | | } |
| | | } |
| | |
| | | package com.yeshi.makemoney.app.utils.factory; |
| | | |
| | | import com.ks.lib.common.exception.ParamsException; |
| | | import com.yeshi.makemoney.app.entity.goldcorn.GoldCornConsumeRecord; |
| | | import com.yeshi.makemoney.app.entity.money.Extract; |
| | | import com.yeshi.makemoney.app.entity.money.UserMoneyRecord; |
| | | import com.yeshi.makemoney.app.entity.money.UserMoneyType; |
| | | import com.yeshi.makemoney.app.entity.user.UserInfo; |
| | | import org.yeshi.utils.StringUtil; |
| | | |
| | | import java.math.BigDecimal; |
| | |
| | | } |
| | | |
| | | |
| | | public static UserMoneyRecord createGoldCornExchange(GoldCornConsumeRecord record) throws ParamsException { |
| | | if (record == null) { |
| | | throw new ParamsException(ParamsException.CODE_PARAMS_NOT_ENOUGH, "金币兑换记录不能为空"); |
| | | } |
| | | if (record.getId() == null) { |
| | | throw new ParamsException(ParamsException.CODE_PARAMS_NOT_ENOUGH, "金币兑换记录主键不能为空"); |
| | | } |
| | | if (record.getMoney() == null) { |
| | | throw new ParamsException(ParamsException.CODE_PARAMS_NOT_ENOUGH, "兑换金额不能为空"); |
| | | } |
| | | if (record.getUid() == null) { |
| | | throw new ParamsException(ParamsException.CODE_PARAMS_NOT_ENOUGH, "兑换用户不能为空"); |
| | | } |
| | | UserMoneyRecord detail = new UserMoneyRecord(); |
| | | detail.setCreateTime(new Date()); |
| | | detail.setSerialNo(UserMoneyType.goldCorn.name().toLowerCase() + "_" + record.getId()); |
| | | detail.setMoney(record.getMoney()); |
| | | detail.setType(UserMoneyType.goldCorn); |
| | | detail.setUpdateTime(new Date()); |
| | | detail.setUser(new UserInfo(record.getUid())); |
| | | detail.setShow(true); |
| | | detail.setAdd(true); |
| | | return detail; |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.yeshi.makemoney.app.utils.factory.msg; |
| | | |
| | | import com.yeshi.makemoney.app.entity.goldcorn.GoldCornConsumeRecord; |
| | | import com.yeshi.makemoney.app.entity.msg.UserMsg; |
| | | import com.yeshi.makemoney.app.entity.msg.UserMsgType; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author hxh |
| | | * @title: UserMsgFactory |
| | | * @description: 用户消息工厂 |
| | | * @date 2022/4/7 15:51 |
| | | */ |
| | | public class UserMsgFactory { |
| | | |
| | | /** |
| | | * @return com.yeshi.makemoney.app.entity.msg.UserMsg |
| | | * @author hxh |
| | | * @description 金币兑换 |
| | | * @date 16:02 2022/4/7 |
| | | * @param: record |
| | | * @param: balance |
| | | **/ |
| | | public static UserMsg createGoldCornExchange(GoldCornConsumeRecord record, BigDecimal balance) { |
| | | UserMsg userMsg = new UserMsg(); |
| | | userMsg.setType(UserMsgType.goldcornexchange); |
| | | userMsg.setUid(record.getUid()); |
| | | List<UserMsg.UserMsgItem> contentList = new ArrayList<>(); |
| | | contentList.add(new UserMsg.UserMsgItem("折算金币", record.getCornNum() + "")); |
| | | contentList.add(new UserMsg.UserMsgItem("折算金额", record.getMoney().toString() + "元")); |
| | | contentList.add(new UserMsg.UserMsgItem("账户余额", balance.toString() + "元")); |
| | | userMsg.setContentList(contentList); |
| | | return userMsg; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * @return com.yeshi.makemoney.app.entity.msg.UserMsg |
| | | * @author hxh |
| | | * @description 提现成功 |
| | | * @date 16:02 2022/4/7 |
| | | * @param: uid |
| | | * @param: money |
| | | **/ |
| | | public static UserMsg createExtractSuccess(Long uid, BigDecimal money) { |
| | | UserMsg userMsg = new UserMsg(); |
| | | userMsg.setType(UserMsgType.extract); |
| | | userMsg.setUid(uid); |
| | | List<UserMsg.UserMsgItem> contentList = new ArrayList<>(); |
| | | contentList.add(new UserMsg.UserMsgItem("提现金额", money.toString() + "元")); |
| | | contentList.add(new UserMsg.UserMsgItem("提现状态", "提现成功")); |
| | | userMsg.setContentList(contentList); |
| | | return userMsg; |
| | | } |
| | | |
| | | /** |
| | | * @return com.yeshi.makemoney.app.entity.msg.UserMsg |
| | | * @author hxh |
| | | * @description 提现失败 |
| | | * @date 16:02 2022/4/7 |
| | | * @param: uid |
| | | * @param: money |
| | | **/ |
| | | |
| | | public static UserMsg createExtractFail(Long uid, BigDecimal money) { |
| | | UserMsg userMsg = new UserMsg(); |
| | | userMsg.setType(UserMsgType.extract); |
| | | userMsg.setUid(uid); |
| | | List<UserMsg.UserMsgItem> contentList = new ArrayList<>(); |
| | | contentList.add(new UserMsg.UserMsgItem("提现金额", money.toString() + "元")); |
| | | contentList.add(new UserMsg.UserMsgItem("提现状态", "提现失败")); |
| | | userMsg.setContentList(contentList); |
| | | return userMsg; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * @return com.yeshi.makemoney.app.entity.msg.UserMsg |
| | | * @author hxh |
| | | * @description 创建系统消息 |
| | | * @date 16:02 2022/4/7 |
| | | * @param: uid |
| | | * @param: reason |
| | | * @param: operate |
| | | **/ |
| | | public static UserMsg createSystem(Long uid, String reason, String operate) { |
| | | UserMsg userMsg = new UserMsg(); |
| | | userMsg.setType(UserMsgType.system); |
| | | userMsg.setUid(uid); |
| | | List<UserMsg.UserMsgItem> contentList = new ArrayList<>(); |
| | | contentList.add(new UserMsg.UserMsgItem("事 由", reason)); |
| | | contentList.add(new UserMsg.UserMsgItem("处 理", operate)); |
| | | userMsg.setContentList(contentList); |
| | | return userMsg; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | package com.yeshi.makemoney.app.utils.mq; |
| | | |
| | | import com.alipay.api.response.AlipayFundTransUniTransferResponse; |
| | | import com.google.gson.Gson; |
| | | import com.qcloud.cmq.Message; |
| | | import com.yeshi.makemoney.app.dto.mq.AddGoldCornMQMsg; |
| | | import com.yeshi.makemoney.app.dto.mq.ExtractTransferResultMQMsg; |
| | | import com.yeshi.makemoney.app.entity.money.Extract; |
| | | import org.yeshi.utils.CMQUtil; |
| | | import com.yeshi.makemoney.app.dto.mq.GoldCornSettleMQMsg; |
| | | import org.yeshi.utils.StringUtil; |
| | | import org.yeshi.utils.mq.TDMQUtil; |
| | | |
| | |
| | | private static CMQManager cmqManager; |
| | | private static TDMQUtil tdmqUtil; |
| | | |
| | | public static String EXTRACT_RESULT = "makemoney-extract-result"; |
| | | public static String QUEUE_EXTRACT_RESULT = "makemoney-extract-result"; |
| | | |
| | | public static String QUEUE_ADD_GOLDCORN = "makemoney-add-goldcorn"; |
| | | |
| | | public static String QUEUE_GOLDCORN_SETTLE = "makemoney-goldcorn-settle"; |
| | | |
| | | static { |
| | | TDMQUtil.getInstance().init(secretId, secretKey, true); |
| | | tdmqUtil = TDMQUtil.getInstance(); |
| | | tdmqUtil.createQueue(EXTRACT_RESULT); |
| | | tdmqUtil.createQueue(QUEUE_EXTRACT_RESULT); |
| | | tdmqUtil.createQueue(QUEUE_ADD_GOLDCORN); |
| | | tdmqUtil.createQueue(QUEUE_GOLDCORN_SETTLE); |
| | | } |
| | | |
| | | public static CMQManager getInstance() { |
| | |
| | | */ |
| | | public void addExtractResultMsg(ExtractTransferResultMQMsg msg) { |
| | | String content = new Gson().toJson(msg); |
| | | tdmqUtil.sendMsg(EXTRACT_RESULT, content); |
| | | tdmqUtil.sendMsg(QUEUE_EXTRACT_RESULT, content); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | public Map<String, ExtractTransferResultMQMsg> consumeExtractResultMsg(int count) { |
| | | List<Message> list = tdmqUtil.recieveMsg(count, EXTRACT_RESULT); |
| | | List<Message> list = tdmqUtil.recieveMsg(count, QUEUE_EXTRACT_RESULT); |
| | | Map<String, ExtractTransferResultMQMsg> map = new HashMap<>(); |
| | | if (list != null) { |
| | | for (Message msg : list) { |
| | |
| | | * @param receiptHandle |
| | | */ |
| | | public void deleteExtractResultMsg(String receiptHandle) { |
| | | tdmqUtil.deleteMsg(EXTRACT_RESULT, receiptHandle); |
| | | tdmqUtil.deleteMsg(QUEUE_EXTRACT_RESULT, receiptHandle); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 添加金币 |
| | | **/ |
| | | |
| | | public void addAddGoldCornMsg(AddGoldCornMQMsg msg) { |
| | | String content = new Gson().toJson(msg); |
| | | tdmqUtil.sendMsg(QUEUE_ADD_GOLDCORN, content); |
| | | } |
| | | |
| | | public Map<String, AddGoldCornMQMsg> consumeAddGoldCornMsg(int count) { |
| | | List<Message> list = tdmqUtil.recieveMsg(count, QUEUE_ADD_GOLDCORN); |
| | | Map<String, AddGoldCornMQMsg> map = new HashMap<>(); |
| | | if (list != null) { |
| | | for (Message msg : list) { |
| | | String result = msg.msgBody; |
| | | if (!StringUtil.isNullOrEmpty(result)) { |
| | | AddGoldCornMQMsg resultMQMsg = new Gson().fromJson(result, |
| | | AddGoldCornMQMsg.class); |
| | | map.put(msg.receiptHandle, resultMQMsg); |
| | | } |
| | | } |
| | | } |
| | | return map; |
| | | } |
| | | |
| | | public void deleteAddGoldCornMsg(String receiptHandle) { |
| | | tdmqUtil.deleteMsg(QUEUE_ADD_GOLDCORN, receiptHandle); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 金币结算 |
| | | **/ |
| | | public void addGoldCornSettleMsg(GoldCornSettleMQMsg msg) { |
| | | String content = new Gson().toJson(msg); |
| | | tdmqUtil.sendMsg(QUEUE_GOLDCORN_SETTLE, content); |
| | | } |
| | | |
| | | public Map<String, GoldCornSettleMQMsg> consumeGoldCornSettleMsg(int count) { |
| | | List<Message> list = tdmqUtil.recieveMsg(count, QUEUE_GOLDCORN_SETTLE); |
| | | Map<String, GoldCornSettleMQMsg> map = new HashMap<>(); |
| | | if (list != null) { |
| | | for (Message msg : list) { |
| | | String result = msg.msgBody; |
| | | if (!StringUtil.isNullOrEmpty(result)) { |
| | | GoldCornSettleMQMsg resultMQMsg = new Gson().fromJson(result, |
| | | GoldCornSettleMQMsg.class); |
| | | map.put(msg.receiptHandle, resultMQMsg); |
| | | } |
| | | } |
| | | } |
| | | return map; |
| | | } |
| | | |
| | | public void deleteGoldCornSettleMsg(String receiptHandle) { |
| | | tdmqUtil.deleteMsg(QUEUE_GOLDCORN_SETTLE, receiptHandle); |
| | | } |
| | | |
| | | |
New file |
| | |
| | | package com.yeshi.makemoney.app.vo.admin.goldcorn; |
| | | |
| | | import com.yeshi.makemoney.app.entity.SystemEnum; |
| | | import com.yeshi.makemoney.app.entity.goldcorn.GoldCornGetFrequencyConfig; |
| | | import com.yeshi.makemoney.app.entity.goldcorn.GoldCornGetPrice; |
| | | import com.yeshi.makemoney.app.entity.goldcorn.GoldCornGetType; |
| | | import org.springframework.data.annotation.Id; |
| | | import org.springframework.data.mongodb.core.index.Indexed; |
| | | import org.yeshi.utils.TimeUtil; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author hxh |
| | | * @title: GoldCornGetPriceAdminVO |
| | | * @description: TODO |
| | | * @date 2022/4/2 17:42 |
| | | */ |
| | | public class GoldCornGetFrequencyAdminVO { |
| | | |
| | | private String id; |
| | | private SystemEnum system; |
| | | private GoldCornGetType type; |
| | | private Integer limitCount; |
| | | private GoldCornGetFrequencyConfig.GoldCornGetFrequencyTimeUnit timeUnit; |
| | | private String validateTime; |
| | | private String remarks; |
| | | private Long minSpaceTime; |
| | | |
| | | public GoldCornGetFrequencyConfig toEntity(SystemEnum system) { |
| | | GoldCornGetFrequencyConfig entity = new GoldCornGetFrequencyConfig(); |
| | | entity.setLimitCount(limitCount); |
| | | entity.setTimeUnit(timeUnit); |
| | | entity.setId(id); |
| | | entity.setRemarks(remarks); |
| | | entity.setSystem(system); |
| | | entity.setType(type); |
| | | entity.setMinSpaceTime(minSpaceTime); |
| | | entity.setValidateTime(new Date(TimeUtil.convertToTimeTemp(validateTime, "yyyy-MM-dd HH:mm:ss"))); |
| | | return entity; |
| | | } |
| | | |
| | | |
| | | public static GoldCornGetFrequencyAdminVO create(GoldCornGetFrequencyConfig entity) { |
| | | GoldCornGetFrequencyAdminVO vo = new GoldCornGetFrequencyAdminVO(); |
| | | vo.setLimitCount(entity.getLimitCount()); |
| | | vo.setId(entity.getId()); |
| | | vo.setRemarks(entity.getRemarks()); |
| | | vo.setType(entity.getType()); |
| | | vo.setTimeUnit(entity.getTimeUnit()); |
| | | vo.setMinSpaceTime(entity.getMinSpaceTime()); |
| | | vo.setValidateTime(TimeUtil.getGernalTime(entity.getValidateTime().getTime(), "yyyy-MM-dd HH:mm:ss")); |
| | | return vo; |
| | | } |
| | | |
| | | |
| | | public String getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(String id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public SystemEnum getSystem() { |
| | | return system; |
| | | } |
| | | |
| | | public void setSystem(SystemEnum system) { |
| | | this.system = system; |
| | | } |
| | | |
| | | public GoldCornGetType getType() { |
| | | return type; |
| | | } |
| | | |
| | | public void setType(GoldCornGetType type) { |
| | | this.type = type; |
| | | } |
| | | |
| | | public Integer getLimitCount() { |
| | | return limitCount; |
| | | } |
| | | |
| | | public void setLimitCount(Integer limitCount) { |
| | | this.limitCount = limitCount; |
| | | } |
| | | |
| | | public GoldCornGetFrequencyConfig.GoldCornGetFrequencyTimeUnit getTimeUnit() { |
| | | return timeUnit; |
| | | } |
| | | |
| | | public void setTimeUnit(GoldCornGetFrequencyConfig.GoldCornGetFrequencyTimeUnit timeUnit) { |
| | | this.timeUnit = timeUnit; |
| | | } |
| | | |
| | | public String getValidateTime() { |
| | | return validateTime; |
| | | } |
| | | |
| | | public void setValidateTime(String validateTime) { |
| | | this.validateTime = validateTime; |
| | | } |
| | | |
| | | public String getRemarks() { |
| | | return remarks; |
| | | } |
| | | |
| | | public void setRemarks(String remarks) { |
| | | this.remarks = remarks; |
| | | } |
| | | |
| | | public Long getMinSpaceTime() { |
| | | return minSpaceTime; |
| | | } |
| | | |
| | | public void setMinSpaceTime(Long minSpaceTime) { |
| | | this.minSpaceTime = minSpaceTime; |
| | | } |
| | | } |
New file |
| | |
| | | package com.yeshi.makemoney.app.vo.admin.msg; |
| | | |
| | | import com.yeshi.makemoney.app.entity.SystemEnum; |
| | | import com.yeshi.makemoney.app.entity.msg.AppPageNotifyMsg; |
| | | import org.yeshi.utils.TimeUtil; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author hxh |
| | | * @title: AppPageNotifyAdminVO |
| | | * @description: TODO |
| | | * @date 2022/4/7 17:15 |
| | | */ |
| | | public class AppPageNotifyAdminVO { |
| | | private String id; |
| | | private SystemEnum system; |
| | | private AppPageNotifyMsg.AppPageNotifyMsgType type; |
| | | private String show; |
| | | private String canClose; |
| | | private String content; |
| | | private String contentUrl; |
| | | private String md5; |
| | | private String startTime; |
| | | private String endTime; |
| | | |
| | | public AppPageNotifyMsg toEntity(SystemEnum system) { |
| | | AppPageNotifyMsg entity = new AppPageNotifyMsg(); |
| | | entity.setId(id); |
| | | entity.setCanClose("on".equalsIgnoreCase(canClose) ? true : false); |
| | | entity.setShow("on".equalsIgnoreCase(show) ? true : false); |
| | | entity.setContent(content); |
| | | entity.setContentUrl(contentUrl); |
| | | entity.setMd5(md5); |
| | | entity.setSystem(system); |
| | | entity.setType(type); |
| | | 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 AppPageNotifyAdminVO create(AppPageNotifyMsg entity) { |
| | | AppPageNotifyAdminVO vo = new AppPageNotifyAdminVO(); |
| | | vo.setId(entity.getId()); |
| | | vo.setCanClose(entity.getCanClose() ? "on" : null); |
| | | vo.setShow(entity.getShow() ? "on" : null); |
| | | vo.setContent(entity.getContent()); |
| | | vo.setContentUrl(entity.getContentUrl()); |
| | | vo.setMd5(entity.getMd5()); |
| | | vo.setSystem(entity.getSystem()); |
| | | vo.setType(entity.getType()); |
| | | 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")); |
| | | return vo; |
| | | } |
| | | |
| | | |
| | | public String getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(String id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public SystemEnum getSystem() { |
| | | return system; |
| | | } |
| | | |
| | | public void setSystem(SystemEnum system) { |
| | | this.system = system; |
| | | } |
| | | |
| | | public AppPageNotifyMsg.AppPageNotifyMsgType getType() { |
| | | return type; |
| | | } |
| | | |
| | | public void setType(AppPageNotifyMsg.AppPageNotifyMsgType type) { |
| | | this.type = type; |
| | | } |
| | | |
| | | public String getShow() { |
| | | return show; |
| | | } |
| | | |
| | | public void setShow(String show) { |
| | | this.show = show; |
| | | } |
| | | |
| | | public String getCanClose() { |
| | | return canClose; |
| | | } |
| | | |
| | | public void setCanClose(String canClose) { |
| | | this.canClose = canClose; |
| | | } |
| | | |
| | | public String getContent() { |
| | | return content; |
| | | } |
| | | |
| | | public void setContent(String content) { |
| | | this.content = content; |
| | | } |
| | | |
| | | public String getContentUrl() { |
| | | return contentUrl; |
| | | } |
| | | |
| | | public void setContentUrl(String contentUrl) { |
| | | this.contentUrl = contentUrl; |
| | | } |
| | | |
| | | public String getMd5() { |
| | | return md5; |
| | | } |
| | | |
| | | public void setMd5(String md5) { |
| | | this.md5 = md5; |
| | | } |
| | | |
| | | 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; |
| | | } |
| | | } |
| | |
| | | <?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.0.dtd"> |
| | | <generator-config class="com.yeshi.makemoney.app.entity.goldcorn.GoldCornMoneyExchangeRateRecord"> |
| | | "http://dtd.yeshitv.com/generator_code/1.3.dtd"> |
| | | <generator-config class="com.yeshi.makemoney.app.entity.msg.AppPageNotifyMsg"> |
| | | |
| | | <dao package="com.yeshi.makemoney.app.dao.goldcorn"> |
| | | <dao package="com.yeshi.makemoney.app.dao.msg"> |
| | | <queryList> |
| | | <query name="system" type="equal"/> |
| | | <query name="day" type="equal"/> |
| | | <query name="validateTime" type="equal"/> |
| | | <query name="type" type="equal"/> |
| | | <query name="show" type="equal"/> |
| | | <query name="content" type="contains"/> |
| | | </queryList> |
| | | </dao> |
| | | |
| | | <service interPackage="com.yeshi.makemoney.app.service.inter.goldcorn" |
| | | implPackage="com.yeshi.makemoney.app.service.impl.goldcorn" |
| | | queryPackage="com.yeshi.makemoney.app.service.query.goldcorn"> |
| | | <exception package="com.yeshi.makemoney.app.exception.goldcorn"></exception> |
| | | <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> |
| | | |
| | | <admin> |
| | | <controller package="com.yeshi.makemoney.app.controller.admin.goldcorn" |
| | | mapping="admin/api/goldcorn/exchangerate" |
| | | <controller package="com.yeshi.makemoney.app.controller.admin.msg" |
| | | mapping="/admin/api/msg/appnotify" |
| | | jsonp="false"> |
| | | </controller> |
| | | <pages title="金币兑换人民币汇率设置" |
| | | pageDir="D:/workspace/makemoney/server/MakeMoney/app/src/main/resources/static/goldcorn"> |
| | | <pages title="用户消息" |
| | | pageDir="D:/workspace/makemoney/server/MakeMoney/app/src/main/resources/static/msg"> |
| | | <list> |
| | | <searchForm> |
| | | <columns> |
| | | <column property="day" title="日期"> |
| | | <text inputType="DATE"></text> |
| | | <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> |
| | | </columns> |
| | | </searchForm> |
| | | <columns> |
| | | <column property="id" title="ID" showType="TEXT"></column> |
| | | <column property="day" title="日期" showType="TEXT"></column> |
| | | <column property="rate" title="汇率" showType="TEXT"></column> |
| | | <column property="validateTime" title="生效时间" showType="TEXT"></column> |
| | | <column property="type" title="消息类型" showType="TEXT"></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> |
| | | </columns> |
| | | </list> |
| | | |
| | | <add> |
| | | <column property="type" title="日期"> |
| | | <text inputType="DATE" dateFormat="yyyy-MM-dd"> |
| | | <verify type="date" require="true"></verify> |
| | | |
| | | <column property="type" title="消息类型"> |
| | | <select> |
| | | <api path="/admin/api/msg/appnotify/getMsgTypes"></api> |
| | | </select> |
| | | </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> |
| | | </text> |
| | | </column> |
| | | <column property="endTime" title="显示结束时间"> |
| | | <text inputType="DATETIME"> |
| | | <verify type="datetime"></verify> |
| | | </text> |
| | | </column> |
| | | |
| | | <column property="rate" title="汇率"> |
| | | <text inputType="TEXT" placeHolder="1金币兑换的人民币数量"> |
| | | <verify type="number" require="true"></verify> |
| | | </text> |
| | | </column> |
| | | |
| | | <column property="validateTime" title="汇率"> |
| | | <text inputType="DATETIME" placeHolder="生效时间" dateFormat="yyyy-MM-dd HH:mm"> |
| | | <verify type="date" require="true"></verify> |
| | | </text> |
| | | </column> |
| | | </add> |
| | | |
| | | <update> |
| | | <column property="type" title="日期"> |
| | | <text inputType="DATE" dateFormat="yyyy-MM-dd"> |
| | | <verify type="date" require="true"></verify> |
| | | </text> |
| | | <column property="type" title="消息类型"> |
| | | <select enable="false"> |
| | | <api path="/admin/api/msg/appnotify/getMsgTypes"></api> |
| | | </select> |
| | | </column> |
| | | <column property="show" title="是否显示"> |
| | | <switch></switch> |
| | | |
| | | </column> |
| | | <column property="canClose" title="是否可以关闭"> |
| | | <switch></switch> |
| | | </column> |
| | | |
| | | <column property="rate" title="汇率"> |
| | | <text inputType="TEXT" placeHolder="1金币兑换的人民币数量"> |
| | | <verify type="number" require="true"></verify> |
| | | <column property="content" title="内容"> |
| | | <text inputType="TEXT" maxLength="128"> |
| | | <verify type="none" require="true"></verify> |
| | | </text> |
| | | </column> |
| | | |
| | | <column property="validateTime" title="汇率"> |
| | | <text inputType="DATETIME" placeHolder="生效时间" dateFormat="yyyy-MM-dd HH:mm"> |
| | | <verify type="date" require="true"></verify> |
| | | <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> |
| | | </text> |
| | | </column> |
| | | <column property="endTime" title="显示结束时间"> |
| | | <text inputType="DATETIME"> |
| | | <verify type="datetime"></verify> |
| | | </text> |
| | | </column> |
| | | |
| | |
| | | <?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.0.dtd"> |
| | | <generator-config class="com.yeshi.makemoney.app.entity.goldcorn.GoldCornGetRecord"> |
| | | "http://dtd.yeshitv.com/generator_code/1.3.dtd"> |
| | | <generator-config class="com.yeshi.makemoney.app.entity.msg.UserMsg"> |
| | | |
| | | <dao package="com.yeshi.makemoney.app.dao.goldcorn"> |
| | | <dao package="com.yeshi.makemoney.app.dao.msg"> |
| | | <queryList> |
| | | <query name="uid" type="equal"/> |
| | | <query name="day" type="equal"/> |
| | | <query name="fromUid" type="equal"/> |
| | | <query name="fromId" type="equal"/> |
| | | <query name="type" type="equal"/> |
| | | <query name="createTime" type="equal"/> |
| | | </queryList> |
| | | </dao> |
| | | |
| | | <service interPackage="com.yeshi.makemoney.app.service.inter.goldcorn" |
| | | implPackage="com.yeshi.makemoney.app.service.impl.goldcorn" |
| | | queryPackage="com.yeshi.makemoney.app.service.query.goldcorn"> |
| | | <exception package="com.yeshi.makemoney.app.exception.goldcorn"></exception> |
| | | <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> |
| | | |
| | | <admin> |
| | | <controller package="com.yeshi.makemoney.app.controller.admin.goldcorn" mapping="admin/api/goldcorn/get/record" jsonp="false"> |
| | | <controller package="com.yeshi.makemoney.app.controller.admin.msg" |
| | | mapping="admin/api/msg/usermsg" |
| | | jsonp="false"> |
| | | </controller> |
| | | <pages title="金币获得记录" pageDir="D:/workspace/makemoney/server/MakeMoney/app/src/main/resources/static/goldcorn"> |
| | | <list edit="false" delete="false"> |
| | | <pages title="用户消息" |
| | | pageDir="D:/workspace/makemoney/server/MakeMoney/app/src/main/resources/static/msg"> |
| | | <list> |
| | | <searchForm> |
| | | <columns> |
| | | <column property="startTime" title="开始时间"> |
| | | <text inputType="DATE"></text> |
| | | </column> |
| | | |
| | | <column property="endTime" title="结束时间"> |
| | | <text inputType="DATE"></text> |
| | | </column> |
| | | |
| | | <column property="type" title="类型"> |
| | | <column property="type" title="消息类型"> |
| | | <select> |
| | | <api path="admin/api/goldcorn/get/record/getTypeList"> |
| | | <params> |
| | | <value key="test">1</value> |
| | | </params> |
| | | <api path="/admin/api/msg/usermsg/getMsgTypes"> |
| | | </api> |
| | | <verify type="none" require="true"></verify> |
| | | </select> |
| | | </column> |
| | | |
| | | <column property="kw" title="关键词"> |
| | | <column property="uid" title="用户ID"> |
| | | <text inputType="TEXT" placeHolder="请输入用户ID"></text> |
| | | </column> |
| | | |
| | | </columns> |
| | | </searchForm> |
| | | <columns> |
| | | <column property="id" title="ID" showType="TEXT"></column> |
| | | <column property="type" title="类型" showType="TEXT"></column> |
| | | <column property="cornNum" title="金币数量" showType="TEXT"></column> |
| | | <column property="fromUid" title="缘由用户ID" showType="TEXT"></column> |
| | | <column property="remarks" title="备注" 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> |
| | | </columns> |
| | | </list> |
| | | </pages> |
| | |
| | | |
| | | <sql id="Base_Column_List"> |
| | | <trim suffixOverrides=","> |
| | | id,uid,target_uid,state,create_time,update_time, |
| | | id,uid,target_uid,state,create_time,update_time, |
| | | </trim> |
| | | </sql> |
| | | |
| | |
| | | insert into mm_team_invite_relation |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">id,</if> |
| | | <if test="uid != null">uid,</if> |
| | | <if test="targetUid != null">target_uid,</if> |
| | | <if test="state != null">state,</if> |
| | | <if test="createTime != null">create_time,</if> |
| | | <if test="updateTime != null">update_time,</if> |
| | | <if test="uid != null">uid,</if> |
| | | <if test="targetUid != null">target_uid,</if> |
| | | <if test="state != null">state,</if> |
| | | <if test="createTime != null">create_time,</if> |
| | | <if test="updateTime != null">update_time,</if> |
| | | </trim> |
| | | values |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if> |
| | | <if test="uid != null">#{uid,jdbcType=BIGINT},</if> |
| | | <if test="targetUid != null">#{targetUid,jdbcType=BIGINT},</if> |
| | | <if test="state != null">#{state,jdbcType=INTEGER},</if> |
| | | <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="uid != null">#{uid,jdbcType=BIGINT},</if> |
| | | <if test="targetUid != null">#{targetUid,jdbcType=BIGINT},</if> |
| | | <if test="state != null">#{state,jdbcType=INTEGER},</if> |
| | | <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKey" |
| | |
| | | update mm_team_invite_relation |
| | | <set> |
| | | <if test="id != null">id = #{id,jdbcType=BIGINT},</if> |
| | | <if test="uid != null">uid = #{uid,jdbcType=BIGINT},</if> |
| | | <if test="targetUid != null">target_uid = #{targetUid,jdbcType=BIGINT},</if> |
| | | <if test="state != null">state = #{state,jdbcType=INTEGER},</if> |
| | | <if test="createTime != null">create_time = #{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updateTime != null">update_time = #{updateTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="uid != null">uid = #{uid,jdbcType=BIGINT},</if> |
| | | <if test="targetUid != null">target_uid = #{targetUid,jdbcType=BIGINT},</if> |
| | | <if test="state != null">state = #{state,jdbcType=INTEGER},</if> |
| | | <if test="createTime != null">create_time = #{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updateTime != null">update_time = #{updateTime,jdbcType=TIMESTAMP},</if> |
| | | </set> |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | |
| | | parameterType="com.yeshi.makemoney.app.entity.team.TeamInviteRelation"> |
| | | update mm_team_invite_relation |
| | | <set> |
| | | <if test="uid != null">uid = #{uid,jdbcType=BIGINT},</if> |
| | | <if test="targetUid != null">target_uid = #{targetUid,jdbcType=BIGINT},</if> |
| | | <if test="state != null">state = #{state,jdbcType=INTEGER},</if> |
| | | <if test="createTime != null">create_time = #{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updateTime != null">update_time = #{updateTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="uid != null">uid = #{uid,jdbcType=BIGINT},</if> |
| | | <if test="targetUid != null">target_uid = #{targetUid,jdbcType=BIGINT},</if> |
| | | <if test="state != null">state = #{state,jdbcType=INTEGER},</if> |
| | | <if test="createTime != null">create_time = #{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updateTime != null">update_time = #{updateTime,jdbcType=TIMESTAMP},</if> |
| | | </set> |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | |
| | | <sql id="listWhere"> |
| | | <if test="query.uid!=null"> |
| | | and uid = #{query.uid} |
| | | and uid = #{query.uid} |
| | | </if> |
| | | <if test="query.targetUid!=null"> |
| | | and target_uid = #{query.targetUid} |
| | | and target_uid = #{query.targetUid} |
| | | </if> |
| | | |
| | | <if test="query.tuid!=null"> |
| | | and (target_uid = #{query.tuid} or uid = #{query.tuid}) |
| | | </if> |
| | | |
| | | <if test="query.state!=null"> |
| | | and state = #{query.state} |
| | | and state = #{query.state} |
| | | </if> |
| | | <if test="query.maxCreateTime!=null"> |
| | | and create_time <![CDATA[<]]> #{query.maxCreateTime} |
| | | and create_time <![CDATA[<]]> #{query.maxCreateTime} |
| | | </if> |
| | | <if test="query.minCreateTime!=null"> |
| | | and create_time >= #{query.minCreateTime} |
| | | and create_time >= #{query.minCreateTime} |
| | | </if> |
| | | </sql> |
| | | |
| | | <select id="list" |
| | | resultMap="BaseResultMap"> |
| | | SELECT * FROM mm_team_invite_relation |
| | | SELECT * FROM mm_team_invite_relation |
| | | <where> |
| | | <include refid="listWhere"> |
| | | </include> |
| | | </where> |
| | | <if test="query.sortList!=null"> |
| | | <foreach collection="query.sortList" open=" order by " separator="," item="item"> |
| | | #{item} |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | limit #{query.start},#{query.count} |
| | |
| | | |
| | | <select id="count" |
| | | resultType="java.lang.Long"> |
| | | SELECT count(*) FROM mm_team_invite_relation |
| | | SELECT count(*) FROM mm_team_invite_relation |
| | | <where> |
| | | <include refid="listWhere"> |
| | | </include> |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="listSecondTeam" |
| | | resultMap="BaseResultMap"> |
| | | SELECT ir.* FROM mm_team_invite_relation ir |
| | | LEFT JOIN mm_team_invite_relation c ON ir.`uid`=c.`target_uid` |
| | | WHERE c.`uid`=#{uid} AND ir.`state`=1 AND c.`state`=1 |
| | | limit #{start},#{count} |
| | | </select> |
| | | |
| | | <select id="countSecondTeam" |
| | | resultType="java.lang.Long"> |
| | | SELECT count(*) FROM mm_team_invite_relation ir |
| | | LEFT JOIN mm_team_invite_relation c ON ir.`uid`=c.`target_uid` |
| | | WHERE c.`uid`=#{uid} AND ir.`state`=1 AND c.`state`=1 |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | <result column="type" property="type" jdbcType="VARCHAR"/> |
| | | <result column="serial_no" property="serialNo" jdbcType="VARCHAR"/> |
| | | <result column="money" property="money" jdbcType="DECIMAL"/> |
| | | <result column="add" property="add" jdbcType="BOOLEAN"/> |
| | | <result column="`add`" property="add" jdbcType="BOOLEAN"/> |
| | | <result column="show" property="show" jdbcType="BOOLEAN"/> |
| | | <result column="remarks" property="remarks" jdbcType="VARCHAR"/> |
| | | <result column="create_time" property="createTime" jdbcType="TIMESTAMP"/> |
| | |
| | | |
| | | <sql id="Base_Column_List"> |
| | | <trim suffixOverrides=","> |
| | | id,uid,type,serial_no,money,add,show,remarks,create_time,update_time, |
| | | id,uid,`type`,serial_no,money,`add`,show,remarks,create_time,update_time, |
| | | </trim> |
| | | </sql> |
| | | |
| | |
| | | mm_user_money_record |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | uid, |
| | | type, |
| | | `type`, |
| | | serial_no, |
| | | money, |
| | | add, |
| | | `add`, |
| | | show, |
| | | remarks, |
| | | create_time, |
| | |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">id,</if> |
| | | <if test="user != null">uid,</if> |
| | | <if test="type != null">type,</if> |
| | | <if test="type != null">`type`,</if> |
| | | <if test="serialNo != null">serial_no,</if> |
| | | <if test="money != null">money,</if> |
| | | <if test="add != null">add,</if> |
| | | <if test="add != null">`add`,</if> |
| | | <if test="show != null">show,</if> |
| | | <if test="remarks != null">remarks,</if> |
| | | <if test="createTime != null">create_time,</if> |
| | |
| | | <set> |
| | | <if test="id != null">id = #{id,jdbcType=BIGINT},</if> |
| | | <if test="user != null">uid = #{user.id,jdbcType=BIGINT},</if> |
| | | <if test="type != null">type = #{type,jdbcType=VARCHAR},</if> |
| | | <if test="type != null">`type` = #{type,jdbcType=VARCHAR},</if> |
| | | <if test="serialNo != null">serial_no = #{serialNo,jdbcType=VARCHAR},</if> |
| | | <if test="money != null">money = #{money,jdbcType=DECIMAL},</if> |
| | | <if test="add != null">add = #{add,jdbcType=BOOLEAN},</if> |
| | | <if test="add != null">`add` = #{add,jdbcType=BOOLEAN},</if> |
| | | <if test="show != null">show = #{show,jdbcType=BOOLEAN},</if> |
| | | <if test="remarks != null">remarks = #{remarks,jdbcType=VARCHAR},</if> |
| | | <if test="createTime != null">create_time = #{createTime,jdbcType=TIMESTAMP},</if> |
| | |
| | | update mm_user_money_record |
| | | <set> |
| | | <if test="user != null">uid = #{user.id,jdbcType=BIGINT},</if> |
| | | <if test="type != null">type = #{type,jdbcType=VARCHAR},</if> |
| | | <if test="type != null">`type` = #{type,jdbcType=VARCHAR},</if> |
| | | <if test="serialNo != null">serial_no = #{serialNo,jdbcType=VARCHAR},</if> |
| | | <if test="money != null">money = #{money,jdbcType=DECIMAL},</if> |
| | | <if test="add != null">add = #{add,jdbcType=BOOLEAN},</if> |
| | | <if test="add != null">`add` = #{add,jdbcType=BOOLEAN},</if> |
| | | <if test="show != null">show = #{show,jdbcType=BOOLEAN},</if> |
| | | <if test="remarks != null">remarks = #{remarks,jdbcType=VARCHAR},</if> |
| | | <if test="createTime != null">create_time = #{createTime,jdbcType=TIMESTAMP},</if> |
| | |
| | | and uid = #{query.uid} |
| | | </if> |
| | | <if test="query.type!=null"> |
| | | and type = #{query.type} |
| | | and `type` = #{query.type} |
| | | </if> |
| | | <if test="query.serialNo!=null"> |
| | | and serial_no = #{query.serialNo} |
| | | </if> |
| | | <if test="query.add!=null"> |
| | | and add = #{query.add} |
| | | and `add` = #{query.add} |
| | | </if> |
| | | <if test="query.show!=null"> |
| | | and show = #{query.show} |
| | |
| | | <label for="L_appCode" class="layui-form-label"> |
| | | 备注</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" name="remarks" lay-verify="" placeholder="" autocomplete="off" |
| | | class="layui-input"> |
| | | <textarea type="text" name="remarks" lay-verify="" placeholder="" autocomplete="off" rows="5" |
| | | class="layui-textarea"></textarea> |
| | | </div> |
| | | |
| | | </div> |
| | |
| | | <label for="L_appCode" class="layui-form-label"> |
| | | 备注</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" name="remarks" lay-verify="" placeholder="" autocomplete="off" |
| | | class="layui-input"> |
| | | <textarea type="text" name="remarks" lay-verify="" placeholder="" autocomplete="off" rows="5" |
| | | class="layui-textarea"></textarea> |
| | | </div> |
| | | |
| | | </div> |
| | |
| | | body.index { |
| | | background: linear-gradient(to left, rgba(221, 52, 52, 1), rgba(235, 170, 170, 1)) !important; |
| | | /*background: linear-gradient(to left, rgba(221, 52, 52, 1), rgba(235, 170, 170, 1)) !important;*/ |
| | | } |
| | | |
| | | .container { |
| | |
| | | class="layui-input"> |
| | | </div> |
| | | <div class="layui-inline layui-show-xs-block"> |
| | | <select name="type" lay-verify="required"> |
| | | <select name="type"> |
| | | </select> </div> |
| | | <div class="layui-inline layui-show-xs-block"> |
| | | <input type="text" name="kw" lay-verify="" placeholder="请输入用户ID" autocomplete="off" |
| | | <input type="text" name="uid" lay-verify="" placeholder="请输入用户ID" autocomplete="off" |
| | | class="layui-input"> |
| | | </div> |
| | | <div class="layui-inline layui-show-xs-block"> |
| | |
| | | var laydate = layui.laydate, |
| | | form = layui.form, |
| | | table = layui.table; |
| | | //渲染日期输入框 |
| | | laydate.render({ |
| | | elem: "intput[name=startTime]" //指定元素 |
| | | }); |
| | | laydate.render({ |
| | | elem: "intput[name=endTime]" //指定元素 |
| | | }); |
| | | |
| | | //搜索条件 |
| | | form.on('submit(search)', function (data) { |
| | | app.search(data.field); |
| | |
| | | if (res.code == 0) { |
| | | //填充数据 |
| | | $("select[name=type]").empty(); |
| | | $("select[name=type]").append("<option value=''>请选择类型</option>"); |
| | | for (var i = 0; i < res.data.length; i++) { |
| | | var html = "<option value='" + res.data[i].key + "'>"; |
| | | html += res.data[i].value + "</option>"; |
| | |
| | | }); |
| | | }, |
| | | search: function (params) { |
| | | if(params["startTime"].length==0){ |
| | | delete params["startTime"]; |
| | | } |
| | | if(params["endTime"].length==0){ |
| | | delete params["endTime"]; |
| | | } |
| | | if(params["type"].length==0){ |
| | | delete params["type"]; |
| | | } |
| | | if(params["uid"].length==0){ |
| | | delete params["uid"]; |
| | | } |
| | | //数据重载 |
| | | tableIns.reload({ |
| | | where: params, |
| | |
| | | <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> |
| | | <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]> |
| | |
| | | <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"> |
| | | <select name="type" lay-verify="required"> |
| | | </select> </div> |
| | | <div class="layui-form-item"> |
| | | <label for="L_appCode" class="layui-form-label"> |
| | | 类型</label> |
| | | <div class="layui-input-block"> |
| | | <select name="type" lay-verify="required"> |
| | | </select></div> |
| | | |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label for="L_appCode" class="layui-form-label"> |
| | | 限制时间单位</label> |
| | | <div class="layui-input-block"> |
| | | <select name="timeUnit" lay-verify="required"> |
| | | </select> </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label for="L_appCode" class="layui-form-label"> |
| | | 限制时间单位</label> |
| | | <div class="layui-input-block"> |
| | | <select name="timeUnit" lay-verify="required"> |
| | | </select></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="limitCount" lay-verify="required|number" placeholder="请输入整数" |
| | | autocomplete="off" |
| | | class="layui-input"> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label for="L_appCode" class="layui-form-label"> |
| | | <span class="x-red">*</span> |
| | | 限制次数</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" name="limitCount" 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="datetime" name="validateTime" lay-verify="required|date" placeholder="请选择生效时间" autocomplete="off" |
| | | class="layui-input"> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label for="L_appCode" class="layui-form-label"> |
| | | 备注</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" name="remarks" lay-verify="" placeholder="" autocomplete="off" |
| | | class="layui-input"> |
| | | </div> |
| | | |
| | | <div class="layui-form-item"> |
| | | <label for="L_appCode" class="layui-form-label"> |
| | | <span class="x-red">*</span> |
| | | 最小间隔时间(秒)</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" name="minSpaceTime" 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="datetime" name="validateTime" 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"> |
| | | <textarea type="text" name="remarks" lay-verify="" placeholder="" autocomplete="off" rows="5" |
| | | class="layui-textarea"></textarea> |
| | | </div> |
| | | |
| | | </div> |
| | | |
| | | <div class="layui-form-item"> |
| | | <label for="L_remarks" class="layui-form-label"></label> |
| | |
| | | </script> |
| | | |
| | | <script> |
| | | layui.use(['form', 'layer', 'jquery', 'upload'], function () { |
| | | layui.use(['form', 'layer', 'jquery', 'upload', 'laydate'], function () { |
| | | $ = layui.jquery; |
| | | var form = layui.form, |
| | | layer = layui.layer, |
| | | upload = layui.upload; |
| | | layer = layui.layer, |
| | | upload = layui.upload, |
| | | laydate = layui.laydate; |
| | | |
| | | var verify = {}; |
| | | //自定义验证规则 |
| | |
| | | //渲染上传控件 |
| | | uploadTool.init(upload); |
| | | |
| | | laydate.render({ |
| | | elem: 'input[type=datetime]' |
| | | , 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; |
| | | 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 |
| | | ksapp.post('/admin/api/goldcorn/get/config/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); |
| | | } |
| | | } |
| | | uploadTool.upload(function () { |
| | | //发异步,把数据提交给php |
| | | ksapp.post('/admin/api/goldcorn/getfrequency/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) { |
| | | }); |
| | | }, function (res) { |
| | | }); |
| | | return false; |
| | | }); |
| | | return false; |
| | | }); |
| | | //请求select的数据API |
| | | var params = {}; |
| | | var params = {}; |
| | | |
| | | ksapp.postJSON('/admin/api/goldcorn/get/config/getTypes', params, function (res) { |
| | | if (res.code == 0) { |
| | | //填充数据 |
| | | $("select[name=type]").empty(); |
| | | for (var i = 0; i < res.data.length; i++) { |
| | | var html = "<option value='" + res.data[i].key + "'>"; |
| | | html += res.data[i].value + "</option>"; |
| | | $("select[name=type]").append(html); |
| | | } |
| | | //重新渲染表单 |
| | | form.render(); |
| | | } else { |
| | | layer.msg(res.msg); |
| | | } |
| | | ksapp.postJSON('/admin/api/goldcorn/price/getPriceTypes', params, function (res) { |
| | | if (res.code == 0) { |
| | | //填充数据 |
| | | $("select[name=type]").empty(); |
| | | for (var i = 0; i < res.data.length; i++) { |
| | | var html = "<option value='" + res.data[i].key + "'>"; |
| | | html += res.data[i].value + "</option>"; |
| | | $("select[name=type]").append(html); |
| | | } |
| | | //重新渲染表单 |
| | | form.render(); |
| | | } else { |
| | | layer.msg(res.msg); |
| | | } |
| | | |
| | | }, function (res) { |
| | | }); |
| | | var params = {}; |
| | | }, function (res) { |
| | | }); |
| | | var params = {}; |
| | | |
| | | ksapp.postJSON('/admin/api/goldcorn/get/config/getTimeUnits', params, function (res) { |
| | | if (res.code == 0) { |
| | | //填充数据 |
| | | $("select[name=timeUnit]").empty(); |
| | | for (var i = 0; i < res.data.length; i++) { |
| | | var html = "<option value='" + res.data[i].key + "'>"; |
| | | html += res.data[i].value + "</option>"; |
| | | $("select[name=timeUnit]").append(html); |
| | | } |
| | | //重新渲染表单 |
| | | form.render(); |
| | | } else { |
| | | layer.msg(res.msg); |
| | | } |
| | | ksapp.postJSON('/admin/api/goldcorn/getfrequency/getTimeUnits', params, function (res) { |
| | | if (res.code == 0) { |
| | | //填充数据 |
| | | $("select[name=timeUnit]").empty(); |
| | | for (var i = 0; i < res.data.length; i++) { |
| | | var html = "<option value='" + res.data[i].key + "'>"; |
| | | html += res.data[i].value + "</option>"; |
| | | $("select[name=timeUnit]").append(html); |
| | | } |
| | | //重新渲染表单 |
| | | form.render(); |
| | | } else { |
| | | layer.msg(res.msg); |
| | | } |
| | | |
| | | }, function (res) { |
| | | }); |
| | | }, function (res) { |
| | | }); |
| | | }) |
| | | ; |
| | | </script> |
| | |
| | | <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> |
| | | <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> |
| | | <script src="../js/utils.js"></script> |
| | | </head> |
| | | |
| | | <body> |
| | |
| | | <div class="layui-card-body"> |
| | | <form class="layui-form layui-col-space5"> |
| | | <div class="layui-inline layui-show-xs-block"> |
| | | <input type="date" name="startTime" lay-verify="" placeholder="" autocomplete="off" |
| | | class="layui-input"> |
| | | <input type="date" name="startTime" lay-verify="" placeholder="" autocomplete="off" |
| | | class="layui-input"> |
| | | </div> |
| | | <div class="layui-inline layui-show-xs-block"> |
| | | <input type="date" name="endTime" lay-verify="" placeholder="" autocomplete="off" |
| | | class="layui-input"> |
| | | <input type="date" name="endTime" lay-verify="" placeholder="" autocomplete="off" |
| | | class="layui-input"> |
| | | </div> |
| | | <div class="layui-inline layui-show-xs-block"> |
| | | <input type="text" name="kw" lay-verify="" placeholder="请输入用户ID" autocomplete="off" |
| | | class="layui-input"> |
| | | <select name="type"> |
| | | </select></div> |
| | | <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"> |
| | |
| | | </body> |
| | | <script type="text/html" id="toolbar"> |
| | | <div class="layui-btn-container"> |
| | | <button class="layui-btn" onclick="xadmin.open('添加金币获得频率设置','goldcorngetfrequencyconfig_add.html',500,580)"><i |
| | | class="layui-icon"></i>添加 |
| | | <button class="layui-btn" onclick="xadmin.open('添加金币获得频率设置','gold_corn_get_frequency_config_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> |
| | |
| | | |
| | | <script type="text/html" id="optContainer"> |
| | | <div class="layui-btn-container"> |
| | | <a title="修改" onclick="xadmin.open('修改金币获得频率设置','goldcorngetfrequencyconfig_update.html?id={{d.id}}',500,580)" href="javascript:;"> |
| | | <a title="修改" |
| | | onclick="xadmin.open('修改金币获得频率设置','gold_corn_get_frequency_config_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:;"> |
| | |
| | | |
| | | <script type="text/html" id="imgshow"> |
| | | <!-- 这里的checked的状态只是演示 --> |
| | | <img src="{{d.}}"/> |
| | | <img src="{{d.}}"/> |
| | | <input type="checkbox" name="sex" value="{{d.id}}" lay-skin="switch" lay-text="女|男" lay-filter="sexDemo" {{ d.id== |
| | | 10003 ? 'checked': ''}} > |
| | | </script> |
| | |
| | | //初始化 |
| | | layui.use(['laydate', 'form', 'table'], function () { |
| | | var laydate = layui.laydate, |
| | | form = layui.form, |
| | | table = layui.table; |
| | | //渲染日期输入框 |
| | | laydate.render({ |
| | | elem: "intput[name=startTime]" //指定元素 |
| | | }); |
| | | laydate.render({ |
| | | elem: "intput[name=endTime]" //指定元素 |
| | | }); |
| | | form = layui.form, |
| | | table = layui.table; |
| | | |
| | | //搜索条件 |
| | | form.on('submit(search)', function (data) { |
| | | app.search(data.field); |
| | | return false; |
| | | }); |
| | | |
| | | var params = {}; |
| | | ksapp.postJSON('/admin/api/goldcorn/price/getPriceTypes', params, function (res) { |
| | | if (res.code == 0) { |
| | | //填充数据 |
| | | $("select[name=type]").empty(); |
| | | $("select[name=type]").append("<option value=''>请选择</option>"); |
| | | for (var i = 0; i < res.data.length; i++) { |
| | | var html = "<option value='" + res.data[i].key + "'>"; |
| | | html += res.data[i].value + "</option>"; |
| | | $("select[name=type]").append(html); |
| | | } |
| | | //重新渲染表单 |
| | | form.render(); |
| | | |
| | | requestCount--; |
| | | if (requestCount <= 0) { |
| | | //搜索 |
| | | $('#search').trigger("click"); |
| | | } |
| | | } else { |
| | | layer.msg(res.msg); |
| | | } |
| | | |
| | | }, function (res) { |
| | | }); |
| | | |
| | | tableIns = table.render({ |
| | | elem: '#table_list', |
| | | url: "/admin/api/goldcorn/get/config/list", |
| | | url: "/admin/api/goldcorn/getfrequency/list", |
| | | toolbar: "#toolbar", |
| | | totalRow: true, |
| | | cols: [[{type: 'checkbox', title: "ID"}, |
| | | {field: 'id', width: 120, sort: false, title: "ID"}, |
| | | {field: 'type', width: 120, sort: false, title: "类型"}, |
| | | {field: 'limitCount', width: 120, sort: false, title: "限制次数"}, |
| | | {field: 'timeUnit', width: 120, sort: false, title: "限制单位"}, |
| | | {field: 'validateTime', width: 120, sort: false, title: "生效时间"}, |
| | | {field: 'remarks', width: 120, sort: false, title: "备注"}, |
| | | {field: 'createTime', width: 120, sort: false, title: "创建时间"}, |
| | | {field: 'updateTime', width: 120, sort: false, title: "修改时间"}, |
| | | {field: 'id', width: 120, sort: false, title: "ID"}, |
| | | {field: 'type', width: 120, sort: false, title: "类型"}, |
| | | { |
| | | field: 'limitCount', width: 120, sort: false, title: "频率", templet: function (res) { |
| | | return res.limitCount + "次/" + res.timeUnit; |
| | | } |
| | | }, |
| | | |
| | | {field: 'minSpaceTime', width: 120, sort: false, title: "最小间隔时间"}, |
| | | {field: 'validateTime', width: 150, sort: false, title: "生效时间"}, |
| | | {field: 'remarks', width: 120, 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 即为原始返回的数据 |
| | |
| | | |
| | | //头工具栏事件 |
| | | 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(); |
| | | }); |
| | | 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; |
| | | }; |
| | | }); |
| | | break; |
| | | } |
| | | ; |
| | | }); |
| | | //请求搜索表单中需要的数据 |
| | | $('#search').trigger("click"); |
| | | $('#search').trigger("click"); |
| | | }); |
| | | |
| | | |
| | | }, |
| | | delete: function (obj, index, id) { |
| | |
| | | }); |
| | | }, |
| | | deleteList: function (ids, success) { |
| | | ksapp.post("/admin/api/goldcorn/get/config/delete", {ids: JSON.stringify(ids)}, function (e) { |
| | | ksapp.post("/admin/api/goldcorn/getfrequency/delete", {ids: JSON.stringify(ids)}, function (e) { |
| | | if (e.code == 0) { |
| | | success(); |
| | | } else { |
| | |
| | | }); |
| | | }, |
| | | search: function (params) { |
| | | if (params["startTime"].length == 0) { |
| | | delete params["startTime"]; |
| | | } |
| | | if (params["endTime"].length == 0) { |
| | | delete params["endTime"]; |
| | | } |
| | | if (params["type"].length == 0) { |
| | | delete params["type"]; |
| | | } |
| | | if (params["kw"].length == 0) { |
| | | delete params["kw"]; |
| | | } |
| | | //数据重载 |
| | | tableIns.reload({ |
| | | where: params, |
| | |
| | | }); |
| | | }, |
| | | } |
| | | }); |
| | | app.init(); |
| | | }); |
| | | app.init(); |
| | | }); |
| | | |
| | | </script> |
| | |
| | | <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> |
| | | <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]> |
| | |
| | | <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"> |
| | | <select name="type" lay-verify="required"> |
| | | </select> </div> |
| | | <div class="layui-form-item"> |
| | | <label for="L_appCode" class="layui-form-label"> |
| | | 类型</label> |
| | | <div class="layui-input-block"> |
| | | <select name="type" lay-verify="required" disabled> |
| | | </select></div> |
| | | |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label for="L_appCode" class="layui-form-label"> |
| | | 限制时间单位</label> |
| | | <div class="layui-input-block"> |
| | | <select name="timeUnit" lay-verify="required"> |
| | | </select> </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label for="L_appCode" class="layui-form-label"> |
| | | 限制时间单位</label> |
| | | <div class="layui-input-block"> |
| | | <select name="timeUnit" lay-verify="required"> |
| | | </select></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="limitCount" lay-verify="required|number" placeholder="请输入金币数量" |
| | | autocomplete="off" |
| | | class="layui-input"> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label for="L_appCode" class="layui-form-label"> |
| | | <span class="x-red">*</span> |
| | | 限制次数</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" name="limitCount" 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="datetime" name="validateTime" lay-verify="required|date" placeholder="请选择生效时间" autocomplete="off" |
| | | class="layui-input"> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label for="L_appCode" class="layui-form-label"> |
| | | 备注</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" name="remarks" lay-verify="" placeholder="" autocomplete="off" |
| | | class="layui-input"> |
| | | </div> |
| | | |
| | | <div class="layui-form-item"> |
| | | <label for="L_appCode" class="layui-form-label"> |
| | | <span class="x-red">*</span> |
| | | 最小间隔时间(秒)</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" name="minSpaceTime" 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="datetime" name="validateTime" 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"> |
| | | <textarea type="text" name="remarks" lay-verify="" placeholder="" autocomplete="off" |
| | | rows="5" |
| | | class="layui-textarea"></textarea> |
| | | </div> |
| | | |
| | | </div> |
| | | |
| | | <div class="layui-form-item"> |
| | | <label for="L_remarks" class="layui-form-label"></label> |
| | |
| | | return; |
| | | } |
| | | |
| | | ksapp.post('/admin/api/goldcorn/get/config/get', {id: id}, function (res) { |
| | | ksapp.post('/admin/api/goldcorn/getfrequency/get', {id: id}, function (res) { |
| | | if (res.code == 0) { |
| | | form.val("update",res.data); |
| | | form.val("update", res.data); |
| | | } else { |
| | | layer.msg(res.msg); |
| | | } |
| | |
| | | layui.use(['form', 'layer', 'jquery', 'upload'], function () { |
| | | $ = layui.jquery; |
| | | var form = layui.form, |
| | | layer = layui.layer, |
| | | upload = layui.upload; |
| | | layer = layui.layer, |
| | | upload = layui.upload; |
| | | |
| | | var verify = {}; |
| | | //自定义验证规则 |
| | |
| | | |
| | | //监听提交 |
| | | 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; |
| | | 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"); |
| | | } |
| | | uploadTool.upload(function () { |
| | | //发异步,把数据提交给php |
| | | var params = data.field; |
| | | params.id = ksapp.getQueryParam("id"); |
| | | |
| | | ksapp.post('/admin/api/goldcorn/get/config/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); |
| | | } |
| | | ksapp.post('/admin/api/goldcorn/getfrequency/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) { |
| | | }); |
| | | }, function (res) { |
| | | }); |
| | | return false; |
| | | }); |
| | | return false; |
| | | }); |
| | | //请求select的数据API |
| | | |
| | | var preRequestCount = 2 |
| | | var params = {}; |
| | | var preRequestCount = 2 |
| | | var params = {}; |
| | | |
| | | ksapp.post('/admin/api/goldcorn/get/config/getTypes', params, function (res) { |
| | | if (res.code == 0) { |
| | | //填充数据 |
| | | $("select[name=type]").empty(); |
| | | for (var i = 0; i < res.data.length; i++) { |
| | | var html = "<option value='" + res.data[i].key + "'>"; |
| | | html += res.data[i].value + "</option>"; |
| | | $("select[name=type]").append(html); |
| | | } |
| | | //重新渲染表单 |
| | | form.render(); |
| | | preRequestCount--; |
| | | if (preRequestCount <= 0) { |
| | | //开始填充数据 |
| | | fillData(form) |
| | | } |
| | | ksapp.post('/admin/api/goldcorn/price/getPriceTypes', params, function (res) { |
| | | if (res.code == 0) { |
| | | //填充数据 |
| | | $("select[name=type]").empty(); |
| | | for (var i = 0; i < res.data.length; i++) { |
| | | var html = "<option value='" + res.data[i].key + "'>"; |
| | | html += res.data[i].value + "</option>"; |
| | | $("select[name=type]").append(html); |
| | | } |
| | | //重新渲染表单 |
| | | form.render(); |
| | | preRequestCount--; |
| | | if (preRequestCount <= 0) { |
| | | //开始填充数据 |
| | | fillData(form) |
| | | } |
| | | |
| | | } else { |
| | | layer.msg(res.msg); |
| | | } |
| | | } else { |
| | | layer.msg(res.msg); |
| | | } |
| | | |
| | | }, function (res) { |
| | | }); |
| | | var params = {}; |
| | | }, function (res) { |
| | | }); |
| | | var params = {}; |
| | | |
| | | ksapp.post('/admin/api/goldcorn/get/config/getTimeUnits', params, function (res) { |
| | | if (res.code == 0) { |
| | | //填充数据 |
| | | $("select[name=timeUnit]").empty(); |
| | | for (var i = 0; i < res.data.length; i++) { |
| | | var html = "<option value='" + res.data[i].key + "'>"; |
| | | html += res.data[i].value + "</option>"; |
| | | $("select[name=timeUnit]").append(html); |
| | | } |
| | | //重新渲染表单 |
| | | form.render(); |
| | | preRequestCount--; |
| | | if (preRequestCount <= 0) { |
| | | //开始填充数据 |
| | | fillData(form) |
| | | } |
| | | ksapp.post('/admin/api/goldcorn/getfrequency/getTimeUnits', params, function (res) { |
| | | if (res.code == 0) { |
| | | //填充数据 |
| | | $("select[name=timeUnit]").empty(); |
| | | for (var i = 0; i < res.data.length; i++) { |
| | | var html = "<option value='" + res.data[i].key + "'>"; |
| | | html += res.data[i].value + "</option>"; |
| | | $("select[name=timeUnit]").append(html); |
| | | } |
| | | //重新渲染表单 |
| | | form.render(); |
| | | preRequestCount--; |
| | | if (preRequestCount <= 0) { |
| | | //开始填充数据 |
| | | fillData(form) |
| | | } |
| | | |
| | | } else { |
| | | layer.msg(res.msg); |
| | | } |
| | | } else { |
| | | layer.msg(res.msg); |
| | | } |
| | | |
| | | }, function (res) { |
| | | }); |
| | | }, function (res) { |
| | | }); |
| | | }) |
| | | ; |
| | | </script> |
| | |
| | | var laydate = layui.laydate, |
| | | form = layui.form, |
| | | table = layui.table; |
| | | //渲染日期输入框 |
| | | laydate.render({ |
| | | elem: "intput[name=startTime]" //指定元素 |
| | | }); |
| | | laydate.render({ |
| | | elem: "intput[name=startTime]" //指定元素 |
| | | }); |
| | | //搜索条件 |
| | | form.on('submit(search)', function (data) { |
| | | app.search(data.field); |
| | |
| | | toolbar: "#toolbar", |
| | | totalRow: true, |
| | | cols: [[{type: 'checkbox', title: "ID"}, |
| | | {field: 'id', width: 120, sort: false, title: "ID"}, |
| | | {field: 'id', width: 150, sort: false, title: "ID"}, |
| | | {field: 'type', width: 120, sort: false, title: "类型"}, |
| | | {field: 'cornNum', width: 120, sort: false, title: "金币数量"}, |
| | | {field: 'validateTime', width: 120, sort: false, title: "生效时间"}, |
| | | {field: 'validateTime', width: 150, sort: false, title: "生效时间"}, |
| | | {field: 'remarks', width: 120, sort: false, title: "备注"}, |
| | | {field: 'createTime', width: 120, sort: false, title: "创建时间"}, |
| | | {field: 'updateTime', width: 120, 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 即为原始返回的数据 |
| | |
| | | var laydate = layui.laydate, |
| | | form = layui.form, |
| | | table = layui.table; |
| | | //渲染日期输入框 |
| | | laydate.render({ |
| | | elem: "intput[name=startTime]" //指定元素 |
| | | }); |
| | | laydate.render({ |
| | | elem: "intput[name=endTime]" //指定元素 |
| | | }); |
| | | //搜索条件 |
| | | form.on('submit(search)', function (data) { |
| | | app.search(data.field); |
| | |
| | | toolbar: "#toolbar", |
| | | totalRow: true, |
| | | cols: [[{type: 'checkbox', title: "ID"}, |
| | | {field: 'id', width: 120, sort: false, title: "ID"}, |
| | | {field: 'id', width: 250, sort: false, title: "ID"}, |
| | | {field: 'type', width: 120, sort: false, title: "类型"}, |
| | | {field: 'uid', width: 80, sort: false, title: "用户ID"}, |
| | | {field: 'cornNum', width: 120, sort: false, title: "金币数量"}, |
| | | {field: 'fromUid', width: 120, sort: false, title: "缘由用户ID"}, |
| | | {field: 'remarks', width: 120, sort: false, title: "备注"}, |
| | | {field: 'createTime', width: 120, sort: false, title: "创建时间"}, |
| | | {field: 'createTime', width: 150, sort: false, title: "创建时间"}, |
| | | {fixed: 'right', width: 80, title: "操作", toolbar: '#optContainer'}]], |
| | | page: true, |
| | | parseData: function (res) { //res 即为原始返回的数据 |
| | |
| | | toolbar: "#toolbar", |
| | | totalRow: true, |
| | | cols: [[{type: 'checkbox', title: "ID"}, |
| | | {field: 'id', width: 120, sort: false, title: "ID"}, |
| | | {field: 'id', width: 150, sort: false, title: "ID"}, |
| | | {field: 'day', width: 120, sort: false, title: "日期"}, |
| | | {field: 'rate', width: 120, sort: false, title: "汇率"}, |
| | | {field: 'validateTime', width: 120, sort: false, title: "生效时间"}, |
| | | {field: 'createTime', width: 120, sort: false, title: "创建时间"}, |
| | | {field: 'updateTime', width: 120, sort: false, title: "修改时间"}, |
| | | {field: 'validateTime', 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 即为原始返回的数据 |
| | |
| | | <div class="left-nav"> |
| | | <div id="side-nav"> |
| | | <ul id="nav"> |
| | | |
| | | <li> |
| | | <a href="javascript:;"> |
| | | <i class="layui-icon left-nav-li" lay-tips="内容运营"></i> |
| | | <cite>内容运营</cite> |
| | | <i class="iconfont nav_right"></i></a> |
| | | <ul class="sub-menu"> |
| | | <li> |
| | | <a onclick="xadmin.add_tab('APP页面通知','msg/app_page_notify_msg_list.html')"> |
| | | <i class="iconfont"></i> |
| | | <cite>APP页面通知</cite></a> |
| | | </li> |
| | | |
| | | </ul> |
| | | </li> |
| | | |
| | | <li> |
| | | <a href="javascript:;"> |
| | | <i class="layui-icon layui-icon-user" lay-tips="用户管理"></i> |
| | |
| | | <a onclick="xadmin.add_tab('登录记录','user/user_login_record_list.html',true)"> |
| | | <i class="iconfont"></i> |
| | | <cite>登录记录</cite></a> |
| | | </li> |
| | | |
| | | <li> |
| | | <a onclick="xadmin.add_tab('用户消息列表','msg/user_msg_list.html',true)"> |
| | | <i class="iconfont"></i> |
| | | <cite>用户消息列表</cite></a> |
| | | </li> |
| | | |
| | | <li> |
| | | <a onclick="xadmin.add_tab('邀请关系','team/team_invite_relation_list.html')"> |
| | | <i class="iconfont"></i> |
| | | <cite>邀请关系</cite></a> |
| | | </li> |
| | | |
| | | <li> |
| | |
| | | </li> |
| | | |
| | | <li> |
| | | <a onclick="xadmin.add_tab('金币获取频率设置','goldcorn/gold_corn_get_frequency_config_list.html')"> |
| | | <i class="iconfont"></i> |
| | | <cite>金币获取频率设置</cite></a> |
| | | </li> |
| | | |
| | | <li> |
| | | <a onclick="xadmin.add_tab('金币获得记录','goldcorn/gold_corn_get_record_list.html')"> |
| | | <i class="iconfont"></i> |
| | | <cite>金币获得记录</cite></a> |
| | |
| | | |
| | | <li> |
| | | <a href="javascript:;"> |
| | | <i class="layui-icon left-nav-li" lay-tips="用户反馈"></i> |
| | | <i class="layui-icon left-nav-li" lay-tips="资金管理"></i> |
| | | <cite>资金管理</cite> |
| | | <i class="iconfont nav_right"></i></a> |
| | | <ul class="sub-menu"> |
| | | <li> |
| | | <a onclick="xadmin.add_tab('用户建议','feedback/advice_list.html')"> |
| | | <a onclick="xadmin.add_tab('提现','money/extract_list.html')"> |
| | | <i class="iconfont"></i> |
| | | <cite>用户建议</cite></a> |
| | | <cite>提现</cite></a> |
| | | </li> |
| | | |
| | | <li> |
| | | <a onclick="xadmin.add_tab('隐私投诉','feedback/privacy_complain_list.html')"> |
| | | <a onclick="xadmin.add_tab('用户资金记录','money/user_money_record_list.html')"> |
| | | <i class="iconfont"></i> |
| | | <cite>隐私投诉</cite></a> |
| | | <cite>用户资金记录</cite></a> |
| | | </li> |
| | | |
| | | </ul> |
| | |
| | | <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> |
| | | <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> |
| | | <script src="../js/utils.js"></script> |
| | | </head> |
| | | |
| | | <body> |
| | |
| | | <div class="layui-card-body"> |
| | | <form class="layui-form layui-col-space5"> |
| | | <div class="layui-inline layui-show-xs-block"> |
| | | <input type="date" name="startTime" lay-verify="" placeholder="" autocomplete="off" |
| | | class="layui-input"> |
| | | <input type="date" name="startTime" lay-verify="" placeholder="" autocomplete="off" |
| | | class="layui-input"> |
| | | </div> |
| | | <div class="layui-inline layui-show-xs-block"> |
| | | <input type="date" name="startTime" lay-verify="" placeholder="" autocomplete="off" |
| | | class="layui-input"> |
| | | <input type="date" name="endTime" lay-verify="" placeholder="" autocomplete="off" |
| | | class="layui-input"> |
| | | </div> |
| | | <div class="layui-inline layui-show-xs-block"> |
| | | <input type="text" name="kw" lay-verify="" placeholder="请输入用户ID" autocomplete="off" |
| | | class="layui-input"> |
| | | <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"> |
| | |
| | | </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"> |
| | |
| | | |
| | | <script type="text/html" id="imgshow"> |
| | | <!-- 这里的checked的状态只是演示 --> |
| | | <img src="{{d.}}"/> |
| | | <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> |
| | |
| | | //初始化 |
| | | layui.use(['laydate', 'form', 'table'], function () { |
| | | var laydate = layui.laydate, |
| | | form = layui.form, |
| | | table = layui.table; |
| | | //渲染日期输入框 |
| | | laydate.render({ |
| | | elem: "intput[name=startTime]" //指定元素 |
| | | }); |
| | | laydate.render({ |
| | | elem: "intput[name=startTime]" //指定元素 |
| | | }); |
| | | form = layui.form, |
| | | table = layui.table; |
| | | |
| | | //搜索条件 |
| | | form.on('submit(search)', function (data) { |
| | | app.search(data.field); |
| | |
| | | toolbar: "#toolbar", |
| | | totalRow: true, |
| | | cols: [[{type: 'checkbox', title: "ID"}, |
| | | {field: 'id', width: 120, sort: false, title: "ID"}, |
| | | {field: 'user', width: 120, sort: false, title: "用户"}, |
| | | {field: 'money', width: 120, sort: false, title: "提现金额"}, |
| | | {field: 'type', width: 120, sort: false, title: "付款渠道"}, |
| | | {field: 'name', width: 120, sort: false, title: "姓名"}, |
| | | {field: 'account', width: 120, sort: false, title: "账号"}, |
| | | {field: 'ip', width: 120, sort: false, title: "提现IP"}, |
| | | {field: 'state', width: 120, sort: false, title: "状态"}, |
| | | {field: 'successTime', width: 120, sort: false, title: "通过时间"}, |
| | | {field: 'createTime', width: 120, sort: false, title: "创建时间"}, |
| | | {field: 'id', width: 100, sort: false, title: "ID"}, |
| | | {field: 'user', width: 80, sort: false, title: "用户ID"}, |
| | | {field: 'money', width: 100, sort: false, title: "提现金额"}, |
| | | {field: 'type', width: 120, sort: false, title: "付款渠道"}, |
| | | {field: 'name', width: 120, sort: false, title: "姓名(支付宝)"}, |
| | | {field: 'account', width: 120, sort: false, title: "账号/OpenId"}, |
| | | {field: 'ip', width: 120, sort: false, title: "提现IP"}, |
| | | { |
| | | field: 'state', width: 80, sort: false, title: "状态", templet: function (res) { |
| | | if (res.state == 0) { |
| | | return "未处理"; |
| | | } else if (res.state == 1) { |
| | | return "通过"; |
| | | } else if (res.state == 2) { |
| | | return "已拒绝"; |
| | | } else if (res.state == 3) { |
| | | return "正在处理"; |
| | | } |
| | | return "未知"; |
| | | } |
| | | }, |
| | | {field: 'reason', width: 200, sort: false, title: "原因"}, |
| | | {field: 'successTime', width: 120, sort: false, title: "通过时间"}, |
| | | {field: 'createTime', width: 120, sort: false, title: "创建时间"}, |
| | | {fixed: 'right', width: 80, title: "操作", toolbar: '#optContainer'}]], |
| | | page: true, |
| | | parseData: function (res) { //res 即为原始返回的数据 |
| | |
| | | |
| | | //头工具栏事件 |
| | | 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(); |
| | | }); |
| | | 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; |
| | | }; |
| | | }); |
| | | break; |
| | | } |
| | | ; |
| | | }); |
| | | //请求搜索表单中需要的数据 |
| | | $('#search').trigger("click"); |
| | | $('#search').trigger("click"); |
| | | }); |
| | | |
| | | }, |
| | |
| | | }); |
| | | }, |
| | | search: function (params) { |
| | | if (params["startTime"].length == 0) { |
| | | delete params["startTime"]; |
| | | } |
| | | |
| | | if (params["endTime"].length == 0) { |
| | | delete params["endTime"]; |
| | | } |
| | | |
| | | if (params["uid"].length == 0) { |
| | | delete params["uid"]; |
| | | } |
| | | |
| | | //数据重载 |
| | | tableIns.reload({ |
| | | where: params, |
| | |
| | | }); |
| | | }, |
| | | } |
| | | }); |
| | | app.init(); |
| | | }); |
| | | app.init(); |
| | | }); |
| | | |
| | | </script> |
| | |
| | | <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> |
| | | <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> |
| | | <script src="../js/utils.js"></script> |
| | | </head> |
| | | |
| | | <body> |
| | |
| | | <div class="layui-card-body"> |
| | | <form class="layui-form layui-col-space5"> |
| | | <div class="layui-inline layui-show-xs-block"> |
| | | <input type="date" name="startTime" lay-verify="" placeholder="" autocomplete="off" |
| | | class="layui-input"> |
| | | <input type="date" name="startTime" lay-verify="" placeholder="" autocomplete="off" |
| | | class="layui-input"> |
| | | </div> |
| | | <div class="layui-inline layui-show-xs-block"> |
| | | <input type="date" name="startTime" lay-verify="" placeholder="" autocomplete="off" |
| | | class="layui-input"> |
| | | <input type="date" name="endTime" lay-verify="" placeholder="" autocomplete="off" |
| | | class="layui-input"> |
| | | </div> |
| | | |
| | | <div class="layui-inline layui-show-xs-block"> |
| | | <input type="text" name="kw" lay-verify="" placeholder="请输入用户ID" autocomplete="off" |
| | | class="layui-input"> |
| | | <select name="add"> |
| | | <option value="">请选择(增加/消耗)</option> |
| | | <option value="true">增加</option> |
| | | <option value="false">消耗</option> |
| | | </select> |
| | | </div> |
| | | |
| | | <div class="layui-inline layui-show-xs-block"> |
| | | <select name="type"> |
| | | </select> |
| | | </div> |
| | | |
| | | <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"> |
| | |
| | | </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="imgshow"> |
| | | <!-- 这里的checked的状态只是演示 --> |
| | | <img src="{{d.}}"/> |
| | | <img src="{{d.}}"/> |
| | | <input type="checkbox" name="sex" value="{{d.id}}" lay-skin="switch" lay-text="女|男" lay-filter="sexDemo" {{ d.id== |
| | | 10003 ? 'checked': ''}} > |
| | | </script> |
| | |
| | | //初始化 |
| | | layui.use(['laydate', 'form', 'table'], function () { |
| | | var laydate = layui.laydate, |
| | | form = layui.form, |
| | | table = layui.table; |
| | | //渲染日期输入框 |
| | | laydate.render({ |
| | | elem: "intput[name=startTime]" //指定元素 |
| | | }); |
| | | laydate.render({ |
| | | elem: "intput[name=startTime]" //指定元素 |
| | | }); |
| | | form = layui.form, |
| | | table = layui.table; |
| | | |
| | | //搜索条件 |
| | | form.on('submit(search)', function (data) { |
| | | app.search(data.field); |
| | | return false; |
| | | }); |
| | | |
| | | |
| | | var params = {}; |
| | | |
| | | ksapp.post('/admin/api/money/record/getMoneyTypes', params, function (res) { |
| | | if (res.code == 0) { |
| | | //填充数据 |
| | | $("select[name=type]").empty(); |
| | | $("select[name=type]").append("<option value=''>请选择类型</option>"); |
| | | for (var i = 0; i < res.data.length; i++) { |
| | | var html = "<option value='" + res.data[i].key + "'>"; |
| | | html += res.data[i].value + "</option>"; |
| | | $("select[name=type]").append(html); |
| | | } |
| | | //重新渲染表单 |
| | | form.render(); |
| | | |
| | | requestCount--; |
| | | if (requestCount <= 0) { |
| | | //搜索 |
| | | $('#search').trigger("click"); |
| | | } |
| | | } else { |
| | | layer.msg(res.msg); |
| | | } |
| | | |
| | | }, function (res) { |
| | | }); |
| | | |
| | | |
| | | tableIns = table.render({ |
| | | elem: '#table_list', |
| | |
| | | toolbar: "#toolbar", |
| | | totalRow: true, |
| | | cols: [[{type: 'checkbox', title: "ID"}, |
| | | {field: 'id', width: 120, sort: false, title: "ID"}, |
| | | {field: 'user', width: 120, sort: false, title: "用户"}, |
| | | {field: 'money', width: 120, sort: false, title: "金额"}, |
| | | {field: 'type', width: 120, sort: false, title: "付款渠道"}, |
| | | {field: 'remarks', width: 120, sort: false, title: "备注"}, |
| | | {field: 'createTime', width: 120, sort: false, title: "创建时间"}, |
| | | {field: 'updateTime', width: 120, sort: false, title: "修改时间"}, |
| | | {field: 'id', width: 120, sort: false, title: "ID"}, |
| | | {field: 'user', width: 120, sort: false, title: "用户"}, |
| | | {field: 'money', width: 120, sort: false, title: "金额"}, |
| | | {field: 'type', width: 120, sort: false, title: "类型"}, |
| | | {field: 'serialNo', width: 200, sort: false, title: "流水号"}, |
| | | {field: 'remarks', width: 120, 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 即为原始返回的数据 |
| | |
| | | |
| | | //头工具栏事件 |
| | | 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(); |
| | | }); |
| | | 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; |
| | | }; |
| | | }); |
| | | break; |
| | | } |
| | | ; |
| | | }); |
| | | //请求搜索表单中需要的数据 |
| | | $('#search').trigger("click"); |
| | | $('#search').trigger("click"); |
| | | }); |
| | | |
| | | }, |
| | |
| | | }); |
| | | }, |
| | | search: function (params) { |
| | | |
| | | if (params["startTime"].length == 0) { |
| | | delete params["startTime"]; |
| | | } |
| | | |
| | | if (params["endTime"].length == 0) { |
| | | delete params["endTime"]; |
| | | } |
| | | |
| | | if (params["type"].length == 0) { |
| | | delete params["type"]; |
| | | } |
| | | |
| | | if (params["add"].length == 0) { |
| | | delete params["add"]; |
| | | } |
| | | |
| | | if (params["uid"].length == 0) { |
| | | delete params["uid"]; |
| | | } |
| | | |
| | | //数据重载 |
| | | tableIns.reload({ |
| | | where: params, |
| | |
| | | }); |
| | | }, |
| | | } |
| | | }); |
| | | app.init(); |
| | | }); |
| | | app.init(); |
| | | }); |
| | | |
| | | </script> |
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"> |
| | | <select name="type" lay-verify="required"> |
| | | </select></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="checkbox" name="canClose" 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="text" name="content" lay-verify="required" 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="text" name="contentUrl" 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="text" 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="text" 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(); |
| | | |
| | | }, |
| | | 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> |
| | | 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 () { |
| | | //发异步,把数据提交给php |
| | | ksapp.post('/admin/api/msg/appnotify/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 |
| | | var params = {}; |
| | | |
| | | ksapp.postJSON('/admin/api/msg/appnotify/getMsgTypes', params, function (res) { |
| | | if (res.code == 0) { |
| | | //填充数据 |
| | | $("select[name=type]").empty(); |
| | | for (var i = 0; i < res.data.length; i++) { |
| | | var html = "<option value='" + res.data[i].key + "'>"; |
| | | html += res.data[i].value + "</option>"; |
| | | $("select[name=type]").append(html); |
| | | } |
| | | //重新渲染表单 |
| | | form.render(); |
| | | } else { |
| | | layer.msg(res.msg); |
| | | } |
| | | |
| | | }, function (res) { |
| | | }); |
| | | }) |
| | | ; |
| | | </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"> |
| | | <select name="type" > |
| | | </select></div> |
| | | <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"> |
| | | </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('添加APP页面通知','app_page_notify_msg_add.html',500,620)"><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('修改APP页面通知','app_page_notify_msg_update.html?id={{d.id}}',500,620)" |
| | | 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/msg/appnotify/list", |
| | | toolbar: "#toolbar", |
| | | totalRow: true, |
| | | cols: [[{type: 'checkbox', title: "ID"}, |
| | | {field: 'id', width: 100, sort: false, title: "ID"}, |
| | | {field: 'type', width: 80, sort: false, title: "显示位置"}, |
| | | { |
| | | 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: 'content', width: 250, sort: false, title: "内容"}, |
| | | {field: 'contentUrl', width: 200, sort: false, title: "链接"}, |
| | | {field: 'startTime', width: 150, sort: false, title: "显示开始时间"}, |
| | | {field: 'endTime', width: 150, sort: false, title: "显示结束时间"}, |
| | | { |
| | | field: 'canClose', |
| | | width: 120, |
| | | sort: false, |
| | | title: "是否可以关闭", |
| | | templet: function (res) { |
| | | if (res.canClose) { |
| | | return " <input type=\"checkbox\" checked='true' disabled lay-skin=\"switch\""; |
| | | } else { |
| | | return " <input type=\"checkbox\" disabled lay-skin=\"switch\""; |
| | | } |
| | | } |
| | | }, |
| | | {field: 'md5', 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; |
| | | } |
| | | ; |
| | | }); |
| | | //请求搜索表单中需要的数据 |
| | | |
| | | var requestCount = 0; |
| | | requestCount++; |
| | | var params = {}; |
| | | |
| | | ksapp.postJSON('/admin/api/msg/appnotify/getMsgTypes', params, function (res) { |
| | | if (res.code == 0) { |
| | | //填充数据 |
| | | $("select[name=type]").empty(); |
| | | $("select[name=type]").append("<option value=''>请选择</option>"); |
| | | for (var i = 0; i < res.data.length; i++) { |
| | | var html = "<option value='" + res.data[i].key + "'>"; |
| | | html += res.data[i].value + "</option>"; |
| | | $("select[name=type]").append(html); |
| | | } |
| | | //重新渲染表单 |
| | | form.render(); |
| | | |
| | | requestCount--; |
| | | if (requestCount <= 0) { |
| | | //搜索 |
| | | $('#search').trigger("click"); |
| | | } |
| | | } else { |
| | | layer.msg(res.msg); |
| | | } |
| | | |
| | | }, function (res) { |
| | | }); |
| | | }); |
| | | |
| | | }, |
| | | 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/msg/appnotify/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"> |
| | | <select name="type" lay-verify="required"> |
| | | </select></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="checkbox" name="canClose" 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="text" name="content" lay-verify="required" 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="text" name="contentUrl" 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="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="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/msg/appnotify/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/msg/appnotify/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 |
| | | |
| | | var preRequestCount = 1 |
| | | var params = {}; |
| | | |
| | | ksapp.post('/admin/api/msg/appnotify/getMsgTypes', params, function (res) { |
| | | if (res.code == 0) { |
| | | //填充数据 |
| | | $("select[name=type]").empty(); |
| | | for (var i = 0; i < res.data.length; i++) { |
| | | var html = "<option value='" + res.data[i].key + "'>"; |
| | | html += res.data[i].value + "</option>"; |
| | | $("select[name=type]").append(html); |
| | | } |
| | | //重新渲染表单 |
| | | form.render(); |
| | | preRequestCount--; |
| | | if (preRequestCount <= 0) { |
| | | //开始填充数据 |
| | | fillData(form) |
| | | } |
| | | |
| | | } else { |
| | | layer.msg(res.msg); |
| | | } |
| | | |
| | | }, function (res) { |
| | | }); |
| | | }) |
| | | ; |
| | | </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="date" name="startTime" lay-verify="" placeholder="" autocomplete="off" |
| | | class="layui-input"> |
| | | </div> |
| | | <div class="layui-inline layui-show-xs-block"> |
| | | <input type="date" name="endTime" lay-verify="" placeholder="" autocomplete="off" |
| | | class="layui-input"> |
| | | </div> |
| | | |
| | | <div class="layui-inline layui-show-xs-block"> |
| | | <select name="type"> |
| | | </select></div> |
| | | <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"> |
| | | |
| | | </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/msg/usermsg/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: 'type', width: 120, sort: false, title: "消息类型"}, |
| | | {field: 'contentList', width: 120, sort: false, title: "内容"}, |
| | | {field: 'createTime', width: 120, sort: false, title: "创建时间"}, |
| | | {field: 'updateTime', width: 120, 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; |
| | | } |
| | | ; |
| | | }); |
| | | //请求搜索表单中需要的数据 |
| | | |
| | | var requestCount = 0; |
| | | requestCount++; |
| | | var params = {}; |
| | | |
| | | ksapp.postJSON('/admin/api/msg/usermsg/getMsgTypes', params, function (res) { |
| | | if (res.code == 0) { |
| | | //填充数据 |
| | | $("select[name=type]").empty(); |
| | | $("select[name=type]").append("<option value=''>请选择</option>"); |
| | | for (var i = 0; i < res.data.length; i++) { |
| | | var html = "<option value='" + res.data[i].key + "'>"; |
| | | html += res.data[i].value + "</option>"; |
| | | $("select[name=type]").append(html); |
| | | } |
| | | //重新渲染表单 |
| | | form.render(); |
| | | |
| | | requestCount--; |
| | | if (requestCount <= 0) { |
| | | //搜索 |
| | | $('#search').trigger("click"); |
| | | } |
| | | } else { |
| | | layer.msg(res.msg); |
| | | } |
| | | |
| | | }, function (res) { |
| | | }); |
| | | }); |
| | | |
| | | }, |
| | | 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/msg/usermsg/delete", {ids: JSON.stringify(ids)}, function (e) { |
| | | if (e.code == 0) { |
| | | success(); |
| | | } else { |
| | | layer.msg(e.msg); |
| | | } |
| | | }, function (e) { |
| | | }); |
| | | }, |
| | | search: function (params) { |
| | | var keys = ["startTime", "endTime", "uid", "type"]; |
| | | for (var i = 0; i < keys.length; i++) { |
| | | if (params[keys[i]].length == 0) { |
| | | delete params[keys[i]]; |
| | | } |
| | | } |
| | | //数据重载 |
| | | tableIns.reload({ |
| | | where: params, |
| | | page: { |
| | | curr: 1 //重新从第 1 页开始 |
| | | } |
| | | }); |
| | | }, |
| | | } |
| | | }); |
| | | app.init(); |
| | | }); |
| | | |
| | | </script> |
| | | |
| | | <script> |
| | | |
| | | </script> |
| | | </html> |
| | |
| | | <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> |
| | | <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> |
| | | <script src="../js/utils.js"></script> |
| | | </head> |
| | | |
| | | <body> |
| | |
| | | <div class="layui-card-body"> |
| | | <form class="layui-form layui-col-space5"> |
| | | <div class="layui-inline layui-show-xs-block"> |
| | | <input type="date" name="startTime" lay-verify="" placeholder="" autocomplete="off" |
| | | class="layui-input"> |
| | | <input type="date" name="startTime" lay-verify="" placeholder="" autocomplete="off" |
| | | class="layui-input"> |
| | | </div> |
| | | <div class="layui-inline layui-show-xs-block"> |
| | | <input type="date" name="startTime" lay-verify="" placeholder="" autocomplete="off" |
| | | class="layui-input"> |
| | | <input type="date" name="endTime" lay-verify="" placeholder="" autocomplete="off" |
| | | class="layui-input"> |
| | | </div> |
| | | |
| | | <div class="layui-inline layui-show-xs-block"> |
| | | <input type="text" name="kw" lay-verify="" placeholder="请输入用户ID" autocomplete="off" |
| | | class="layui-input"> |
| | | <select name="boss" class="layui-select"> |
| | | <option value="">请选择(队员/上家)</option> |
| | | <option value="true">查询队员</option> |
| | | <option value="false">查询上家</option> |
| | | </select> |
| | | </div> |
| | | |
| | | <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"> |
| | |
| | | </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="imgshow"> |
| | | <!-- 这里的checked的状态只是演示 --> |
| | | <img src="{{d.}}"/> |
| | | <img src="{{d.}}"/> |
| | | <input type="checkbox" name="sex" value="{{d.id}}" lay-skin="switch" lay-text="女|男" lay-filter="sexDemo" {{ d.id== |
| | | 10003 ? 'checked': ''}} > |
| | | </script> |
| | |
| | | //初始化 |
| | | layui.use(['laydate', 'form', 'table'], function () { |
| | | var laydate = layui.laydate, |
| | | form = layui.form, |
| | | table = layui.table; |
| | | //渲染日期输入框 |
| | | laydate.render({ |
| | | elem: "intput[name=startTime]" //指定元素 |
| | | }); |
| | | laydate.render({ |
| | | elem: "intput[name=startTime]" //指定元素 |
| | | }); |
| | | form = layui.form, |
| | | table = layui.table; |
| | | |
| | | //搜索条件 |
| | | form.on('submit(search)', function (data) { |
| | | app.search(data.field); |
| | |
| | | toolbar: "#toolbar", |
| | | totalRow: true, |
| | | cols: [[{type: 'checkbox', title: "ID"}, |
| | | {field: 'id', width: 120, sort: false, title: "ID"}, |
| | | {field: 'uid', width: 120, sort: false, title: "邀请人"}, |
| | | {field: 'targetUid', width: 120, sort: false, title: "被邀请人"}, |
| | | {field: 'state', width: 120, sort: false, title: "状态"}, |
| | | {field: 'createTime', width: 120, sort: false, title: "创建时间"}, |
| | | {field: 'id', width: 120, sort: false, title: "ID"}, |
| | | {field: 'uid', width: 120, sort: false, title: "邀请人"}, |
| | | {field: 'targetUid', width: 120, sort: false, title: "被邀请人"}, |
| | | {field: 'state', width: 120, sort: false, title: "状态"}, |
| | | {field: 'createTime', width: 120, sort: false, title: "创建时间"}, |
| | | {fixed: 'right', width: 80, title: "操作", toolbar: '#optContainer'}]], |
| | | page: true, |
| | | parseData: function (res) { //res 即为原始返回的数据 |
| | |
| | | |
| | | //头工具栏事件 |
| | | 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(); |
| | | }); |
| | | 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; |
| | | }; |
| | | }); |
| | | break; |
| | | } |
| | | ; |
| | | }); |
| | | //请求搜索表单中需要的数据 |
| | | $('#search').trigger("click"); |
| | | $('#search').trigger("click"); |
| | | }); |
| | | |
| | | }, |
| | |
| | | }); |
| | | }, |
| | | search: function (params) { |
| | | |
| | | if (params["startTime"].length == 0) { |
| | | delete params["startTime"]; |
| | | } |
| | | if (params["endTime"].length == 0) { |
| | | delete params["endTime"]; |
| | | } |
| | | |
| | | if (params["boss"].length == 0) { |
| | | delete params["boss"]; |
| | | } |
| | | |
| | | if (params["uid"].length == 0) { |
| | | delete params["uid"]; |
| | | } |
| | | |
| | | //数据重载 |
| | | tableIns.reload({ |
| | | where: params, |
| | |
| | | }); |
| | | }, |
| | | } |
| | | }); |
| | | app.init(); |
| | | }); |
| | | app.init(); |
| | | }); |
| | | |
| | | </script> |
New file |
| | |
| | | package test.goldcorn; |
| | | |
| | | import com.yeshi.makemoney.app.Application; |
| | | import com.yeshi.makemoney.app.entity.goldcorn.GoldCornGetRecord; |
| | | import com.yeshi.makemoney.app.entity.goldcorn.GoldCornGetType; |
| | | import com.yeshi.makemoney.app.exception.goldcorn.GoldCornGetFrequencyConfigException; |
| | | import com.yeshi.makemoney.app.exception.goldcorn.GoldCornGetPriceException; |
| | | import com.yeshi.makemoney.app.exception.goldcorn.GoldCornGetRecordException; |
| | | import com.yeshi.makemoney.app.exception.goldcorn.GoldCornMakeException; |
| | | import com.yeshi.makemoney.app.exception.user.UserInfoException; |
| | | import com.yeshi.makemoney.app.service.inter.goldcorn.GoldCornGetRecordService; |
| | | import com.yeshi.makemoney.app.service.inter.goldcorn.GoldCornMakeService; |
| | | import org.junit.jupiter.api.Test; |
| | | import org.springframework.boot.test.context.SpringBootTest; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author hxh |
| | | * @title: GoldCornTest |
| | | * @description: TODO |
| | | * @date 2022/4/7 10:13 |
| | | */ |
| | | @SpringBootTest(classes = Application.class) |
| | | public class GoldCornTest { |
| | | |
| | | @Resource |
| | | private GoldCornGetRecordService goldCornGetRecordService; |
| | | |
| | | @Resource |
| | | private GoldCornMakeService goldCornMakeService; |
| | | |
| | | @Test |
| | | public void addGoldRecord() throws GoldCornGetRecordException { |
| | | GoldCornGetRecord record = new GoldCornGetRecord(); |
| | | record.setCornNum(10); |
| | | record.setUid(2L); |
| | | record.setType(GoldCornGetType.readNovel); |
| | | record.setLevel(GoldCornGetRecord.LEVEL_OWN); |
| | | record.setDay("2022-04-07"); |
| | | goldCornGetRecordService.add(record); |
| | | } |
| | | |
| | | @Test |
| | | public void statistic() { |
| | | Long count = goldCornGetRecordService.getGoldCornByDay(null, "2022-04-07"); |
| | | System.out.println(count); |
| | | |
| | | count = goldCornGetRecordService.countUidsByDay("2022-04-07"); |
| | | System.out.println(count); |
| | | |
| | | List<Long> uidList = goldCornGetRecordService.getUidsByDay("2022-04-07", 1, 1); |
| | | for (Long id : uidList) { |
| | | System.out.println(id); |
| | | } |
| | | uidList = goldCornGetRecordService.getUidsByDay("2022-04-07", 2, 1); |
| | | for (Long id : uidList) { |
| | | System.out.println(id); |
| | | } |
| | | uidList = goldCornGetRecordService.getUidsByDay("2022-04-07", 3, 1); |
| | | for (Long id : uidList) { |
| | | System.out.println(id); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | @Test |
| | | public void makeGoldCorn() { |
| | | try { |
| | | goldCornMakeService.addGoldCorn(22380L, GoldCornGetType.watchVideo, new Date()); |
| | | // goldCornMakeService.addGoldCorn(22380L,GoldCornGetType.readNovel,new Date()); |
| | | } catch (UserInfoException e) { |
| | | e.printStackTrace(); |
| | | } catch (GoldCornGetPriceException e) { |
| | | e.printStackTrace(); |
| | | } catch (GoldCornGetFrequencyConfigException e) { |
| | | e.printStackTrace(); |
| | | } catch (GoldCornMakeException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | |
| | | } |