Administrator
2018-11-20 559e188de93bb05d6c37ec1a0d392ec69ed02567
Merge remote-tracking branch 'origin/master'
27个文件已修改
1个文件已添加
1278 ■■■■■ 已修改文件
fanli/src/main/java/com/yeshi/fanli/controller/admin/AppPageNotificationAdminController.java 292 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/admin/ConfigAdminController.java 76 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/admin/ExtractAdminController.java 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/admin/JumpDetailAdminController.java 153 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/admin/PushRecordAdminController.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/admin/TaoBaoGoodsBriefAdminController.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/admin/UserInfoAdminController.java 150 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/admin/homemodule/HomeNavbarAdminController.java 62 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/admin/homemodule/SwiperBannerAdminController.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/ThreeSaleMapper.java 45 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/common/JumpDetailV2Mapper.java 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/help/AppPageNotificationMapper.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/homemodule/HomeNavbarMapper.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/help/AppPageNotification.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/UserInfoMapper.xml 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/common/JumpDetailV2Mapper.xml 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/help/AppPageNotificationMapper.xml 38 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/homemodule/HomeNavbarMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/common/JumpDetailV2ServiceImpl.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/config/ConfigServiceImpl.java 50 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/help/AppPageNotificationServiceImpl.java 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/HomeNavbarServiceImpl.java 45 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/hongbao/ThreeSaleSerivceImpl.java 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/common/JumpDetailV2Service.java 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/config/ConfigService.java 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/help/AppPageNotificationService.java 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/homemodule/HomeNavbarService.java 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/hongbao/ThreeSaleSerivce.java 40 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/admin/AppPageNotificationAdminController.java
New file
@@ -0,0 +1,292 @@
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();
        }
    }
}
fanli/src/main/java/com/yeshi/fanli/controller/admin/ConfigAdminController.java
@@ -7,12 +7,17 @@
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
@@ -47,4 +52,75 @@
        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();
        }
    }
}
fanli/src/main/java/com/yeshi/fanli/controller/admin/ExtractAdminController.java
@@ -1411,4 +1411,34 @@
        
    }
    
    /**
     * 校验用户资金是否异常
     *
     * @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("资金异常"));
        }
    }
}
fanli/src/main/java/com/yeshi/fanli/controller/admin/JumpDetailAdminController.java
@@ -15,6 +15,9 @@
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;
@@ -22,6 +25,7 @@
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")
@@ -96,7 +100,7 @@
    @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();
@@ -119,4 +123,151 @@
        }
    }
    
    /**
     * 新增
     * @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();
        }
    }
}
fanli/src/main/java/com/yeshi/fanli/controller/admin/PushRecordAdminController.java
@@ -64,9 +64,13 @@
                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);
fanli/src/main/java/com/yeshi/fanli/controller/admin/TaoBaoGoodsBriefAdminController.java
@@ -45,6 +45,7 @@
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
@@ -329,8 +330,6 @@
                filter.setKey("女装");
            }
            
            // 折扣价范围下限
            if (startPrice != null)
                filter.setStartPrice(new BigDecimal(startPrice));
@@ -341,17 +340,13 @@
            // 淘客佣金比率下限 如: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);
            }
fanli/src/main/java/com/yeshi/fanli/controller/admin/UserInfoAdminController.java
@@ -29,6 +29,7 @@
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;
@@ -57,6 +58,7 @@
import com.yeshi.fanli.util.HongBaoUtil;
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.TimeUtil;
import org.yeshi.utils.JsonUtil;
@Controller
@@ -1024,8 +1026,154 @@
        }
    }
    
    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());
    }
    
fanli/src/main/java/com/yeshi/fanli/controller/admin/homemodule/HomeNavbarAdminController.java
@@ -6,11 +6,15 @@
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;
@@ -18,13 +22,16 @@
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")
@@ -32,6 +39,9 @@
    @Resource
    private SystemService systemService;
    @Resource
    private AdminUserService adminUserService;
    
    @Resource
    private HomeNavbarService homeNavbarService;
@@ -193,7 +203,7 @@
            }
            
            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);
@@ -300,7 +310,57 @@
            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();
        }
    }
}
fanli/src/main/java/com/yeshi/fanli/controller/admin/homemodule/SwiperBannerAdminController.java
@@ -396,8 +396,8 @@
            
            int maxOrder = swiperPictureService.getMaxOrderByBannerID(bannerId);
            record.setOrder(maxOrder + 1);
            record.setState(0);
            // 默认停用
            record.setState(1);
            record.setCreatetime(new Date());
            record.setUpdatetime(new Date());
            
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/ThreeSaleMapper.java
@@ -78,4 +78,49 @@
     */
    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);
}
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/common/JumpDetailV2Mapper.java
@@ -2,6 +2,8 @@
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.yeshi.fanli.entity.common.JumpDetailV2;
public interface JumpDetailV2Mapper {
@@ -30,5 +32,25 @@
     * @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);
    
}
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/help/AppPageNotificationMapper.java
@@ -1,5 +1,9 @@
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 {
@@ -23,4 +27,20 @@
    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);
}
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/homemodule/HomeNavbarMapper.java
@@ -40,7 +40,7 @@
     * @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);
    
    /**
     * 后端列表查询
fanli/src/main/java/com/yeshi/fanli/entity/bus/help/AppPageNotification.java
@@ -3,7 +3,10 @@
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;
@@ -26,7 +29,7 @@
                "资金"), accountDetail("账户明细"), extract("提现"), orderFanli("返利订单"),orderTiCheng("提成订单"),orderTaoBao("淘宝订单"), coollect("收藏"), scanHistory("足迹"), team(
                        "队员"), kefu("联系客服"), taoBaoShoppingCart("淘宝购物车"), orderFind("订单申诉"), msgCenter("消息中心");
        private final String desc;
        private AppPageNotificationTypeEnum(String desc) {
            this.desc = desc;
        }
@@ -63,6 +66,9 @@
    @Column(name = "an_updatetime")
    private Date updateTime;// 更新时间
    @Transient // 页面名称
    private String pageName;
    public Long getId() {
        return id;
    }
@@ -135,4 +141,12 @@
        this.updateTime = updateTime;
    }
    public String getPageName() {
        return pageName;
    }
    public void setPageName(String pageName) {
        this.pageName = pageName;
    }
}
fanli/src/main/java/com/yeshi/fanli/mapping/UserInfoMapper.xml
@@ -233,7 +233,8 @@
               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}' ]]>  
@@ -277,8 +278,9 @@
           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}' ]]>  
@@ -301,7 +303,8 @@
               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}' ]]>  
fanli/src/main/java/com/yeshi/fanli/mapping/common/JumpDetailV2Mapper.xml
@@ -58,4 +58,27 @@
      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>
fanli/src/main/java/com/yeshi/fanli/mapping/help/AppPageNotificationMapper.xml
@@ -96,4 +96,42 @@
        </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>
fanli/src/main/java/com/yeshi/fanli/mapping/homemodule/HomeNavbarMapper.xml
@@ -72,7 +72,7 @@
  
   <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
fanli/src/main/java/com/yeshi/fanli/service/impl/common/JumpDetailV2ServiceImpl.java
@@ -76,6 +76,20 @@
    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);
    }
    
}
fanli/src/main/java/com/yeshi/fanli/service/impl/config/ConfigServiceImpl.java
@@ -6,6 +6,8 @@
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;
@@ -17,9 +19,8 @@
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 {
@@ -32,6 +33,44 @@
        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) {
@@ -146,5 +185,10 @@
        String value = get("home_weex_url");
        return value;
    }
    @Override
    public Config getConfig(long id) {
        return configDao.find(Config.class, id);
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/help/AppPageNotificationServiceImpl.java
@@ -1,6 +1,7 @@
package com.yeshi.fanli.service.impl.help;
import java.util.Date;
import java.util.List;
import javax.annotation.Resource;
@@ -48,4 +49,35 @@
        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);
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/HomeNavbarServiceImpl.java
@@ -1,13 +1,18 @@
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;
@@ -16,6 +21,7 @@
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
@@ -63,6 +69,17 @@
    @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);
    }
@@ -72,8 +89,8 @@
    }
    @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
@@ -151,7 +168,29 @@
    }
    @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);
        }
    }
    
}
fanli/src/main/java/com/yeshi/fanli/service/impl/hongbao/ThreeSaleSerivceImpl.java
@@ -13,6 +13,7 @@
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;
@@ -24,7 +25,6 @@
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 {
@@ -310,6 +310,39 @@
    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);
    }
    
    
}
fanli/src/main/java/com/yeshi/fanli/service/inter/common/JumpDetailV2Service.java
@@ -40,5 +40,24 @@
    
    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);
}
fanli/src/main/java/com/yeshi/fanli/service/inter/config/ConfigService.java
@@ -67,4 +67,22 @@
     */
    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);
}
fanli/src/main/java/com/yeshi/fanli/service/inter/help/AppPageNotificationService.java
@@ -1,5 +1,7 @@
package com.yeshi.fanli.service.inter.help;
import java.util.List;
import com.yeshi.fanli.entity.bus.help.AppPageNotification;
/**
@@ -32,5 +34,39 @@
     * @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);
}
fanli/src/main/java/com/yeshi/fanli/service/inter/homemodule/HomeNavbarService.java
@@ -2,6 +2,8 @@
import java.util.List;
import org.springframework.web.multipart.MultipartFile;
import com.yeshi.fanli.entity.bus.homemodule.HomeNavbar;
/**
@@ -29,14 +31,14 @@
     * @param list
     * @return
     */
    int deleteBatchByPrimaryKey(List<Long> list);
    public int deleteBatchByPrimaryKey(List<Long> list);
    
    /**
     * 获取最大的排序值
     * @param card
     * @return
     */
    int getMaxOrder();
    public int getMaxOrder();
    
    /**
     * 查询交换排序对象
@@ -44,7 +46,7 @@
     * @param order 排序值
     * @return
     */
    List<HomeNavbar> getChangeOrder(Long id, Integer type, Integer order);
    public List<HomeNavbar> getChangeOrder(Integer type, Integer order);
    
    /**
     * 后端列表查询
@@ -53,8 +55,16 @@
     * @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;
}
fanli/src/main/java/com/yeshi/fanli/service/inter/hongbao/ThreeSaleSerivce.java
@@ -108,4 +108,44 @@
     */
    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);
}