Merge remote-tracking branch 'origin/master'
New file |
| | |
| | | package com.yeshi.fanli.controller.admin;
|
| | |
|
| | | import java.io.PrintWriter;
|
| | | import java.util.ArrayList;
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | | import org.springframework.stereotype.Controller;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | |
|
| | | import com.google.gson.Gson;
|
| | | import com.google.gson.GsonBuilder;
|
| | | import com.google.gson.reflect.TypeToken;
|
| | | import com.yeshi.fanli.entity.bus.help.AppPageNotification;
|
| | | import com.yeshi.fanli.entity.bus.help.AppPageNotification.AppPageNotificationTypeEnum;
|
| | | import com.yeshi.fanli.service.inter.help.AppPageNotificationService;
|
| | | import com.yeshi.fanli.tag.PageEntity;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | |
|
| | | @Controller
|
| | | @RequestMapping("admin/new/api/v1/notification")
|
| | | public class AppPageNotificationAdminController {
|
| | |
|
| | | @Resource
|
| | | private AppPageNotificationService appPageNotificationService;
|
| | | |
| | | |
| | | /**
|
| | | * 新增
|
| | | * @param callback
|
| | | * @param special
|
| | | * @param out
|
| | | */
|
| | | // @RequestMapping(value = "saveAdd")
|
| | | public void saveAdd(String callback, AppPageNotification appPageNotification, PrintWriter out) {
|
| | |
|
| | | try {
|
| | | |
| | | String content = appPageNotification.getContent();
|
| | | if (StringUtil.isNullOrEmpty(content) ) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("显示内容不能为空"));
|
| | | return;
|
| | | }
|
| | | |
| | | AppPageNotificationTypeEnum type = appPageNotification.getType();
|
| | | if (type != null) {
|
| | | AppPageNotification old = appPageNotificationService.getAppPageNotificationByType(type.name());
|
| | | if (old != null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("已存在此类型"));
|
| | | return;
|
| | | }
|
| | | |
| | | appPageNotification.setMd5(StringUtil.Md5(type.name() |
| | | + "#" + content + "#" + appPageNotification.getContentUrl()));
|
| | | } else {
|
| | | appPageNotification.setMd5(StringUtil.Md5(null + "#" + content + "#" + appPageNotification.getContentUrl()));
|
| | | }
|
| | | |
| | | |
| | | appPageNotification.setCreateTime(new Date());
|
| | | appPageNotification.setUpdateTime(new Date());
|
| | | appPageNotificationService.insertSelective(appPageNotification);
|
| | | |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("添加成功"));
|
| | |
|
| | | } catch (Exception e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常"));
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | | * 修改
|
| | | * @param callback
|
| | | * @param special
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "saveModify")
|
| | | public void saveModify(String callback, AppPageNotification appPageNotification, PrintWriter out) {
|
| | | try {
|
| | | |
| | | AppPageNotificationTypeEnum type = appPageNotification.getType();
|
| | | if (type == null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("ID不能为空"));
|
| | | return;
|
| | | }
|
| | | |
| | | AppPageNotification old = appPageNotificationService.getAppPageNotificationByType(type.name());
|
| | | if (old == null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作对象已不存在"));
|
| | | return;
|
| | | }
|
| | | |
| | | String content = appPageNotification.getContent();
|
| | | if (StringUtil.isNullOrEmpty(content) ) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("显示内容不能为空"));
|
| | | return;
|
| | | }
|
| | | |
| | | appPageNotification.setMd5(StringUtil.Md5(type.name() + "#" + content + "#" + appPageNotification.getContentUrl()));
|
| | | appPageNotification.setId(old.getId());
|
| | | appPageNotification.setUpdateTime(new Date());
|
| | | appPageNotificationService.updateByPrimaryKeySelective(appPageNotification);
|
| | |
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("修改成功"));
|
| | |
|
| | | } catch (Exception e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常"));
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | |
| | | |
| | | /**
|
| | | * 查询列表
|
| | | * @param callback
|
| | | * @param pageIndex
|
| | | * @param pageSize
|
| | | * @param key 内容、类型
|
| | | * @param show 是否显示 1 0
|
| | | * @param canClose 是否可以关闭 1 0
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "query")
|
| | | public void query(String callback, Integer pageIndex, Integer pageSize, String key,
|
| | | Integer show, Integer canClose, PrintWriter out) {
|
| | |
|
| | | if (pageIndex == null || pageIndex < 1) {
|
| | | pageIndex = 1;
|
| | | }
|
| | |
|
| | | if (pageSize == null || pageSize < 1) {
|
| | | pageSize = Constant.PAGE_SIZE;
|
| | | }
|
| | |
|
| | | try {
|
| | | List<AppPageNotification> list = appPageNotificationService.listQuery((pageIndex - 1) * pageSize, |
| | | pageSize, key, show, canClose);
|
| | |
|
| | | if (list == null || list.size() == 0) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("暂无数据"));
|
| | | return;
|
| | | }
|
| | | |
| | | for (AppPageNotification notification: list) {
|
| | | AppPageNotificationTypeEnum type = notification.getType();
|
| | | notification.setPageName(type.getDesc());
|
| | | }
|
| | | |
| | | |
| | | long count = appPageNotificationService.countQuery(key, show, canClose);
|
| | | |
| | | int totalPage = (int) (count % pageSize == 0 ? count / pageSize : count / pageSize + 1);
|
| | | PageEntity pe = new PageEntity(pageIndex, pageSize, count, totalPage);
|
| | |
|
| | | GsonBuilder gsonBuilder = new GsonBuilder();
|
| | | gsonBuilder.serializeNulls(); |
| | | Gson gson = gsonBuilder.setDateFormat("yyyy/MM/dd HH:mm:ss").create();
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("pe", pe);
|
| | | data.put("result_list", gson.toJson(list));
|
| | |
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | |
|
| | | } catch (Exception e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常"));
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | |
| | | /**
|
| | | * 修该是否可以关闭状态
|
| | | * @param callback
|
| | | * @param id
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "updateCanCloseState")
|
| | | public void updateCanCloseState(String callback, String type, PrintWriter out) {
|
| | | try {
|
| | | if (type == null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("ID不能为空"));
|
| | | return;
|
| | | }
|
| | | |
| | | AppPageNotification resultObj = appPageNotificationService.getAppPageNotificationByType(type);
|
| | | if (resultObj == null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作数据已不存在"));
|
| | | return;
|
| | | }
|
| | | |
| | | Boolean canClose = resultObj.getCanClose();
|
| | | if (canClose) {
|
| | | resultObj.setCanClose(false);
|
| | | } else {
|
| | | resultObj.setCanClose(true);
|
| | | }
|
| | |
|
| | | appPageNotificationService.updateByPrimaryKeySelective(resultObj);
|
| | | |
| | | JSONObject data = new JSONObject();
|
| | | data.put("state", resultObj.getCanClose());
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | |
|
| | | } catch (Exception e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常"));
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | |
| | | /**
|
| | | * 修该显示状态
|
| | | * @param callback
|
| | | * @param id
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "updateShowState")
|
| | | public void updateShowState(String callback, String type, PrintWriter out) {
|
| | | try {
|
| | |
|
| | | if (type == null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("ID不能为空"));
|
| | | return;
|
| | | }
|
| | | |
| | | AppPageNotification resultObj = appPageNotificationService.getAppPageNotificationByType(type);
|
| | | if (resultObj == null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作数据已不存在"));
|
| | | return;
|
| | | }
|
| | | |
| | | Boolean show = resultObj.getShow();
|
| | | if (show) {
|
| | | resultObj.setShow(false);
|
| | | } else {
|
| | | resultObj.setShow(true);
|
| | | }
|
| | |
|
| | | appPageNotificationService.updateByPrimaryKeySelective(resultObj);
|
| | | |
| | | JSONObject data = new JSONObject();
|
| | | data.put("state", resultObj.getShow());
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | |
|
| | | } catch (Exception e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常"));
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | | * 删除
|
| | | * @param callback
|
| | | * @param idArray
|
| | | * @param out
|
| | | */
|
| | | //@RequestMapping(value = "delete")
|
| | | public void delete(String callback, String idArray, PrintWriter out) {
|
| | |
|
| | | try {
|
| | | if (StringUtil.isNullOrEmpty(idArray)) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("请选择操作的数据"));
|
| | | return;
|
| | | }
|
| | |
|
| | | Gson gson = new Gson();
|
| | | List<Long> list = gson.fromJson(idArray, new TypeToken<ArrayList<Long>>() {}.getType());
|
| | |
|
| | | if (list == null || list.size() == 0) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("未检测到删除的数据"));
|
| | | return;
|
| | | }
|
| | | |
| | | int count = appPageNotificationService.deleteBatchByPrimaryKey(list);
|
| | | |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("成功删除["+ count +"]条数据"));
|
| | |
|
| | | } catch (Exception e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("删除失败"));
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | | import org.springframework.stereotype.Controller;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.springframework.web.bind.annotation.RequestMethod;
|
| | |
|
| | | import com.yeshi.fanli.entity.common.Config;
|
| | | import com.yeshi.fanli.service.inter.config.ConfigService;
|
| | | import com.yeshi.fanli.tag.PageEntity;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | |
|
| | | import org.yeshi.utils.JsonUtil;
|
| | |
|
| | | @Controller
|
| | |
| | | out.print(JsonUtil.loadTrueResult("修改成功"));
|
| | | return;
|
| | | }
|
| | | |
| | | /**
|
| | | * 查询列表 - 新后台
|
| | | * @param callback
|
| | | * @param key 查询词 名称
|
| | | * @param pageIndex
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getNewConfigList")
|
| | | public void getNewConfigList(String callback, String key, Integer pageIndex, PrintWriter out){
|
| | | |
| | | try {
|
| | | |
| | | if (pageIndex == null || pageIndex < 0){
|
| | | pageIndex = 1;
|
| | | }
|
| | | |
| | | List<Config> list = configService.listObjects(key, pageIndex);
|
| | | |
| | | if (list == null || list.size() == 0) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("暂无更多数据"));
|
| | | return;
|
| | | }
|
| | | |
| | | int count = configService.getCount(key, pageIndex);
|
| | | PageEntity pe = new PageEntity(pageIndex, Constant.PAGE_SIZE, count);
|
| | | |
| | | JSONObject data = new JSONObject();
|
| | | data.put("pe", pe);
|
| | | data.put("result_list", list);
|
| | | |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | | |
| | | } catch (Exception e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("查询失败"));
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | |
| | | /**
|
| | | * 参数修改 - 新后台
|
| | | * @param callback
|
| | | * @param config
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "saveModify")
|
| | | public void saveModify(String callback, Config config, PrintWriter out) {
|
| | | Long id = config.getId();
|
| | | if (id == null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("ID不能为空"));
|
| | | return;
|
| | | }
|
| | | |
| | | try {
|
| | | Config crentconfig = configService.getConfig(id);
|
| | | if (crentconfig == null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作数据已不存在"));
|
| | | return;
|
| | | }
|
| | | // key 不可修改
|
| | | config.setKey(crentconfig.getKey());
|
| | | configService.update(config);
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("修改成功"));
|
| | | |
| | | } catch (Exception e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("修改失败"));
|
| | | e.printStackTrace();
|
| | | }
|
| | | |
| | | }
|
| | | |
| | | }
|
| | |
| | |
|
| | | }
|
| | |
|
| | | |
| | | /**
|
| | | * 校验用户资金是否异常
|
| | | * |
| | | * @param uid
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "checkMoney")
|
| | | public void checkMoney(String callback, String uid, PrintWriter out) {
|
| | |
|
| | | if (StringUtil.isNullOrEmpty(uid)) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("UID不能为空"));
|
| | | return;
|
| | | }
|
| | | |
| | | List<Integer> listChecked = extractService.checkExtract(uid);
|
| | | |
| | | if (listChecked == null || listChecked.size() == 0) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("资金异常"));
|
| | | return;
|
| | | }
|
| | | |
| | | Integer diversity = listChecked.get(0);
|
| | | if (diversity == 0) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("资金正常"));
|
| | | } else {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("资金异常"));
|
| | | }
|
| | | }
|
| | | |
| | | }
|
| | |
| | | import org.springframework.web.bind.annotation.RequestMethod;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | |
|
| | | import com.google.gson.Gson;
|
| | | import com.google.gson.GsonBuilder;
|
| | | import com.google.gson.reflect.TypeToken;
|
| | | import com.yeshi.fanli.entity.common.JumpDetail;
|
| | | import com.yeshi.fanli.entity.common.JumpDetailV2;
|
| | | import com.yeshi.fanli.exception.NotExistObjectException;
|
| | |
| | | import com.yeshi.fanli.service.inter.config.JumpDetailService;
|
| | | import com.yeshi.fanli.tag.PageEntity;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | |
|
| | | @Controller
|
| | | @RequestMapping("admin/new/api/v1/jumpDetail")
|
| | |
| | | @RequestMapping({ "getJumpOption" })
|
| | | public void getJumpOption(String callback, PrintWriter out) {
|
| | | try {
|
| | | List<JumpDetailV2> listJump = this.JumpDetailV2Service.listJump();
|
| | | List<JumpDetailV2> listJump = JumpDetailV2Service.listJump();
|
| | | JSONObject data = new JSONObject();
|
| | |
|
| | | JumpDetailV2 jumpDetailV2 = new JumpDetailV2();
|
| | |
| | | }
|
| | | }
|
| | |
|
| | |
|
| | | /**
|
| | | * 新增
|
| | | * @param callback
|
| | | * @param special
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "saveAdd")
|
| | | public void saveAdd(String callback, JumpDetailV2 jumpDetailV2, PrintWriter out) {
|
| | |
|
| | | try {
|
| | | |
| | | String name = jumpDetailV2.getName();
|
| | | if (StringUtil.isNullOrEmpty(name)) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("跳转参数不能为空"));
|
| | | return;
|
| | | }
|
| | |
|
| | | JumpDetailV2Service.insert(jumpDetailV2);
|
| | | |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("添加成功"));
|
| | |
|
| | | } catch (Exception e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常"));
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | | * 修改
|
| | | * @param callback
|
| | | * @param special
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "saveModify")
|
| | | public void saveModify(String callback, JumpDetailV2 jumpDetailV2, PrintWriter out) {
|
| | | try {
|
| | |
|
| | | Long id = jumpDetailV2.getId();
|
| | | if (id == null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("ID不能为空"));
|
| | | return;
|
| | | }
|
| | | |
| | | JumpDetailV2 resultObj = JumpDetailV2Service.selectByPrimaryKey(id);
|
| | | if (resultObj == null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作数据已不存在"));
|
| | | return;
|
| | | }
|
| | |
|
| | | JumpDetailV2Service.updateByPrimaryKeySelective(jumpDetailV2);
|
| | |
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("修改成功"));
|
| | |
|
| | | } catch (Exception e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常"));
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | |
| | | /**
|
| | | * 查询
|
| | | * @param callback
|
| | | * @param pageIndex
|
| | | * @param pageSize
|
| | | * @param key 模糊查询:说明、标识
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "query")
|
| | | public void query(String callback, Integer pageIndex, Integer pageSize, String key, PrintWriter out) {
|
| | |
|
| | | if (pageIndex == null || pageIndex < 1) {
|
| | | pageIndex = 1;
|
| | | }
|
| | |
|
| | | if (pageSize == null || pageSize < 1) {
|
| | | pageSize = Constant.PAGE_SIZE;
|
| | | }
|
| | |
|
| | | try {
|
| | | List<JumpDetailV2> list = JumpDetailV2Service.listQuery((pageIndex - 1) * pageSize, |
| | | pageSize, key);
|
| | |
|
| | | if (list == null || list.size() == 0) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("暂无数据"));
|
| | | return;
|
| | | }
|
| | | |
| | |
|
| | | long count = JumpDetailV2Service.countListQuery(key);
|
| | | |
| | | int totalPage = (int) (count % pageSize == 0 ? count / pageSize : count / pageSize + 1);
|
| | | PageEntity pe = new PageEntity(pageIndex, pageSize, count, totalPage);
|
| | |
|
| | | GsonBuilder gsonBuilder = new GsonBuilder();
|
| | | gsonBuilder.serializeNulls(); |
| | | Gson gson = gsonBuilder.setDateFormat("yyyy/MM/dd HH:mm:ss").create();
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("pe", pe);
|
| | | data.put("result_list", gson.toJson(list));
|
| | |
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | |
|
| | | } catch (Exception e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常"));
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | | /**
|
| | | * 删除
|
| | | * @param callback
|
| | | * @param idArray
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "delete")
|
| | | public void delete(String callback, String idArray, PrintWriter out) {
|
| | |
|
| | | try {
|
| | | if (StringUtil.isNullOrEmpty(idArray)) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("请选择操作的数据"));
|
| | | return;
|
| | | }
|
| | |
|
| | | Gson gson = new Gson();
|
| | | List<Long> list = gson.fromJson(idArray, new TypeToken<ArrayList<Long>>() {}.getType());
|
| | |
|
| | | if (list == null || list.size() == 0) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("未检测到删除的数据"));
|
| | | return;
|
| | | }
|
| | | |
| | | int count = JumpDetailV2Service.deleteBatchByPrimaryKey(list);
|
| | | |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("成功删除["+ count +"]条数据"));
|
| | |
|
| | | } catch (Exception e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("删除失败"));
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | int count = pushRecordService.getCount(key, type, pageIndex);
|
| | | PageEntity pe = new PageEntity(pageIndex, Constant.PAGE_SIZE, count);
|
| | | int pageSize = Constant.PAGE_SIZE;
|
| | |
|
| | | int count = pushRecordService.getCount(key, type, pageIndex);
|
| | | |
| | | int totalPage = (int) (count % pageSize == 0 ? count / pageSize : count / pageSize + 1);
|
| | | PageEntity pe = new PageEntity(pageIndex, pageSize, count, totalPage);
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("pe", pe);
|
| | | data.put("result_list", list);
|
| | |
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoBaoUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
|
| | |
|
| | | import org.yeshi.utils.JsonUtil;
|
| | |
|
| | | @Controller
|
| | |
| | | filter.setKey("女装");
|
| | | }
|
| | |
|
| | | |
| | | |
| | | // 折扣价范围下限
|
| | | if (startPrice != null)
|
| | | filter.setStartPrice(new BigDecimal(startPrice));
|
| | |
| | |
|
| | | // 淘客佣金比率下限 如:1234表示12.34%
|
| | | if (!StringUtil.isNullOrEmpty(startTkRate)) {
|
| | | BigDecimal b = new BigDecimal(startTkRate);
|
| | | double df = b.setScale(2, BigDecimal.ROUND_FLOOR).doubleValue();
|
| | | int tkRate = (int) (df * 100);
|
| | | filter.setStartTkRate(tkRate);
|
| | | int tkRate = (int) (Float.parseFloat(startTkRate) * 100);
|
| | | filter.setStartTkRate(tkRate);
|
| | | }
|
| | |
|
| | | // 淘客佣金比率上限 如:1234表示12.34%
|
| | | if (!StringUtil.isNullOrEmpty(endTkRate)) {
|
| | | BigDecimal b = new BigDecimal(endTkRate);
|
| | | double df = b.setScale(2, BigDecimal.ROUND_FLOOR).doubleValue();
|
| | | int tkRate = (int) (df * 100);
|
| | | int tkRate = (int) (Float.parseFloat(endTkRate) * 100);
|
| | | filter.setEndTkRate(tkRate);
|
| | | }
|
| | |
|
| | |
| | | import com.google.gson.Gson;
|
| | | import com.google.gson.GsonBuilder;
|
| | | import com.yeshi.fanli.entity.admin.UserInfoAdmin;
|
| | | import com.yeshi.fanli.entity.bus.user.AccountDetails;
|
| | | import com.yeshi.fanli.entity.bus.user.Extract;
|
| | | import com.yeshi.fanli.entity.bus.user.HongBao;
|
| | | import com.yeshi.fanli.entity.bus.user.MoneyRecord;
|
| | |
| | | import com.yeshi.fanli.util.HongBaoUtil;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | |
|
| | | import org.yeshi.utils.JsonUtil;
|
| | |
|
| | | @Controller
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | public static void main(String[] args) {
|
| | | |
| | | |
| | | /**
|
| | | * 队员关系
|
| | | * @param pageIndex
|
| | | * @param key
|
| | | * @param state
|
| | | * @param startTime
|
| | | * @param endTime
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getRelationList")
|
| | | public void getRelationList(String callback, Integer pageIndex, Integer pageSize, Long uid, Integer type,
|
| | | Integer state, String startTime, String endTime, PrintWriter out) {
|
| | |
|
| | | if (pageIndex == null || pageIndex < 1) {
|
| | | pageIndex = 1;
|
| | | }
|
| | |
|
| | | if (pageSize == null || pageSize < 1) {
|
| | | pageSize = Constant.PAGE_SIZE;
|
| | | }
|
| | | |
| | | try {
|
| | | |
| | | if (!StringUtil.isNullOrEmpty(endTime)) {
|
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
| | | Date enddate = sdf.parse(endTime);
|
| | | Calendar c = Calendar.getInstance();
|
| | | c.setTime(enddate);
|
| | | c.add(Calendar.DAY_OF_MONTH, 1);// 今天+1天
|
| | | endTime = sdf.format(c.getTime());
|
| | | }
|
| | | |
| | | List<ThreeSale> listQuery = null;
|
| | | if (type == 0) {
|
| | | // 上级用户
|
| | | if (uid == null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("查询上级需输入用户id"));
|
| | | return;
|
| | | }
|
| | | listQuery = threeSaleService.listSuperiorQuery((pageIndex - 1) * pageSize, pageSize, state, uid);
|
| | | } else if (type == 1) {
|
| | | // 一级用户
|
| | | listQuery = threeSaleService.listFirstTeamQuery((pageIndex - 1) * pageSize, pageSize, uid, |
| | | state, startTime, endTime);
|
| | | } else if (type == 2) {
|
| | | // 二级用户
|
| | | listQuery = threeSaleService.listSecondTeamQuery((pageIndex - 1) * pageSize, pageSize, uid,
|
| | | state, startTime, endTime);
|
| | | }
|
| | | |
| | | if (listQuery == null || listQuery.size() == 0) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("暂无数据"));
|
| | | return;
|
| | | }
|
| | | |
| | | for (ThreeSale threeSale: listQuery) {
|
| | | Integer expire = threeSale.getExpire();
|
| | | if (threeSale.getState()) {
|
| | | threeSale.setExpire(1); // 邀请成功
|
| | | } else {
|
| | | if (expire != null && expire == 1) {
|
| | | threeSale.setExpire(2); // 邀请失效
|
| | | } else {
|
| | | threeSale.setExpire(0);// 已邀请
|
| | | }
|
| | | }
|
| | | }
|
| | | |
| | | long count = 0;
|
| | | if (type == 0) {
|
| | | // 上级用户
|
| | | count = threeSaleService.countSuperiorQuery(state, uid);
|
| | | } else if (type == 1) {
|
| | | // 一级用户
|
| | | count = threeSaleService.countFirstTeamQuery(uid, state, startTime, endTime);
|
| | | } else if (type == 2) {
|
| | | // 二级用户
|
| | | count = threeSaleService.countSecondTeamQuery(uid, state, startTime, endTime);
|
| | | }
|
| | | |
| | | int totalPage = (int) (count % pageSize == 0 ? count / pageSize : count / pageSize + 1);
|
| | | PageEntity pe = new PageEntity(pageIndex, pageSize, count, totalPage);
|
| | | |
| | | JSONObject data = new JSONObject();
|
| | | data.put("pe", pe);
|
| | | data.put("result_list", listQuery);
|
| | | |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | | |
| | | } catch (Exception e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("查询失败"));
|
| | | e.printStackTrace();
|
| | | } |
| | | }
|
| | | |
| | | |
| | | /**
|
| | | * 用户账户明细
|
| | | * @param callback
|
| | | * @param pageIndex
|
| | | * @param pageSize
|
| | | * @param id
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getAccountDetails")
|
| | | public void getAccountDetails(String callback, Integer pageIndex,Integer pageSize, Long uid, PrintWriter out) {
|
| | | if (pageIndex == null || pageIndex < 1) {
|
| | | pageIndex = 1;
|
| | | }
|
| | |
|
| | | if (pageSize == null || pageSize < 1) {
|
| | | pageSize = Constant.PAGE_SIZE;
|
| | | }
|
| | | |
| | | if (uid == null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("请传递正确数据"));
|
| | | return;
|
| | | }
|
| | | |
| | | try {
|
| | | |
| | | List<AccountDetails> detailsList = accountDetailsService.findAccountDetailsList(uid, pageIndex);
|
| | | if (detailsList == null || detailsList.size() == 0) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("暂无数据"));
|
| | | return;
|
| | | }
|
| | | |
| | | int count = accountDetailsService.getCount(uid);
|
| | | |
| | | int totalPage = (int) (count % pageSize == 0 ? count / pageSize : count / pageSize + 1);
|
| | | PageEntity pe = new PageEntity(pageIndex, pageSize, count, totalPage);
|
| | | |
| | | |
| | | JSONObject data = new JSONObject();
|
| | | data.put("pe", pe);
|
| | | data.put("result_list", GsonUtil.toJsonExpose(detailsList));
|
| | | |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | | |
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("查询失败"));
|
| | | }
|
| | | }
|
| | | |
| | | public static void main(String[] args) {
|
| | | java.lang.System.out.println(java.lang.System.currentTimeMillis());
|
| | | }
|
| | |
|
| | |
| | | import java.util.List;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | | import javax.servlet.http.HttpServletRequest;
|
| | | import javax.servlet.http.HttpServletResponse;
|
| | |
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | | import org.springframework.stereotype.Controller;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.springframework.web.bind.annotation.RequestParam;
|
| | | import org.springframework.web.multipart.commons.CommonsMultipartFile;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | |
|
| | | import com.google.gson.Gson;
|
| | |
| | | import com.google.gson.reflect.TypeToken;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.HomeNavbar;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.SuperHomeNavbar;
|
| | | import com.yeshi.fanli.entity.common.AdminUser;
|
| | | import com.yeshi.fanli.entity.system.System;
|
| | | import com.yeshi.fanli.service.AdminUserService;
|
| | | import com.yeshi.fanli.service.inter.config.SystemService;
|
| | | import com.yeshi.fanli.service.inter.homemodule.HomeNavbarService;
|
| | | import com.yeshi.fanli.service.inter.homemodule.SuperHomeNavbarService;
|
| | | import com.yeshi.fanli.tag.PageEntity;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.annotation.RequestNoLogin;
|
| | |
|
| | | @Controller
|
| | | @RequestMapping("admin/new/api/v1/navbar")
|
| | |
| | |
|
| | | @Resource
|
| | | private SystemService systemService;
|
| | | |
| | | @Resource
|
| | | private AdminUserService adminUserService;
|
| | |
|
| | | @Resource
|
| | | private HomeNavbarService homeNavbarService;
|
| | |
| | | }
|
| | |
|
| | | Integer oldOrder = resultObj.getOrderby();
|
| | | List<HomeNavbar> list = homeNavbarService.getChangeOrder(id, moveType, oldOrder);
|
| | | List<HomeNavbar> list = homeNavbarService.getChangeOrder(moveType, oldOrder);
|
| | |
|
| | | if (list != null && list.size() > 0) {
|
| | | HomeNavbar changeObj = list.get(0);
|
| | |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("删除失败"));
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | |
| | | /**
|
| | | * 专题图片上传
|
| | | * @param file
|
| | | * @param uid
|
| | | * @param id
|
| | | * @param request
|
| | | * @param response
|
| | | * @param out
|
| | | */
|
| | | @RequestNoLogin()
|
| | | @RequestMapping(value = "uploadPic")
|
| | | public void uploadPic(@RequestParam("file") CommonsMultipartFile file, Long uid,
|
| | | Long id, HttpServletRequest request, HttpServletResponse response, PrintWriter out) {
|
| | | |
| | | response.setHeader("Access-Control-Allow-Origin", "*");
|
| | | response.setHeader("Access-Control-Allow-Methods", "*");
|
| | |
|
| | | AdminUser admin = adminUserService.selectByPrimaryKey(uid);
|
| | | if (admin == null) {
|
| | | out.print(JsonUtil.loadFalseResult("当前账户验证失败"));
|
| | | return;
|
| | | }
|
| | | |
| | | if (file == null) {
|
| | | out.print(JsonUtil.loadFalseResult("上传文件为空"));
|
| | | return;
|
| | | }
|
| | | |
| | | if (id == null) {
|
| | | out.print(JsonUtil.loadFalseResult("ID不能为空"));
|
| | | return;
|
| | | }
|
| | | |
| | | try {
|
| | | |
| | | HomeNavbar resultObj = homeNavbarService.selectByPrimaryKey(id);
|
| | | if (resultObj == null) {
|
| | | out.print(JsonUtil.loadFalseResult("操作数据已不存在"));
|
| | | return;
|
| | | }
|
| | | |
| | | homeNavbarService.uploadPicture(file, resultObj);
|
| | | out.print(JsonUtil.loadTrueResult("上传成功"));
|
| | | |
| | | } catch (Exception e) {
|
| | | out.print(JsonUtil.loadFalseResult("操作失败"));
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
| | |
|
| | | int maxOrder = swiperPictureService.getMaxOrderByBannerID(bannerId);
|
| | | record.setOrder(maxOrder + 1);
|
| | | |
| | | record.setState(0);
|
| | | // 默认停用
|
| | | record.setState(1);
|
| | | record.setCreatetime(new Date());
|
| | | record.setUpdatetime(new Date());
|
| | |
|
| | |
| | | */ |
| | | int updateExpire(List<Long> list); |
| | | |
| | | /** |
| | | * 一级查询 |
| | | * @param start |
| | | * @param count |
| | | * @param key |
| | | * @param startTime |
| | | * @param endTime |
| | | * @return |
| | | */ |
| | | List<ThreeSale> listFirstTeamQuery(@Param("start") long start, @Param("count") int count, @Param("uid") Long uid, |
| | | @Param("state")Integer state, @Param("startTime") String startTime, @Param("endTime") String endTime); |
| | | |
| | | long countFirstTeamQuery(@Param("uid") Long uid, @Param("state")Integer state, @Param("startTime") String startTime, |
| | | @Param("endTime") String endTime); |
| | | |
| | | |
| | | /** |
| | | * 二级查询 |
| | | * @param start |
| | | * @param count |
| | | * @param key |
| | | * @param startTime |
| | | * @param endTime |
| | | * @return |
| | | */ |
| | | List<ThreeSale> listSecondTeamQuery(@Param("start")long start, @Param("count")int count, @Param("uid")Long uid, |
| | | @Param("state")Integer state, @Param("startTime")String startTime, @Param("endTime")String endTime); |
| | | |
| | | long countSecondTeamQuery(@Param("uid")Long uid, @Param("state")Integer state, @Param("startTime")String startTime, |
| | | @Param("endTime") String endTime); |
| | | |
| | | |
| | | |
| | | /** |
| | | * 上级查询 |
| | | * @param start |
| | | * @param count |
| | | * @param uid |
| | | * @return |
| | | */ |
| | | List<ThreeSale> listSuperiorQuery(@Param("start") long start, @Param("count") int count, |
| | | @Param("state")Integer state, @Param("uid") Long uid); |
| | | |
| | | long countSuperiorQuery(@Param("state")Integer state, @Param("uid") Long uid); |
| | | |
| | | } |
| | |
| | | |
| | | import java.util.List; |
| | | |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import com.yeshi.fanli.entity.common.JumpDetailV2; |
| | | |
| | | public interface JumpDetailV2Mapper { |
| | |
| | | * @return |
| | | */ |
| | | List<JumpDetailV2> listJump(); |
| | | |
| | | |
| | | /** |
| | | * 根据主键批量删除 |
| | | * @param list |
| | | * @return |
| | | */ |
| | | int deleteBatchByPrimaryKey(List<Long> list); |
| | | |
| | | /** |
| | | * 后端列表查询 |
| | | * @param start |
| | | * @param count |
| | | * @param key |
| | | * @return |
| | | */ |
| | | List<JumpDetailV2> listQuery(@Param("start") long start, @Param("count") int count, @Param("key") String key); |
| | | |
| | | long countListQuery(@Param("key") String key); |
| | | |
| | | |
| | | } |
| | |
| | | package com.yeshi.fanli.dao.mybatis.help; |
| | | |
| | | import java.util.List; |
| | | |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import com.yeshi.fanli.entity.bus.help.AppPageNotification; |
| | | |
| | | public interface AppPageNotificationMapper { |
| | |
| | | int updateByPrimaryKeySelective(AppPageNotification record); |
| | | |
| | | int updateByPrimaryKey(AppPageNotification record); |
| | | |
| | | /** |
| | | * 根据主键批量删除 |
| | | * @param list |
| | | * @return |
| | | */ |
| | | int deleteBatchByPrimaryKey(List<Long> list); |
| | | |
| | | /** |
| | | * 后端列表查询 |
| | | * @return |
| | | */ |
| | | List<AppPageNotification> listQuery(@Param("start") long start, @Param("count") int count, |
| | | @Param("key") String key, @Param("show") Integer show, @Param("canClose") Integer canClose); |
| | | |
| | | long countQuery(@Param("key") String key,@Param("show") Integer show, @Param("canClose") Integer canClose); |
| | | } |
| | |
| | | * @param order 排序值 |
| | | * @return |
| | | */ |
| | | List<HomeNavbar> getChangeOrder(@Param("id") Long id, @Param("type") Integer type, @Param("order") Integer order); |
| | | List<HomeNavbar> getChangeOrder(@Param("type") Integer type, @Param("order") Integer order); |
| | | |
| | | /** |
| | | * 后端列表查询 |
| | |
| | | import java.io.Serializable;
|
| | | import java.util.Date;
|
| | |
|
| | | import javax.persistence.Transient;
|
| | |
|
| | | import com.google.gson.annotations.Expose;
|
| | |
|
| | | import org.yeshi.utils.mybatis.Column;
|
| | | import org.yeshi.utils.mybatis.Table;
|
| | |
|
| | |
| | | "资金"), accountDetail("账户明细"), extract("提现"), orderFanli("返利订单"),orderTiCheng("提成订单"),orderTaoBao("淘宝订单"), coollect("收藏"), scanHistory("足迹"), team(
|
| | | "队员"), kefu("联系客服"), taoBaoShoppingCart("淘宝购物车"), orderFind("订单申诉"), msgCenter("消息中心");
|
| | | private final String desc;
|
| | |
|
| | | |
| | | private AppPageNotificationTypeEnum(String desc) {
|
| | | this.desc = desc;
|
| | | }
|
| | |
| | | @Column(name = "an_updatetime")
|
| | | private Date updateTime;// 更新时间
|
| | |
|
| | | @Transient // 页面名称
|
| | | private String pageName; |
| | | |
| | | public Long getId() {
|
| | | return id;
|
| | | }
|
| | |
| | | this.updateTime = updateTime;
|
| | | }
|
| | |
|
| | | public String getPageName() {
|
| | | return pageName;
|
| | | }
|
| | |
|
| | | public void setPageName(String pageName) {
|
| | | this.pageName = pageName;
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | LEFT JOIN yeshi_ec_binding_account b ON u.`id` = b.`uid` |
| | | where 1=1 |
| | | <if test="key != null and key !='' "> |
| | | AND (u.id LIKE '%${key}%' OR u.`phone` LIKE '%${key}%' OR b.`account` LIKE '%${key}%') |
| | | AND (u.id LIKE '%${key}%' OR u.`phone` LIKE '%${key}%' OR u.`wxName` LIKE '%${key}%' |
| | | OR u.`nick_name` LIKE '%${key}%' OR u.`tbName` LIKE '%${key}%' OR b.`account` LIKE '%${key}%') |
| | | </if> |
| | | <if test="startTime != null and startTime !='' "> |
| | | <![CDATA[ AND FROM_UNIXTIME(createtime/1000) >= '${startTime}' ]]> |
| | |
| | | SELECT count(u.id) FROM yeshi_ec_user u |
| | | LEFT JOIN yeshi_ec_binding_account b ON u.`id` = b.`uid` |
| | | where <![CDATA[ 1>0 ]]> |
| | | <if test="key != null and key !='' "> |
| | | AND (u.id LIKE '%${key}%' OR u.`phone` LIKE '%${key}%' OR b.`account` LIKE '%${key}%') |
| | | <if test="key != null and key !='' "> |
| | | AND (u.id LIKE '%${key}%' OR u.`phone` LIKE '%${key}%' OR u.`wxName` LIKE '%${key}%' |
| | | OR u.`nick_name` LIKE '%${key}%' OR u.`tbName` LIKE '%${key}%' OR b.`account` LIKE '%${key}%') |
| | | </if> |
| | | <if test="startTime != null and startTime !='' "> |
| | | <![CDATA[ AND FROM_UNIXTIME(createtime/1000) >= '${startTime}' ]]> |
| | |
| | | LEFT JOIN yeshi_ec_binding_account b ON u.`id` = b.`uid` |
| | | where <![CDATA[ 1>0 ]]> |
| | | <if test="key != null and key !='' "> |
| | | AND (u.id LIKE '%${key}%' OR u.`phone` LIKE '%${key}%' OR b.`account` LIKE '%${key}%') |
| | | AND (u.id LIKE '%${key}%' OR u.`phone` LIKE '%${key}%' OR u.`wxName` LIKE '%${key}%' |
| | | OR u.`nick_name` LIKE '%${key}%' OR u.`tbName` LIKE '%${key}%' OR b.`account` LIKE '%${key}%') |
| | | </if> |
| | | <if test="startTime != null and startTime !='' "> |
| | | <![CDATA[ AND FROM_UNIXTIME(createtime/1000) >= '${startTime}' ]]> |
| | |
| | | select <include refid="Base_Column_List"/> from yeshi_ec_action_jumpdetail_v2 |
| | | </select> |
| | | |
| | | <select id="listQuery" resultMap="BaseResultMap"> |
| | | SELECT <include refid="Base_Column_List" /> FROM yeshi_ec_action_jumpdetail_v2 |
| | | WHERE 1=1 |
| | | <if test='key != null and key != ""'> |
| | | AND (jp_name like '%${key}%') |
| | | </if> |
| | | ORDER BY jp_id |
| | | LIMIT ${start},${count} |
| | | </select> |
| | | |
| | | <select id="countListQuery" resultType="java.lang.Long"> |
| | | SELECT IFNULL(count(jp_id),0) FROM yeshi_ec_action_jumpdetail_v2 |
| | | WHERE 1=1 |
| | | <if test='key != null and key != ""'> |
| | | AND (jp_name like '%${key}%') |
| | | </if> |
| | | </select> |
| | | |
| | | <delete id="deleteBatchByPrimaryKey" parameterType="java.util.List"> |
| | | delete from yeshi_ec_action_jumpdetail_v2 WHERE jp_id in |
| | | <foreach collection="list" item="item" open="(" close=")" |
| | | separator=",">#{item}</foreach> |
| | | </delete> |
| | | </mapper> |
| | |
| | | </set> |
| | | where an_id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | |
| | | |
| | | <select id="listQuery" resultMap="BaseResultMap"> |
| | | SELECT <include refid="Base_Column_List" /> FROM yeshi_ec_apppage_notification |
| | | WHERE 1=1 |
| | | <if test='key != null and key != ""'> |
| | | AND (an_type like '%${key}%' or an_content like '%${key}%') |
| | | </if> |
| | | <if test='show != null'> |
| | | AND an_show = #{show} |
| | | </if> |
| | | <if test='canClose != null'> |
| | | AND an_can_close = #{canClose} |
| | | </if> |
| | | ORDER BY an_createtime desc |
| | | LIMIT ${start},${count} |
| | | </select> |
| | | |
| | | <select id="countQuery" resultType="java.lang.Long"> |
| | | SELECT IFNULL(count(an_id),0) FROM yeshi_ec_apppage_notification |
| | | WHERE 1=1 |
| | | <if test='key != null and key != ""'> |
| | | AND (an_type like '%${key}%' or an_content like '%${key}%') |
| | | </if> |
| | | <if test='show != null'> |
| | | AND an_show = #{show} |
| | | </if> |
| | | <if test='canClose != null'> |
| | | AND an_can_close = #{canClose} |
| | | </if> |
| | | </select> |
| | | |
| | | <delete id="deleteBatchByPrimaryKey" parameterType="java.util.List"> |
| | | delete from yeshi_ec_apppage_notification WHERE an_id in |
| | | <foreach collection="list" item="item" open="(" close=")" |
| | | separator=",">#{item}</foreach> |
| | | </delete> |
| | | |
| | | </mapper> |
| | |
| | | |
| | | <select id="getChangeOrder" resultMap="BaseResultMap"> |
| | | SELECT <include refid="Base_Column_List" /> FROM yeshi_ec_home_navbar |
| | | WHERE br_id = #{id} |
| | | WHERE 1=1 |
| | | <if test="type == -1"> |
| | | <![CDATA[and br_orderby < #{order}]]> |
| | | order by br_orderby desc |
| | |
| | | public List<JumpDetailV2> listJump() {
|
| | | return this.jumpDetailV2Mapper.listJump();
|
| | | }
|
| | | |
| | |
|
| | | @Override
|
| | | public int deleteBatchByPrimaryKey(List<Long> list) {
|
| | | return jumpDetailV2Mapper.deleteBatchByPrimaryKey(list);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<JumpDetailV2> listQuery(long start, int count, String key) {
|
| | | return jumpDetailV2Mapper.listQuery(start, count, key);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public long countListQuery(String key) {
|
| | | return jumpDetailV2Mapper.countListQuery(key);
|
| | | }
|
| | |
|
| | | }
|
| | |
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import net.sf.json.JSONArray;
|
| | |
|
| | | import org.springframework.cache.annotation.CacheEvict;
|
| | | import org.springframework.cache.annotation.Cacheable;
|
| | | import org.springframework.stereotype.Service;
|
| | |
| | | import com.yeshi.fanli.entity.config.AppHomeFloatImg;
|
| | | import com.yeshi.fanli.entity.xcx.XCXSettingConfig;
|
| | | import com.yeshi.fanli.service.inter.config.ConfigService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | |
|
| | | import net.sf.json.JSONArray;
|
| | |
|
| | | @Service
|
| | | public class ConfigServiceImpl implements ConfigService {
|
| | |
| | | return configDao.list("from Config");
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<Config> listObjects(String key, int page) {
|
| | | int start = (page-1) * Constant.PAGE_SIZE;
|
| | | StringBuffer hqlBuf=new StringBuffer("from Config pr where 1=1 ");
|
| | | |
| | | if(key !=null && !"".equals(key.trim())){
|
| | | hqlBuf.append(" and (pr.name like ? )");
|
| | | }
|
| | | |
| | | hqlBuf.append(" order by pr.id desc ");
|
| | | String hql = hqlBuf.toString();
|
| | | if(hql.contains("pr.name")){
|
| | | return configDao.list(hqlBuf.toString(), start, Constant.PAGE_SIZE, new Serializable[]{"%"+key+"%"});
|
| | | } else {
|
| | | return configDao.list(hqlBuf.toString(), start, Constant.PAGE_SIZE, new Serializable[]{});
|
| | | }
|
| | | |
| | | }
|
| | | |
| | | @Override
|
| | | public int getCount(String key, int page) {
|
| | | |
| | | StringBuffer hqlBuf=new StringBuffer("select count(*) from Config pr where 1=1 ");
|
| | | |
| | | if(key !=null && !"".equals(key.trim())){
|
| | | hqlBuf.append(" and (pr.name like ? )");
|
| | | }
|
| | | |
| | | String hql = hqlBuf.toString();
|
| | | |
| | | if(hql.contains("pr.name")){
|
| | | return (int) configDao.getCount(hqlBuf.toString(),new Serializable[]{"%"+key+"%"});
|
| | | } else {
|
| | | return (int) configDao.getCount(hqlBuf.toString(), new Serializable[]{});
|
| | | }
|
| | | }
|
| | |
|
| | | |
| | | @CacheEvict(value = "config", allEntries = true)
|
| | | @Transactional
|
| | | public void update(List<Config> list) {
|
| | |
| | | String value = get("home_weex_url");
|
| | | return value;
|
| | | }
|
| | |
|
| | | |
| | | @Override
|
| | | public Config getConfig(long id) {
|
| | | return configDao.find(Config.class, id);
|
| | | }
|
| | | |
| | | }
|
| | |
| | | package com.yeshi.fanli.service.impl.help;
|
| | |
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | |
| | | appPageNotificationMapper.insertSelective(apn);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void insertSelective(AppPageNotification record) {
|
| | | appPageNotificationMapper.insertSelective(record);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void updateByPrimaryKeySelective(AppPageNotification record) {
|
| | | appPageNotificationMapper.updateByPrimaryKeySelective(record); |
| | | }
|
| | |
|
| | | @Override
|
| | | public AppPageNotification selectByPrimaryKey(Long id) {
|
| | | return appPageNotificationMapper.selectByPrimaryKey(id);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public int deleteBatchByPrimaryKey(List<Long> list) {
|
| | | return appPageNotificationMapper.deleteBatchByPrimaryKey(list);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<AppPageNotification> listQuery(long start, int count, String key, Integer show, Integer canClose) {
|
| | | return appPageNotificationMapper.listQuery(start, count, key, show, canClose);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public long countQuery(String key, Integer show, Integer canClose) {
|
| | | return appPageNotificationMapper.countQuery(key, show, canClose);
|
| | | }
|
| | |
|
| | | |
| | | }
|
| | |
| | | package com.yeshi.fanli.service.impl.homemodule;
|
| | |
|
| | | import java.io.InputStream;
|
| | | import java.util.ArrayList;
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | | import java.util.UUID;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | | import javax.transaction.Transactional;
|
| | |
|
| | | import org.apache.commons.beanutils.PropertyUtils;
|
| | | import org.springframework.stereotype.Service;
|
| | | import org.springframework.web.multipart.MultipartFile;
|
| | | import org.yeshi.utils.tencentcloud.COSManager;
|
| | |
|
| | | import com.yeshi.fanli.dao.mybatis.homemodule.HomeNavbarMapper;
|
| | | import com.yeshi.fanli.dao.mybatis.homemodule.SuperHomeNavbarMapper;
|
| | |
| | | import com.yeshi.fanli.entity.system.System;
|
| | | import com.yeshi.fanli.service.inter.config.SystemService;
|
| | | import com.yeshi.fanli.service.inter.homemodule.HomeNavbarService;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | |
|
| | |
|
| | | @Service
|
| | |
| | | @Transactional
|
| | | public int deleteBatchByPrimaryKey(List<Long> list) {
|
| | | superHomeNavbarMapper.deleteBatchByNavbarIds(list);
|
| | | for (Long id: list) {
|
| | | HomeNavbar homeNavbar = homeNavbarMapper.selectByPrimaryKey(id);
|
| | | if (homeNavbar !=null) {
|
| | | // 删除已存在图片 /
|
| | | String picture = homeNavbar.getPicture();
|
| | | if (!StringUtil.isNullOrEmpty(picture)) {
|
| | | COSManager.getInstance().deleteFile(picture);
|
| | | }
|
| | | }
|
| | | }
|
| | | |
| | | return homeNavbarMapper.deleteBatchByPrimaryKey(list);
|
| | | }
|
| | |
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | public List<HomeNavbar> getChangeOrder(Long id, Integer type, Integer order) {
|
| | | return homeNavbarMapper.getChangeOrder(id, type, order);
|
| | | public List<HomeNavbar> getChangeOrder(Integer type, Integer order) {
|
| | | return homeNavbarMapper.getChangeOrder(type, order);
|
| | | }
|
| | |
|
| | | @Override
|
| | |
| | | }
|
| | |
|
| | |
|
| | | |
| | | @Override
|
| | | public void uploadPicture(MultipartFile file, HomeNavbar homeNavbar) throws Exception {
|
| | | |
| | | InputStream inputStream = file.getInputStream();
|
| | | String contentType = file.getContentType();
|
| | | String type = contentType.substring(contentType.indexOf("/") + 1);
|
| | | // 上传文件相对位置
|
| | | String fileUrl="HomeNavbar/"+UUID.randomUUID().toString().replace("-", "") + "." + type;
|
| | | |
| | | /* 修改图片时,先删除已存在图片 */
|
| | | String picture = homeNavbar.getPicture();
|
| | | if (!StringUtil.isNullOrEmpty(picture)) {
|
| | | COSManager.getInstance().deleteFile(picture);
|
| | | }
|
| | | |
| | | String uploadFilePath = COSManager.getInstance().uploadFile(inputStream, fileUrl).getUrl();
|
| | | /* 更新数据库信息 */
|
| | | if (!StringUtil.isNullOrEmpty(uploadFilePath)) {
|
| | | homeNavbar.setUpdatetime(new Date());
|
| | | homeNavbar.setPicture(uploadFilePath);
|
| | | updateByPrimaryKeySelective(homeNavbar);
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | | }
|
| | |
| | | import org.springframework.orm.hibernate4.HibernateCallback;
|
| | | import org.springframework.stereotype.Service;
|
| | | import org.springframework.transaction.annotation.Transactional;
|
| | | import org.yeshi.utils.NumberUtil;
|
| | |
|
| | | import com.yeshi.fanli.dao.mybatis.ThreeSaleMapper;
|
| | | import com.yeshi.fanli.dao.mybatis.UserInfoMapper;
|
| | |
| | | import com.yeshi.fanli.service.inter.hongbao.ThreeSaleSerivce;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import org.yeshi.utils.NumberUtil;
|
| | |
|
| | | @Service
|
| | | public class ThreeSaleSerivceImpl implements ThreeSaleSerivce {
|
| | |
| | | public int updateExpire(List<Long> list){
|
| | | return threeSaleMapper.updateExpire(list);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<ThreeSale> listFirstTeamQuery(long start, int count, Long uid, Integer state, String startTime,
|
| | | String endTime) {
|
| | | return threeSaleMapper.listFirstTeamQuery(start, count, uid, state, startTime, endTime);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public long countFirstTeamQuery(Long uid, Integer state, String startTime, String endTime) {
|
| | | return threeSaleMapper.countFirstTeamQuery(uid, state, startTime, endTime);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<ThreeSale> listSecondTeamQuery(long start, int count, Long uid, Integer state, String startTime,
|
| | | String endTime) {
|
| | | return threeSaleMapper.listSecondTeamQuery(start, count, uid, state, startTime, endTime);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public long countSecondTeamQuery(Long uid, Integer state, String startTime, String endTime) {
|
| | | return threeSaleMapper.countSecondTeamQuery(uid, state, startTime, endTime);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<ThreeSale> listSuperiorQuery(long start, int count, Integer state, Long uid) {
|
| | | return threeSaleMapper.listSuperiorQuery(start, count, state, uid);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public long countSuperiorQuery(Integer state, Long uid) {
|
| | | return threeSaleMapper.countSuperiorQuery(state, uid);
|
| | | }
|
| | | |
| | |
|
| | |
|
| | | }
|
| | |
| | |
|
| | |
|
| | | public List<JumpDetailV2> listJump();
|
| | | |
| | | |
| | | /**
|
| | | * 根据主键批量删除
|
| | | * @param list
|
| | | * @return
|
| | | */
|
| | | int deleteBatchByPrimaryKey(List<Long> list);
|
| | | |
| | | /**
|
| | | * 后端列表查询
|
| | | * @param start
|
| | | * @param count
|
| | | * @param key
|
| | | * @return
|
| | | */
|
| | | List<JumpDetailV2> listQuery(long start, int count, String key);
|
| | | |
| | | long countListQuery(String key);
|
| | |
|
| | | }
|
| | |
| | | */
|
| | | public String getHomeWEEXUrl();
|
| | |
|
| | | /**
|
| | | * 后端查询分页
|
| | | * @param key
|
| | | * @param page
|
| | | * @return
|
| | | */
|
| | | public List<Config> listObjects(String key, int page);
|
| | |
|
| | | /**
|
| | | * 后端查询统计
|
| | | * @param key
|
| | | * @param page
|
| | | * @return
|
| | | */
|
| | | public int getCount(String key, int page);
|
| | |
|
| | | public Config getConfig(long id);
|
| | |
|
| | | }
|
| | |
| | | package com.yeshi.fanli.service.inter.help;
|
| | |
|
| | | import java.util.List;
|
| | |
|
| | | import com.yeshi.fanli.entity.bus.help.AppPageNotification;
|
| | |
|
| | | /**
|
| | |
| | | * @param apn
|
| | | */
|
| | | public void addAppPageNotification(AppPageNotification apn) throws Exception;
|
| | | |
| | | /**
|
| | | * 选择性插入
|
| | | * @param record
|
| | | */
|
| | | public void insertSelective(AppPageNotification record);
|
| | | |
| | | /**
|
| | | * 选择性更新
|
| | | * @param record
|
| | | */
|
| | | public void updateByPrimaryKeySelective(AppPageNotification record);
|
| | | |
| | | /**
|
| | | * 根据主键查询
|
| | | * @param id
|
| | | * @return
|
| | | */
|
| | | public AppPageNotification selectByPrimaryKey(Long id);
|
| | | |
| | | /**
|
| | | * 根据主键批量删除
|
| | | * @param list
|
| | | * @return
|
| | | */
|
| | | public int deleteBatchByPrimaryKey(List<Long> list);
|
| | | |
| | | /**
|
| | | * 后端列表查询
|
| | | * @return
|
| | | */
|
| | | public List<AppPageNotification> listQuery(long start, int count,String key, Integer show, Integer canClose);
|
| | | |
| | | public long countQuery(String key, Integer show, Integer canClose);
|
| | |
|
| | | }
|
| | |
| | |
|
| | | import java.util.List;
|
| | |
|
| | | import org.springframework.web.multipart.MultipartFile;
|
| | |
|
| | | import com.yeshi.fanli.entity.bus.homemodule.HomeNavbar;
|
| | |
|
| | | /**
|
| | |
| | | * @param list
|
| | | * @return
|
| | | */
|
| | | int deleteBatchByPrimaryKey(List<Long> list);
|
| | | public int deleteBatchByPrimaryKey(List<Long> list);
|
| | |
|
| | | /**
|
| | | * 获取最大的排序值
|
| | | * @param card
|
| | | * @return
|
| | | */
|
| | | int getMaxOrder();
|
| | | public int getMaxOrder();
|
| | |
|
| | | /**
|
| | | * 查询交换排序对象
|
| | |
| | | * @param order 排序值
|
| | | * @return
|
| | | */
|
| | | List<HomeNavbar> getChangeOrder(Long id, Integer type, Integer order);
|
| | | public List<HomeNavbar> getChangeOrder(Integer type, Integer order);
|
| | |
|
| | | /**
|
| | | * 后端列表查询
|
| | |
| | | * @param key
|
| | | * @return
|
| | | */
|
| | | List<HomeNavbar> listQuery(long start, int count, String key);
|
| | | public List<HomeNavbar> listQuery(long start, int count, String key);
|
| | |
|
| | | long countlistQuery(String key);
|
| | | public long countlistQuery(String key);
|
| | |
|
| | | /**
|
| | | * 图片上传
|
| | | * @param file
|
| | | * @param homeNavbar
|
| | | * @throws Exception
|
| | | */
|
| | | public void uploadPicture(MultipartFile file, HomeNavbar homeNavbar) throws Exception;
|
| | |
|
| | | }
|
| | |
| | | */
|
| | | public int updateExpire(List<Long> list);
|
| | |
|
| | | /**
|
| | | * 一级查询
|
| | | * @param start
|
| | | * @param count
|
| | | * @param uid
|
| | | * @param startTime
|
| | | * @param endTime
|
| | | * @return
|
| | | */
|
| | | public List<ThreeSale> listFirstTeamQuery(long start, int count, Long uid, Integer state, |
| | | String startTime, String endTime);
|
| | | |
| | | public long countFirstTeamQuery(Long uid, Integer state, String startTime, String endTime);
|
| | |
|
| | | /**
|
| | | * 二级查询
|
| | | * @param start
|
| | | * @param count
|
| | | * @param uid
|
| | | * @param startTime
|
| | | * @param endTime
|
| | | * @return
|
| | | */
|
| | | public List<ThreeSale> listSecondTeamQuery(long start, int count, Long uid, Integer state, |
| | | String startTime,String endTime);
|
| | | |
| | | public long countSecondTeamQuery(Long uid, Integer state, String startTime, String endTime);
|
| | | |
| | | |
| | | /**
|
| | | * 上级查询
|
| | | * @param start
|
| | | * @param count
|
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | | public List<ThreeSale> listSuperiorQuery(long start, int count, Integer state, Long uid);
|
| | | |
| | | public long countSuperiorQuery(Integer state, Long uid);
|
| | | |
| | | }
|