admin
2021-03-20 ad3ac53da1c3a11a96ae62d790aa61a81b9eab91
完善APP首页顶部标签栏兼容,初步处理推送
39个文件已修改
2个文件已添加
4358 ■■■■■ 已修改文件
src/main/java/com/yeshi/buwan/controller/admin/api/HomeBannerController.java 37 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yeshi/buwan/controller/admin/api/HomeRecommendSpecialController.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yeshi/buwan/controller/admin/api/HomeTypeController.java 39 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yeshi/buwan/controller/admin/api/VideoAdminController.java 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yeshi/buwan/controller/api/UserController.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yeshi/buwan/controller/api/VIPController.java 37 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yeshi/buwan/controller/parser/ClassParser.java 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yeshi/buwan/controller/parser/HomeParser.java 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yeshi/buwan/controller/parser/web/WebHomeParser.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yeshi/buwan/dao/recommend/HomeRecommendSpecialDao.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yeshi/buwan/dao/user/LoginUserExtraDao.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yeshi/buwan/dao/video/VideoInfoExtraDao.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yeshi/buwan/domain/push/PushDeviceToken.java 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yeshi/buwan/domain/solr/SolrAlbumVideo.java 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yeshi/buwan/domain/user/LoginUserExtra.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yeshi/buwan/domain/web/HomeTypeAdmin.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yeshi/buwan/dto/push/PushAppsDTO.java 60 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yeshi/buwan/dto/search/SolrVideoSearchFilter.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yeshi/buwan/dto/user/LoginInfoDto.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yeshi/buwan/service/imp/HomeAdService.java 52 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yeshi/buwan/service/imp/HomeTypeService.java 66 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yeshi/buwan/service/imp/LoginUserServiceImpl.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yeshi/buwan/service/imp/SystemService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yeshi/buwan/service/imp/UserService.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yeshi/buwan/service/imp/push/PushDeviceTokenServiceImpl.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yeshi/buwan/service/imp/recommend/HomeRecommendSpecialServiceImpl.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yeshi/buwan/service/inter/LoginUserService.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yeshi/buwan/service/inter/push/PushDeviceTokenService.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yeshi/buwan/service/inter/recommend/HomeRecommendSpecialService.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yeshi/buwan/service/manager/SolrAlbumVideoDataManager.java 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yeshi/buwan/util/factory/SolrVideoFactory.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yeshi/buwan/util/push/PushManager.java 178 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yeshi/buwan/vo/video/VideoAdminInfoVO.java 49 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/admin/new/add-banner.html 730 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/admin/new/add-lmneirong.html 383 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/admin/new/edit-banner.html 793 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/admin/new/edit-lmneirong.html 425 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/admin/new/fenqu.html 29 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/admin/new/tuijian-banner.html 606 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/admin/new/tuijian-lanmuneirong.html 583 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/test/java/com/hxh/spring/test/PPTVTest.java 43 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yeshi/buwan/controller/admin/api/HomeBannerController.java
@@ -2,11 +2,15 @@
import java.io.PrintWriter;
import java.io.Serializable;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
import javax.servlet.http.HttpSession;
import com.yeshi.buwan.domain.recommend.HomeRecommendSpecial;
import com.yeshi.buwan.service.inter.recommend.HomeRecommendSpecialService;
import com.yeshi.buwan.util.SystemUtil;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@@ -38,20 +42,39 @@
    @Resource
    private SpecialService specialService;
    @Resource
    private HomeRecommendSpecialService homeRecommendSpecialService;
    @RequestMapping(value = "/gethomeadlistadmin", method = RequestMethod.POST)
    public void getHomeBannerListAdmin(int page, int detailsystem, String key, HttpSession session, PrintWriter out) {
    public void getHomeBannerListAdmin(int page, int detailsystem, String key,String special, HttpSession session, PrintWriter out) {
        key = StringUtil.isNullOrEmpty(key) ? "" : key;
        String dataKey = null;
        if (special != null && !special.equalsIgnoreCase("0")) {
            HomeRecommendSpecial bean = homeRecommendSpecialService.getSpecial(special);
            if (bean != null) {
                dataKey = bean.getDataKey();
            }
        }
        List<HomeAdAdmin> list = homeAdService.getHomeAdAdmin(key, SystemUtil.getAdminSelectedSystemId(session), detailsystem, page);
        long count = homeAdService.getHomeAdAdminCount(key, SystemUtil.getAdminSelectedSystemId(session), detailsystem);
        List<HomeAdAdmin> list = homeAdService.getHomeAdAdmin(key, SystemUtil.getAdminSelectedSystemId(session), detailsystem,dataKey, page);
        long count = homeAdService.getHomeAdAdminCount(key, SystemUtil.getAdminSelectedSystemId(session), detailsystem,dataKey);
        PageEntity pe = new PageEntity();
        pe.setPageIndex(page);
        pe.setPageSize(Constant.pageCount);
        pe.setTotalCount((int) count);
        JSONArray array = new JSONArray();
        Gson gson = new GsonBuilder().create();
        Map<String, HomeRecommendSpecial> specialMap = new HashMap<>();
        for (HomeAdAdmin ht : list) {
            String specialDataKey = ht.getHomeAd().getHomeAd().getSpecialDataKey();
            if (specialMap.get(specialDataKey) == null) {
                specialMap.put(specialDataKey, homeRecommendSpecialService.getSpecialByDataKey(specialDataKey));
            }
            JSONObject root = new JSONObject();
            ht.getHomeAd().getHomeAd().setSystem(null);
            ht.getHomeAd().getHomeAd().setTag(null);
@@ -64,6 +87,7 @@
                darray.add(gson.toJson(dss));
            }
            root.put("detailSystemList", darray);
            root.put("special", specialMap.get(specialDataKey));
            array.add(root);
        }
@@ -120,7 +144,7 @@
                linkValue = ht.getVideo().getId();
                break;
            case 2:
                linkValue = JSONObject.fromObject(ht.getParams()).optString("id");
                linkValue = JSONObject.fromObject(ht.getParams()).optString("url");
                break;
            case 3:
                linkValue = JSONObject.fromObject(ht.getParams()).optString("id");
@@ -147,6 +171,7 @@
        ht.setLinkType(homeAd.getLinkType());
        ht.setOrderby(homeAd.getOrderby());
        ht.setPicture(homeAd.getPicture());
        ht.setSpecialDataKey(homeAd.getSpecialDataKey());
        if (homeAd.getLinkType() == 1) {
            ht.setVideo(new VideoInfo(linkValue));
        } else if (homeAd.getLinkType() == 2) {
@@ -176,7 +201,7 @@
    }
    @RequestMapping(value = "/addhomead", method = RequestMethod.POST)
    public void addHomeAd(HomeAd homeAd, String linkValue, String detailsystemids, PrintWriter out) {
    public void addHomeAd(HomeAd homeAd, String linkValue, String detailsystemids,HttpSession session, PrintWriter out) {
        if (homeAd.getLinkType() == 1) {
            homeAd.setVideo(new VideoInfo(linkValue));
        } else if (homeAd.getLinkType() == 2) {
@@ -197,7 +222,7 @@
            homeAd.setParams(obj.toString());
        }
        homeAd.setCreatetime(System.currentTimeMillis() + "");
        homeAd.setSystem(SystemUtil.getAdminSelectedSystem(session));
        Serializable id = homeAdService.addHomeAd(homeAd);
        if (id != null && !StringUtil.isNullOrEmpty(detailsystemids)) {
src/main/java/com/yeshi/buwan/controller/admin/api/HomeRecommendSpecialController.java
@@ -171,6 +171,12 @@
        JSONObject object = new JSONObject();
        try {
            homeRecommendSpecialService.updateSpecial(special);
            //拉取super
            List<SuperHomeRecommendSpecial> superSpecialList = homeRecommendSpecialService.listSuperSpecialBySpecialId(id);
            for (SuperHomeRecommendSpecial s : superSpecialList) {
                s.setShowName(special.getName());
                homeRecommendSpecialService.updateSuperSpecial(s);
            }
            object.put("code", 0);
        } catch (Exception e) {
            object.put("code", 1);
src/main/java/com/yeshi/buwan/controller/admin/api/HomeTypeController.java
@@ -3,12 +3,16 @@
import java.io.PrintWriter;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
import javax.servlet.http.HttpSession;
import javax.validation.Valid;
import com.yeshi.buwan.domain.recommend.HomeRecommendSpecial;
import com.yeshi.buwan.service.inter.recommend.HomeRecommendSpecialService;
import com.yeshi.buwan.util.SystemUtil;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
@@ -39,6 +43,9 @@
    @Resource
    private HomeTypeService homeTypeService;
    @Resource
    private HomeRecommendSpecialService homeRecommendSpecialService;
    @RequestMapping(value = "/gethometypelist", method = RequestMethod.POST)
    public void getHomeTypeList(HttpSession session, PrintWriter out) {
        List<HomeType> list = homeTypeService.getHomeTypeList(SystemUtil.getAdminSelectedSystemId(session));
@@ -59,11 +66,26 @@
    }
    @RequestMapping(value = "/gethometypelistadmin", method = RequestMethod.POST)
    public void getHomeTypeListAdmin(int page, int detailsystem, String key, HttpSession session, PrintWriter out) {
    public void getHomeTypeListAdmin(int page, int detailsystem, String special, String key, HttpSession session, PrintWriter out) {
        key = StringUtil.isNullOrEmpty(key) ? "" : key;
        String dataKey = null;
        if (special != null && !special.equalsIgnoreCase("0")) {
            HomeRecommendSpecial bean = homeRecommendSpecialService.getSpecial(special);
            if (bean != null) {
                dataKey = bean.getDataKey();
            }
        }
        List<HomeTypeAdmin> list = homeTypeService.getHomeTypeAdmin(key, SystemUtil.getAdminSelectedSystemId(session), detailsystem, page);
        long count = homeTypeService.getHomeTypeAdminCount(key, SystemUtil.getAdminSelectedSystemId(session), detailsystem);
        List<HomeTypeAdmin> list = homeTypeService.getHomeTypeAdmin(key, SystemUtil.getAdminSelectedSystemId(session), dataKey, detailsystem, page);
        //拉取标签
        Map<String, HomeRecommendSpecial> specialMap = new HashMap<>();
        long count = homeTypeService.getHomeTypeAdminCount(key, SystemUtil.getAdminSelectedSystemId(session), detailsystem, dataKey);
        PageEntity pe = new PageEntity();
        pe.setPageIndex(page);
        pe.setPageSize(Constant.pageCount);
@@ -71,6 +93,13 @@
        JSONArray array = new JSONArray();
        Gson gson = new GsonBuilder().create();
        for (HomeTypeAdmin ht : list) {
            String specialDataKey = ht.getHomeType().getHomeType().getSpecialDataKey();
            if (specialMap.get(specialDataKey) == null) {
                specialMap.put(specialDataKey, homeRecommendSpecialService.getSpecialByDataKey(specialDataKey));
            }
            ht.setSpecial(specialMap.get(specialDataKey));
            JSONObject root = new JSONObject();
            ht.getHomeType().getHomeType().getSystem().setAdmin(null);
            root.put("homeType", gson.toJson(ht.getHomeType().getHomeType()));
@@ -80,6 +109,7 @@
                darray.add(gson.toJson(dss));
            }
            root.put("detailSystemList", darray);
            root.put("special", specialMap.get(specialDataKey));
            array.add(root);
        }
@@ -180,7 +210,8 @@
        ht.setNumber(homeType.getNumber());
        ht.setOrderby(homeType.getOrderby());
        ht.setParams(homeType.getParams());
        ht.setVideoType(homeType.getVideoType());
//        ht.setVideoType(homeType.getVideoType());
        ht.setSpecialDataKey(homeType.getSpecialDataKey());
        homeTypeService.updateHomeType(ht);
        JSONObject object = new JSONObject();
        object.put("code", 0);
src/main/java/com/yeshi/buwan/controller/admin/api/VideoAdminController.java
@@ -92,7 +92,7 @@
    }
    @RequestMapping(value = "/videolist", method = RequestMethod.POST)
    public void videoList(int videotype, int page, String key, String type, String resourceIds, int contenttype, String freeType, PrintWriter out) {
    public void videoList(int videotype, int page, String key, String type, String resourceIds, int contenttype, String freeType, String area, PrintWriter out) {
        if (StringUtil.isNullOrEmpty(type)) {
            type = "name";
@@ -139,6 +139,8 @@
            filter.setFreeType(freeTypeInt);
            filter.setArea(StringUtil.isNullOrEmpty(area) ? null : area.trim());
            SolrResultDTO dto = solrAlbumDataManager.find(filter, page, Constant.pageCount);
            if (dto.getVideoList() != null)
                for (SolrAlbumVideo videoInfo : (List<SolrAlbumVideo>) dto.getVideoList())
@@ -170,8 +172,16 @@
        for (VideoAdminInfoVO a : voList) {
            VideoInfoExtra extra = maps.get(a.getId());
            if (extra != null) {
                if (!StringUtil.isNullOrEmpty(extra.gethPosterPicture()))
                    a.setPicture(extra.gethPosterPicture());
                if (a.getHpicture() != null) {
                    if (!StringUtil.isNullOrEmpty(extra.gethPosterPicture()))
                        a.setHpicture(extra.gethPosterPicture());
                }
                if (a.getVpicture() != null) {
                    if (!StringUtil.isNullOrEmpty(extra.getvPosterPicture()))
                        a.setVpicture(extra.getvPosterPicture());
                }
            }
        }
src/main/java/com/yeshi/buwan/controller/api/UserController.java
@@ -9,6 +9,7 @@
import com.yeshi.buwan.service.inter.vip.VIPService;
import com.yeshi.buwan.util.JsonUtil;
import com.yeshi.buwan.util.StringUtil;
import com.yeshi.buwan.util.ThreadUtil;
import com.yeshi.buwan.util.factory.vo.UserInfoVOFactory;
import com.yeshi.buwan.vo.AcceptData;
import com.yeshi.buwan.vo.client.user.UserInfoVO;
@@ -54,6 +55,15 @@
        UserVIPInfo vipInfo = vipService.getVIPInfo(loginUid);
        UserInfoVO vo = UserInfoVOFactory.create(loginUser, extra, vipInfo);
        //线程执行设备信息更新
        ThreadUtil.run(new Runnable() {
            @Override
            public void run() {
                loginUserService.setUtdId(loginUid, acceptData.getUtdId());
            }
        });
        return JsonUtil.loadTrueJson(new Gson().toJson(vo));
    }
src/main/java/com/yeshi/buwan/controller/api/VIPController.java
@@ -28,6 +28,7 @@
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.lang.reflect.Type;
import java.util.Date;
import java.util.List;
import java.util.UUID;
@@ -92,6 +93,42 @@
        return JsonUtilV2.loadTrueJson(root.toString());
    }
    @RequestMapping("getVIPOrderList")
    @ResponseBody
    public String getVIPOrderList(AcceptData acceptData, String loginUid, int page) {
        Gson gson = new GsonBuilder().registerTypeAdapter(VIPPriceType.class, new JsonSerializer<VIPPriceType>() {
            @Override
            public JsonElement serialize(VIPPriceType value, Type theType, JsonSerializationContext context) {
                if (value == null) {
                    return new JsonPrimitive("");
                } else {
                    return new JsonPrimitive(value.getName());
                }
            }
        }).registerTypeAdapter(Date.class, new JsonSerializer<Date>() {
            @Override
            public JsonElement serialize(Date value, Type theType, JsonSerializationContext context) {
                if (value == null) {
                    return new JsonPrimitive("");
                } else {
                    return new JsonPrimitive(TimeUtil.getGernalTime(value.getTime(), "yyyy.MM.dd HH:mm"));
                }
            }
        }).create();
        JSONObject root = new JSONObject();
        List<VIPOrderRecord> list = vipService.listOrderRecord(loginUid, null, page, Constant.pageCount);
        for (VIPOrderRecord record : list) {
            record.setIpInfo(null);
            record.setUpdateTime(null);
        }
        long count = vipService.countOrderRecord(loginUid, null);
        root.put("list", gson.toJson(list));
        root.put("count", count);
        return JsonUtilV2.loadTrueJson(root.toString());
    }
    /**
     * 生成订单
     *
src/main/java/com/yeshi/buwan/controller/parser/ClassParser.java
@@ -4,6 +4,7 @@
import com.yeshi.buwan.domain.ad.CommonAd;
import com.yeshi.buwan.domain.ad.CommonAdPositionAd;
import com.yeshi.buwan.domain.recommend.CategoryRecommendVideo;
import com.yeshi.buwan.domain.recommend.HomeRecommendSpecial;
import com.yeshi.buwan.domain.special.Special;
import com.yeshi.buwan.domain.system.DetailSystem;
import com.yeshi.buwan.dto.search.SolrResultDTO;
@@ -11,6 +12,7 @@
import com.yeshi.buwan.pptv.PPTVUtil;
import com.yeshi.buwan.service.imp.*;
import com.yeshi.buwan.service.imp.recommend.CategoryRecommendVideoService;
import com.yeshi.buwan.service.inter.recommend.HomeRecommendSpecialService;
import com.yeshi.buwan.service.manager.SolrAlbumVideoDataManager;
import com.yeshi.buwan.service.manager.SolrCommonVideoDataManager;
import com.yeshi.buwan.util.*;
@@ -69,6 +71,9 @@
    @Resource
    private SearchService searchService;
    @Resource
    private HomeRecommendSpecialService homeRecommendSpecialService;
    @RequireUid
    public void getClass(AcceptData acceptData, HttpServletRequest request, PrintWriter out) {
@@ -295,17 +300,24 @@
            vo.setShowTitle(type.getShowTitle());
            vo.setType(type.getType());
            vo.setCategoryType(type.getCategoryType());
            typelist.add(vo);
            //删除老版本中的除开分类的顶部标签
            if (sv.getType().getId() != 309L && sv.getType().getId() != 310L)
                typelist.add(vo);
        }
        typelist.get(0).setDataKey("recommend");
        HomeClassVO vo = new HomeClassVO();
        vo.setDataType(HomeClassVO.DATA_TYPE_NOVEL);
        vo.setName("小说");
        typelist.add(1, vo);
        //获取首页推荐标签
        List<HomeRecommendSpecial> specialList = homeRecommendSpecialService.listSpecialByDetailSystemId(acceptData.getDetailSystem().getId(), null, 1, Constant.pageCount);
        if (specialList != null) {
            for (int i = specialList.size() - 1; i >= 0; i--) {
                HomeRecommendSpecial special = specialList.get(i);
                HomeClassVO vo = new HomeClassVO();
                vo.setId(Long.parseLong(special.getId()));
                vo.setName(special.getName());
                vo.setShowTitle(special.getName());
                vo.setDataKey(special.getDataKey());
                vo.setDataType(HomeClassVO.DATA_TYPE_RECOMMEND);
                typelist.add(0, vo);
            }
        }
        JSONObject object = new JSONObject();
        object.put("count", (new StringBuilder(String.valueOf(typelist.size()))).toString());
@@ -314,7 +326,6 @@
            array.add(StringUtil.outPutResultJson(typelist.get(j)));
        object.put("data", array);
        out.print(JsonUtil.loadTrueJson(object.toString()));
    }
src/main/java/com/yeshi/buwan/controller/parser/HomeParser.java
@@ -12,6 +12,7 @@
import com.yeshi.buwan.domain.*;
import com.yeshi.buwan.domain.jump.JumpDetail;
import com.yeshi.buwan.domain.jump.JumpTypeEnum;
import com.yeshi.buwan.domain.recommend.HomeRecommendSpecial;
import com.yeshi.buwan.domain.system.DetailSystemConfig;
import com.yeshi.buwan.domain.system.DetailSystem;
import com.yeshi.buwan.domain.video.VideoWatchHistory;
@@ -19,6 +20,7 @@
import com.yeshi.buwan.pptv.entity.PPTVSeries;
import com.yeshi.buwan.service.imp.*;
import com.yeshi.buwan.service.inter.juhe.PPTVService;
import com.yeshi.buwan.service.inter.recommend.HomeRecommendSpecialService;
import com.yeshi.buwan.service.inter.video.VideoWatchHistoryService;
import com.yeshi.buwan.util.*;
import com.yeshi.buwan.util.annotation.RequireUid;
@@ -83,17 +85,23 @@
    @Resource
    private VideoWatchHistoryService videoWatchHistoryService;
    @Resource
    private HomeRecommendSpecialService homeRecommendSpecialService;
    private final Logger userPlayLogger = LoggerFactory.getLogger("videoPlayUser");
    @RequireUid
    public void getHomeAd(AcceptData acceptData, HttpServletRequest request, PrintWriter out) {
        String vtid = request.getParameter("Vtid");
        if (!"310".equals(vtid)) {
        HomeRecommendSpecial special = homeRecommendSpecialService.getSpecial(vtid);
        //兼容新版本
        if (special != null) {
            JSONObject object = new JSONObject();
            DetailSystem detailSystem = systemService.getDetailSystemByPackage(acceptData.getPackageName());
            List<HomeAd> list = homeAdService.getHomeAdList(detailSystem);
            List<HomeAd> list = homeAdService.getHomeAdList(detailSystem, special != null ? special.getDataKey() : null);
            if (acceptData.getPlatform().equalsIgnoreCase("ios"))// IOS测试
            {
@@ -119,7 +127,6 @@
                for (int i = 0; i < list.size(); i++)
                    array.add(StringUtil.outPutResultJson(list.get(i)));
                object.put("data", array);
            } else {
                for (HomeAd ad : list) {
                    if (ad.getVideo() != null) {
@@ -137,6 +144,7 @@
                object.put("data", array);
            }
            object.put("bannerSizeRate", special.getBannerSizeRate());
            out.print(JsonUtil.loadTrueJson(object.toString()));
        } else {
            classParser.getRecommendCategoryVideoBanner(acceptData, request, out);
@@ -156,12 +164,14 @@
            vtid = "309"; // 为了兼容以前的推荐
        }
        HomeRecommendSpecial special = homeRecommendSpecialService.getSpecial(vtid);
        DetailSystem detailSystem = systemService.getDetailSystemByPackage(acceptData.getPackageName());
        JSONObject object = new JSONObject();
        List<Long> resourceList = videoResouceUtil.getAvailableResourceIds(acceptData.getDetailSystem(), acceptData.getVersion());
        List<HomeType> list1 = homeTypeService.getHomeType(detailSystem.getId(), resourceList,
                CacheUtil.getMD5Long(resourceList), -1, Long.parseLong(vtid));
                CacheUtil.getMD5Long(resourceList), -1, special != null ? special.getDataKey() : null);
        List<HomeType> list = new ArrayList<>();
        for (HomeType ht : list1)
            list.add(ht);
@@ -201,7 +211,7 @@
                    if (adContent != null && adPosition != null) {
                        HomeType.HomeTypeAd ad = new Gson().fromJson(adContent.getValue(), HomeType.HomeTypeAd.class);
                        int adP = Integer.parseInt(adPosition.getValue());
                        if (adP < list.size()) {
                        if (adP < list.size() && adP > -1) {
                            HomeType homeType = new HomeType();
                            homeType.setAd(ad);
                            list.add(adP, homeType);
src/main/java/com/yeshi/buwan/controller/parser/web/WebHomeParser.java
@@ -148,7 +148,7 @@
        DetailSystem detailSystem = systemService.getDetailSystemByPackage(packageName);
        List<HomeAd> list = homeAdService.getHomeAdList(detailSystem);
        List<HomeAd> list = homeAdService.getHomeAdList(detailSystem,"recommend");
        for (HomeAd ad : list) {
            if (ad.getVideo() != null) {
@@ -192,7 +192,7 @@
        List<Long> resourceList = videoResouceUtil.getAvailableResourceIds(new DetailSystem("44"), 1);
        List<HomeType> list1 = homeTypeService.getHomeType(detailsystemid, resourceList,
                CacheUtil.getMD5Long(resourceList), 10, 309);
                CacheUtil.getMD5Long(resourceList), 10, "recommend");
        List<HomeType> list = new ArrayList<>();
        for (HomeType ht : list1)
            list.add(ht);
src/main/java/com/yeshi/buwan/dao/recommend/HomeRecommendSpecialDao.java
@@ -66,6 +66,12 @@
        return findList(query);
    }
    public HomeRecommendSpecial selectByDataKey(String dataKey) {
        Query query = new Query();
        query.addCriteria(Criteria.where("dataKey").is(dataKey));
        return findOne(query);
    }
    public long count(DaoQuery daoQuery) {
        Query query = getQuery(daoQuery);
src/main/java/com/yeshi/buwan/dao/user/LoginUserExtraDao.java
@@ -64,6 +64,9 @@
        if (bean.getPptvOpenId() != null) {
            update.set("pptvOpenId", bean.getPptvOpenId());
        }
        if (bean.getUtdId() != null) {
            update.set("utdId", bean.getUtdId());
        }
        if (bean.getCreateTime() != null) {
            update.set("createTime", bean.getCreateTime());
src/main/java/com/yeshi/buwan/dao/video/VideoInfoExtraDao.java
@@ -48,6 +48,8 @@
        for (String id : ids) {
            whereList.add(Criteria.where("id").is(id));
        }
        if (whereList.size() == 0)
            return new ArrayList<>();
        Criteria[] wheres = new Criteria[whereList.size()];
        whereList.toArray(wheres);
        Query query = new Query();
src/main/java/com/yeshi/buwan/domain/push/PushDeviceToken.java
@@ -9,18 +9,19 @@
@Document(collection = "pushDeviceToken")
public class PushDeviceToken {
    public final static String TYPE_HUAWEI = "hw";
    public final static String TYPE_OPPO = "oppo";
    public final static String TYPE_VIVO = "vivo";
    public final static String TYPE_XM = "xm";
    public final static String TYPE_MZ = "mz";
    public enum PushPlatform {
        xm, hw, oppo, vivo, mz;
    }
    @Id
    private String id;
    private String detailSystemId;
    private String utdId;
    @Indexed
    private String type;
    private PushPlatform type;
    private String token;
    private Date createTime;
    private Date updateTime;
@@ -102,11 +103,11 @@
    }
    public String getType() {
    public PushPlatform getType() {
        return type;
    }
    public void setType(String type) {
    public void setType(PushPlatform type) {
        this.type = type;
    }
src/main/java/com/yeshi/buwan/domain/solr/SolrAlbumVideo.java
@@ -17,7 +17,6 @@
    public final static int FREE_TYPE_COUPON = 2;
    @Field
    private String id;
    @Field
@@ -59,6 +58,8 @@
    @Field
    private String name;
    @Field
    private String nameStr;
    @Field
    private String updatetime;
    @Field
    private long updateTime;
@@ -75,7 +76,13 @@
    private int freeType;//免费类型
    public String getNameStr() {
        return nameStr;
    }
    public void setNameStr(String nameStr) {
        this.nameStr = nameStr;
    }
    public long getUpdateTime() {
        return updateTime;
src/main/java/com/yeshi/buwan/domain/user/LoginUserExtra.java
@@ -32,8 +32,14 @@
    private String pptvUid;
    private String pptvOpenId;
    //设备唯一标识
    private String utdId;
    private Date createTime;
    private Date updateTime;
    public LoginUserExtra() {
@@ -194,4 +200,12 @@
    public void setPptvOpenId(String pptvOpenId) {
        this.pptvOpenId = pptvOpenId;
    }
    public String getUtdId() {
        return utdId;
    }
    public void setUtdId(String utdId) {
        this.utdId = utdId;
    }
}
src/main/java/com/yeshi/buwan/domain/web/HomeTypeAdmin.java
@@ -3,6 +3,7 @@
import java.util.List;
import com.yeshi.buwan.domain.SuperHomeType;
import com.yeshi.buwan.domain.recommend.HomeRecommendSpecial;
/**
 * 首页顶部Banner
@@ -13,6 +14,9 @@
public class HomeTypeAdmin {
    private SuperHomeType homeType;
    private List<DetailSystemSelect> detailSystemList;
    private HomeRecommendSpecial special;
    public HomeTypeAdmin(SuperHomeType homeType,
            List<DetailSystemSelect> detailSystemList) {
@@ -21,6 +25,14 @@
        this.detailSystemList = detailSystemList;
    }
    public HomeRecommendSpecial getSpecial() {
        return special;
    }
    public void setSpecial(HomeRecommendSpecial special) {
        this.special = special;
    }
    public SuperHomeType getHomeType() {
        return homeType;
    }
src/main/java/com/yeshi/buwan/dto/push/PushAppsDTO.java
New file
@@ -0,0 +1,60 @@
package com.yeshi.buwan.dto.push;
import org.yeshi.utils.push.entity.PushAppInfo;
import java.util.List;
public class PushAppsDTO {
    //小米
    private List<PushAppInfo> xmInfos;
    //华为
    private List<PushAppInfo>  hwInfos;
    //oppo
    private List<PushAppInfo>  oppoInfos;
    //vivo
    private List<PushAppInfo>  vivoInfos;
    //魅族
    private List<PushAppInfo>  mzInfos;
    public List<PushAppInfo> getXmInfos() {
        return xmInfos;
    }
    public void setXmInfos(List<PushAppInfo> xmInfos) {
        this.xmInfos = xmInfos;
    }
    public List<PushAppInfo> getHwInfos() {
        return hwInfos;
    }
    public void setHwInfos(List<PushAppInfo> hwInfos) {
        this.hwInfos = hwInfos;
    }
    public List<PushAppInfo> getOppoInfos() {
        return oppoInfos;
    }
    public void setOppoInfos(List<PushAppInfo> oppoInfos) {
        this.oppoInfos = oppoInfos;
    }
    public List<PushAppInfo> getVivoInfos() {
        return vivoInfos;
    }
    public void setVivoInfos(List<PushAppInfo> vivoInfos) {
        this.vivoInfos = vivoInfos;
    }
    public List<PushAppInfo> getMzInfos() {
        return mzInfos;
    }
    public void setMzInfos(List<PushAppInfo> mzInfos) {
        this.mzInfos = mzInfos;
    }
}
src/main/java/com/yeshi/buwan/dto/search/SolrVideoSearchFilter.java
@@ -7,6 +7,8 @@
    //导演
    private String director;
    private String area;
    private Integer contentType;
    private Integer videoType;
    private String[] resourceIds;
@@ -78,4 +80,12 @@
    public void setFreeType(Integer freeType) {
        this.freeType = freeType;
    }
    public String getArea() {
        return area;
    }
    public void setArea(String area) {
        this.area = area;
    }
}
src/main/java/com/yeshi/buwan/dto/user/LoginInfoDto.java
@@ -15,8 +15,17 @@
    //注册时使用
    private String ipInfo;
    private String nickName;
    private String utdId;
    public String getUtdId() {
        return utdId;
    }
    public void setUtdId(String utdId) {
        this.utdId = utdId;
    }
    public String getIpInfo() {
        return ipInfo;
    }
src/main/java/com/yeshi/buwan/service/imp/HomeAdService.java
@@ -22,6 +22,7 @@
import com.yeshi.buwan.domain.web.DetailSystemSelect;
import com.yeshi.buwan.domain.web.HomeAdAdmin;
import com.yeshi.buwan.util.Constant;
import org.yeshi.utils.StringUtil;
@Service
public class HomeAdService {
@@ -36,10 +37,9 @@
        return list;
    }
    @Cacheable(value = "homeCache", key = "'getHomeAdList'+'-'+#detailSystem.id")
    public List<HomeAd> getHomeAdList(DetailSystem detailSystem) {
        List<HomeAd> list = homeAdDao.list("select h.homeAd from SuperHomeAd h where h.detailSystem.id="
                + detailSystem.getId() + " order by h.homeAd.orderby desc");
    @Cacheable(value = "homeCache", key = "'getHomeAdList'+'-'+#detailSystem.id+'-'+#dataKey")
    public List<HomeAd> getHomeAdList(DetailSystem detailSystem,String dataKey) {
        List<HomeAd> list = homeAdDao.list("select h.homeAd from SuperHomeAd h where h.detailSystem.id=? and h.homeAd.specialDataKey=? order by h.homeAd.orderby desc",detailSystem.getId(),dataKey);
        return list;
    }
@@ -136,19 +136,28 @@
    // 后台操作
    @SuppressWarnings("unchecked")
    public List<HomeAdAdmin> getHomeAdAdmin(final String key, final String systemId, final int detailSystem, final int page) {
    public List<HomeAdAdmin> getHomeAdAdmin(final String key, final String systemId, final int detailSystem, final String dataKey, final int page) {
        return (List<HomeAdAdmin>) homeAdDao.excute(new HibernateCallback<List<HomeAdAdmin>>() {
            public List<HomeAdAdmin> doInHibernate(Session session) throws HibernateException {
                List<HomeAdAdmin> zhiBoClassList = new ArrayList<>();
                try {
                    List<DetailSystem> detailSystemList = session.createQuery("from DetailSystem ds where ds.system.id=" + systemId).list();
                    String sql = "";
                    if (detailSystem > 0)
                        sql = "select sh.homeAd from SuperHomeAd sh where  sh.detailSystem.id=" + detailSystem
                                + " order by  sh.homeAd.createtime desc";
                    else
                        sql = "from HomeAd zb where zb.system.id=" + systemId + " order by zb.createtime desc";
                    List<String> andList = new ArrayList<>();
                    if (detailSystem > 0) {
                        andList.add("sh.detailSystem.id=" + detailSystem);
                        if (dataKey != null) {
                            andList.add("sh.homeAd.specialDataKey='" + dataKey + "'");
                        }
                        sql = "select sh.homeAd from SuperHomeAd sh where  " + StringUtil.concat(andList, " and ") + " order by  sh.homeAd.createtime desc";
                    } else {
                        andList.add("zb.system.id=" + systemId);
                        if (dataKey != null) {
                            andList.add("zb.specialDataKey='" + dataKey + "'");
                        }
                        sql = "from HomeAd zb where " + StringUtil.concat(andList, " and ") + " order by zb.createtime desc";
                    }
                    List<HomeAd> list = session.createQuery(sql).setFirstResult((page - 1) * Constant.pageCount)
                            .setMaxResults(Constant.pageCount).list();
                    for (HomeAd vb : list) {
@@ -188,13 +197,24 @@
        });
    }
    public long getHomeAdAdminCount(String key, String systemId, int detailSystem) {
    public long getHomeAdAdminCount(String key, String systemId, int detailSystem, String dataKey) {
        String sql = "";
        if (detailSystem > 0)
            sql = "select count(*) from  (select count(*) from wk_video_super_homead zb left join wk_video_homead c on c.id=zb.homeadid where zb.detailsystemid="
                    + detailSystem + " group by zb.homeadid) s";
        else
            sql = "select count(*) from  wk_video_homead where system="+systemId;
        List<String> andList = new ArrayList<>();
        if (detailSystem > 0) {
            andList.add("zb.detailsystemid=" + detailSystem);
            if (dataKey != null) {
                andList.add("c.special_data_key='" + dataKey + "'");
            }
            sql = "select count(*) from  (select count(*) from wk_video_super_homead zb left join wk_video_homead c on c.id=zb.homeadid where " + StringUtil.concat(andList, " and ") + " group by zb.homeadid) s";
        } else {
            andList.add("system=" + systemId);
            if (dataKey != null) {
                andList.add("special_data_key='" + dataKey + "'");
            }
            sql = "select count(*) from  wk_video_homead where " + StringUtil.concat(andList, " and ");
        }
        return homeAdDao.getCountSQL(sql);
    }
src/main/java/com/yeshi/buwan/service/imp/HomeTypeService.java
@@ -49,9 +49,9 @@
    }
    @SuppressWarnings("unchecked")
    @Cacheable(value = "homeCache", key = "'getHomeType'+'-'+#detailSystem+'-'+#cacheMd5+'-'+#maxNumber+'-'+#vtid")
    @Cacheable(value = "homeCache", key = "'getHomeType'+'-'+#detailSystem+'-'+#cacheMd5+'-'+#maxNumber+'-'+#dataKey")
    public List<HomeType> getHomeType(final String detailSystem, final List<Long> resourceIds, String cacheMd5,
                                      final int maxNumber, final long vtid) {
                                      final int maxNumber, final String dataKey) {
        List<HomeType> homeTypeList = (List<HomeType>) homeTypeDao.excute(new HibernateCallback<List<HomeType>>() {
            public List<HomeType> doInHibernate(Session session) throws HibernateException {
@@ -67,8 +67,8 @@
                                    .createSQLQuery(
                                            "SELECT  ht.`id` as htid,ht.`name` as htname,ht.`columns` as htcolumns ,ht.`hasmore`,ht.`activity` ,ht.`params` ,ht.`ioscontrol`,ht.number,hvideo.id as hvid,hvideo.`videoid` AS hvvideoid,hvideo.`picture`as hvpicture ,hvideo.`tag` as hvtag,    v.`id` as vid ,v.`picture` as vpicture ,v.`name` as vname ,v.`tag` as vtag ,v.`hpicture` as vhpicture ,v.`latest_hpicture` as vlatest_hpicture ,v.`watchcount` as vwatchcount,v.commentcount,ht.icon as hicon,ht.orderby as htorder,hvideo.orderby as hvorder,need_ad FROM   (SELECT hv.* FROM `wk_resource_video` rv LEFT JOIN `wk_video_homevideo` hv ON rv.`videoid` =hv.`videoid` LEFT JOIN  `wk_video_video` v ON v.`id` =hv.`videoid`  LEFT JOIN `wk_video_banquan_video` bv ON bv.`videoid`=hv.`videoid` AND bv.`detailsystemid`="
                                                    + detailSystem
                                                    + " AND bv.`show`=1 LEFT JOIN `wk_video_hometype` ht ON ht.id=hv.hometype WHERE (hv.`id`>0 AND v.`show` =1  AND ht.vtid='"
                                                    + vtid + "'  AND (" + resourceWhere
                                                    + " AND bv.`show`=1 LEFT JOIN `wk_video_hometype` ht ON ht.id=hv.hometype WHERE (hv.`id`>0 AND v.`show` =1  AND ht.special_data_key='"
                                                    + dataKey + "'  AND (" + resourceWhere
                                                    + " ) AND bv.`videoid` IS NULL ) GROUP BY (hv.`id`) ORDER BY hv.`orderby` desc,v.createtime DESC ) hvideo LEFT JOIN  `wk_video_super_hometype` sht  ON sht.`hometypeid`=hvideo.hometype LEFT JOIN `wk_video_hometype` ht  ON sht.`hometypeid` =ht.`id` LEFT JOIN wk_video_video v ON v.`id`=hvideo.videoid  WHERE sht.`detailsystemid` =" + detailSystem + " ORDER BY hvideo.`orderby` DESC,v.orderby desc,v.updatetime desc")
                                    .list();
                            List<HomeType> homeTypeList = new ArrayList<>();
@@ -85,7 +85,7 @@
                                ht.setNumber(Integer.parseInt(obj[7] + ""));
                                ht.setOrderby(obj[21] + "");
                                ht.setNeedAd(Boolean.parseBoolean(obj[23]+""));
                                ht.setNeedAd(Boolean.parseBoolean(obj[23] + ""));
                                HomeVideo hv = new HomeVideo();
                                hv.setId(obj[8] + "");
@@ -438,7 +438,7 @@
     */
    @SuppressWarnings("unchecked")
    public List<HomeTypeAdmin> getHomeTypeAdmin(final String key, final String systemId, final int detailSystem, final int page) {
    public List<HomeTypeAdmin> getHomeTypeAdmin(final String key, final String systemId, final String dataKey, final int detailSystem, final int page) {
        return (List<HomeTypeAdmin>) homeTypeDao.excute(new HibernateCallback<List<HomeTypeAdmin>>() {
            public List<HomeTypeAdmin> doInHibernate(Session session) throws HibernateException {
@@ -446,12 +446,22 @@
                try {
                    List<DetailSystem> detailSystemList = session.createQuery("from DetailSystem ds where ds.system.id=" + systemId).list();
                    String sql = "";
                    if (detailSystem > 0)
                        sql = "select sh.homeType from SuperHomeType sh where sh.homeType.name like ? and sh.detailSystem.id="
                                + detailSystem + " order by  sh.homeType.orderby desc";
                    else
                        sql = "from HomeType zb where zb.name like ? and zb.system.id=" + systemId + " order by zb.orderby desc";
                    List<String> andList = new ArrayList<>();
                    if (detailSystem > 0) {
                        andList.add("sh.homeType.name like ?");
                        andList.add("sh.detailSystem.id=" + detailSystem);
                        if (dataKey != null) {
                            andList.add("sh.homeType.specialDataKey='" + dataKey+"'");
                        }
                        sql = "select sh.homeType from SuperHomeType sh where  " + org.yeshi.utils.StringUtil.concat(andList, " and ") + " order by  sh.homeType.orderby desc";
                    } else {
                        andList.add("zb.name like ?");
                        andList.add("zb.system.id=" + systemId);
                        if (dataKey != null) {
                            andList.add("zb.specialDataKey='" + dataKey+"'");
                        }
                        sql = "from HomeType zb where " + org.yeshi.utils.StringUtil.concat(andList, " and ") + " order by zb.orderby desc";
                    }
                    List<HomeType> list = session.createQuery(sql).setParameter(0, "%" + key + "%")
                            .setFirstResult((page - 1) * Constant.pageCount).setMaxResults(Constant.pageCount).list();
                    for (HomeType vb : list) {
@@ -492,15 +502,31 @@
    }
    public long getHomeTypeAdminCount(String key, String systemId, int detailSystem) {
        String sql = "";
        if (detailSystem > 0)
            sql = "select count(*) from  (select count(*) from wk_video_super_hometype zb left join wk_video_hometype c on c.id=zb.hometypeid where zb.detailsystemid="
                    + detailSystem + " and c.name like '%" + key + "%' group by zb.hometypeid) s";
        else
            sql = "select count(*) from  (select count(*) from wk_video_super_hometype zb left join wk_video_hometype c on c.id=zb.hometypeid where  c.name like '%"
                    + key + "%' and c.system=" + systemId + " group by zb.hometypeid) s";
    public long getHomeTypeAdminCount(String key, String systemId, int detailSystem, final String dataKey) {
        List<String> andList = new ArrayList<>();
        String sql = "";
        if (detailSystem > 0) {
            andList.add("zb.detailsystemid=" + detailSystem);
            andList.add("c.name like '%" + key + "%'");
            if (dataKey != null) {
                andList.add("c.special_data_key='" + dataKey + "'");
            }
            sql = "select count(*) from  (select count(*) from wk_video_super_hometype zb left join wk_video_hometype c on c.id=zb.hometypeid where " + org.yeshi.utils.StringUtil.concat(andList, " and ") + " group by zb.hometypeid) s";
        } else {
            andList.add("c.name like '%" + key + "%'");
            andList.add("c.system=" + systemId);
            if (dataKey != null) {
                andList.add("c.special_data_key='" + dataKey + "'");
            }
            sql = "select count(*) from  (select count(*) from wk_video_super_hometype zb left join wk_video_hometype c on c.id=zb.hometypeid where  " + org.yeshi.utils.StringUtil.concat(andList, " and ") + " group by zb.hometypeid) s";
        }
        return homeTypeDao.getCountSQL(sql);
    }
src/main/java/com/yeshi/buwan/service/imp/LoginUserServiceImpl.java
@@ -234,4 +234,12 @@
        updateSelectiveByPrimaryKey(update);
        return openId;
    }
    @Override
    public void setUtdId(String uid, String utdId) {
        LoginUserExtra update = new LoginUserExtra();
        update.setId(uid);
        update.setUtdId(utdId);
        updateSelectiveByPrimaryKey(update);
    }
}
src/main/java/com/yeshi/buwan/service/imp/SystemService.java
@@ -194,7 +194,7 @@
    public void detailSystemClone(String fromid, String toId) {
        // 首页Banner
        List<HomeAd> homeAdlist = homeAdService.getHomeAdList(new DetailSystem(fromid));
        List<HomeAd> homeAdlist = homeAdService.getHomeAdList(new DetailSystem(fromid),"recommend");
        for (HomeAd ad : homeAdlist) {
            SuperHomeAd sa = new SuperHomeAd();
            sa.setCreatetime(System.currentTimeMillis() + "");
src/main/java/com/yeshi/buwan/service/imp/UserService.java
@@ -247,6 +247,7 @@
        }
        if (loginUserExtra != null) {
            loginUserExtra.setUtdId(dto.getUtdId());
            loginUserExtraDao.updateSelective(loginUserExtra);
        }
src/main/java/com/yeshi/buwan/service/imp/push/PushDeviceTokenServiceImpl.java
@@ -8,6 +8,7 @@
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
@Service
public class PushDeviceTokenServiceImpl implements PushDeviceTokenService {
@@ -22,11 +23,26 @@
            throw new Exception("对象不能为空");
        }
        if (StringUtil.isNullOrEmpty(token.getDetailSystemId()) || StringUtil.isNullOrEmpty(token.getUtdId()) || StringUtil.isNullOrEmpty(token.getToken()) || StringUtil.isNullOrEmpty(token.getType())) {
        if (StringUtil.isNullOrEmpty(token.getDetailSystemId()) || StringUtil.isNullOrEmpty(token.getUtdId()) || StringUtil.isNullOrEmpty(token.getToken()) || token.getType() == null) {
            throw new Exception("参数不能为空");
        }
        token.setId(PushDeviceToken.createId(token.getDetailSystemId(),token.getUtdId()));
        token.setId(PushDeviceToken.createId(token.getDetailSystemId(), token.getUtdId()));
        token.setCreateTime(new Date());
        pushDeviceTokenDao.save(token);
    }
    @Override
    public List<PushDeviceToken> listByLoginUids(List<String> loginUids) {
        return null;
    }
    @Override
    public List<PushDeviceToken> list(String detailSystemId, Integer minVersion, Date minTime, int page, int pageSize) {
        return null;
    }
    @Override
    public long count(String detailSystemId, Integer minVersion, Date minTime) {
        return 0;
    }
}
src/main/java/com/yeshi/buwan/service/imp/recommend/HomeRecommendSpecialServiceImpl.java
@@ -106,6 +106,11 @@
    }
    @Override
    public HomeRecommendSpecial getSpecialByDataKey(String dataKey) {
        return homeRecommendSpecialDao.selectByDataKey(dataKey);
    }
    @Override
    public List<HomeRecommendSpecial> listSpecialBySystemId(String systemId, String key, int page, int pageSize) {
        HomeRecommendSpecialDao.DaoQuery query = new HomeRecommendSpecialDao.DaoQuery();
        query.systemId = systemId;
src/main/java/com/yeshi/buwan/service/inter/LoginUserService.java
@@ -116,7 +116,6 @@
    public LoginUserExtra initExtra(String uid);
    public LoginUserExtra initPPTVUid(String uid);
@@ -130,6 +129,7 @@
    /**
     * 根据主键更新
     *
     * @param extra
     */
    public void updateSelectiveByPrimaryKey(LoginUserExtra extra);
@@ -137,9 +137,19 @@
    /**
     * 更新PPTV的openId
     *
     * @param uid
     * @return
     */
    public String updatePPTVOpenId(String uid) throws PPTVException;
    /**
     * 设置utdid
     *
     * @param uid
     * @param utdId
     */
    public void setUtdId(String uid, String utdId);
}
src/main/java/com/yeshi/buwan/service/inter/push/PushDeviceTokenService.java
@@ -2,9 +2,19 @@
import com.yeshi.buwan.domain.push.PushDeviceToken;
import java.util.Date;
import java.util.List;
public interface PushDeviceTokenService {
    public void addDeviceToken(PushDeviceToken token) throws Exception;
    public List<PushDeviceToken> listByLoginUids(List<String> loginUids);
    public List<PushDeviceToken> list(String detailSystemId, Integer minVersion, Date minTime, int page, int pageSize);
    public long count(String detailSystemId, Integer minVersion, Date minTime);
}
src/main/java/com/yeshi/buwan/service/inter/recommend/HomeRecommendSpecialService.java
@@ -48,6 +48,14 @@
     */
    public HomeRecommendSpecial getSpecial(String id);
    /**
     * 根据专题关键词拉取专题
     * @param dataKey
     * @return
     */
    public HomeRecommendSpecial getSpecialByDataKey(String dataKey);
    /**
     * 根据系统ID检索
     *
src/main/java/com/yeshi/buwan/service/manager/SolrAlbumVideoDataManager.java
@@ -135,7 +135,7 @@
        Query query = null;
        if (!StringUtil.isNullOrEmpty(filter.getKey())) {
            //solr精准检索需要带引号
            query = new SimpleQuery(new Criteria("name").expression("\"" + filter.getKey() + "\"").or("mainactor").expression("\"" + filter.getKey() + "\""));
            query = new SimpleQuery(new Criteria("nameStr").startsWith(filter.getKey()).or("mainactor").expression("\"" + filter.getKey() + "\""));
        } else if (!StringUtil.isNullOrEmpty(filter.getActor())) {
            query = new SimpleQuery(new Criteria("mainactor").expression("\"" + filter.getActor() + "\""));
        } else if (!StringUtil.isNullOrEmpty(filter.getDirector())) {
@@ -156,6 +156,10 @@
            query.addFilterQuery(new SimpleFilterQuery(Criteria.where("free_type").is(filter.getFreeType())));
        }
        if (filter.getArea() != null) {
            query.addFilterQuery(new SimpleFilterQuery(Criteria.where("area").contains(filter.getArea())));
        }
        /** 设置分页开始记录数(第一页) 默认0 */
        query.setOffset((page - 1) * pageSize);
@@ -173,11 +177,13 @@
    }
    public List<String> getSuggestKeyList(String key) {
        Query query = new SimpleQuery("name:\"" + key + "\"");
        Query query = new SimpleQuery(new Criteria("nameStr").startsWith(key));
        /** 设置分页开始记录数(第一页) 默认0 */
        query.setOffset(0);
        /** 设置每页显示记录数,默认10 */
        query.setRows(10);
        ScoredPage<SolrAlbumVideo> result = solrTemplate.queryForPage(CORE_NAME, query, SolrAlbumVideo.class);
        System.out.println("总记录数:" + result.getTotalElements());
        List<SolrAlbumVideo> list = result.getContent();
src/main/java/com/yeshi/buwan/util/factory/SolrVideoFactory.java
@@ -37,6 +37,7 @@
        solrVideo.setCommentcount(videoInfo.getCommentCount());
        solrVideo.setVideocount(videoInfo.getVideocount());
        solrVideo.setName(videoInfo.getName());
        solrVideo.setNameStr(videoInfo.getName());
        solrVideo.setUpdatetime(videoInfo.getUpdatetime());
        if (videoInfo.getUpdatetime() != null)
            solrVideo.setUpdateTime(Long.parseLong(videoInfo.getUpdatetime()));
src/main/java/com/yeshi/buwan/util/push/PushManager.java
New file
@@ -0,0 +1,178 @@
package com.yeshi.buwan.util.push;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.yeshi.buwan.domain.push.PushDeviceToken;
import com.yeshi.buwan.domain.system.DetailSystem;
import com.yeshi.buwan.domain.system.DetailSystemConfig;
import com.yeshi.buwan.dto.push.PushAppsDTO;
import com.yeshi.buwan.service.imp.DetailSystemConfigService;
import com.yeshi.buwan.service.inter.push.PushDeviceTokenService;
import org.yeshi.utils.StringUtil;
import org.yeshi.utils.push.*;
import org.yeshi.utils.push.entity.PushAppInfo;
import org.yeshi.utils.push.entity.PushMessage;
import javax.annotation.Resource;
import java.lang.reflect.Type;
import java.util.*;
public class PushManager {
    @Resource
    private DetailSystemConfigService configService;
    @Resource
    private PushDeviceTokenService pushDeviceTokenService;
    private Map<PushDeviceToken.PushPlatform, List<String>> distributeTokens(List<PushDeviceToken> tokenList) {
        Map<PushDeviceToken.PushPlatform, List<String>> map = new HashMap<>();
        for (PushDeviceToken token : tokenList) {
            if (map.get(token.getType()) == null)
                map.put(token.getType(), new ArrayList<>());
            map.get(token.getType()).add(token.getToken());
        }
        return map;
    }
    private List<PushAppInfo> getPushApps(String detailSystemId, String channelKey) {
        DetailSystemConfig config = configService.getConfigByKey(channelKey, new DetailSystem(detailSystemId), 1);
        Type type = new TypeToken<List<PushAppInfo>>() {
        }.getType();
        Gson gson = new Gson();
        if (config != null && !StringUtil.isNullOrEmpty(config.getValue())) {
            List<PushAppInfo> apps = gson.fromJson(config.getValue(), type);
            return apps;
        }
        return null;
    }
    /**
     * 获取推送的APP信息
     *
     * @param detailSystemId
     * @return
     */
    private Map<PushDeviceToken.PushPlatform, List<PushAppInfo>> getPushApps(String detailSystemId) {
        PushAppsDTO dto = new PushAppsDTO();
        dto.setXmInfos(getPushApps(detailSystemId, "push_apps_xm"));
        dto.setHwInfos(getPushApps(detailSystemId, "push_apps_hw"));
        dto.setOppoInfos(getPushApps(detailSystemId, "push_apps_oppo"));
        dto.setVivoInfos(getPushApps(detailSystemId, "push_apps_vivo"));
        dto.setMzInfos(getPushApps(detailSystemId, "push_apps_mz"));
        Map<PushDeviceToken.PushPlatform, List<PushAppInfo>> appMap = new HashMap<>();
        if (dto.getHwInfos() != null) {
            appMap.put(PushDeviceToken.PushPlatform.hw, dto.getHwInfos());
        }
        if (dto.getXmInfos() != null) {
            appMap.put(PushDeviceToken.PushPlatform.xm, dto.getXmInfos());
        }
        if (dto.getOppoInfos() != null) {
            appMap.put(PushDeviceToken.PushPlatform.oppo, dto.getOppoInfos());
        }
        if (dto.getVivoInfos() != null) {
            appMap.put(PushDeviceToken.PushPlatform.vivo, dto.getVivoInfos());
        }
        if (dto.getMzInfos() != null) {
            appMap.put(PushDeviceToken.PushPlatform.mz, dto.getMzInfos());
        }
        return appMap;
    }
    /**
     * 推送Android通知
     *
     * @param pushMessage
     * @param loginUids      为空表示全推
     * @param detailSystemId
     * @param minVersion
     * @throws Exception
     */
    public void pushAndroidNotifycation(PushMessage pushMessage, List<String> loginUids, String detailSystemId, Integer minVersion) throws Exception {
        //推送key
        Map<PushDeviceToken.PushPlatform, List<PushAppInfo>> appsMap = getPushApps(detailSystemId);
        //批量推送
        if (loginUids != null && loginUids.size() > 0) {
            //查询tokens
            List<PushDeviceToken> tokenList = pushDeviceTokenService.listByLoginUids(loginUids);
            Map<PushDeviceToken.PushPlatform, List<String>> map = distributeTokens(tokenList);
            for (Iterator<PushDeviceToken.PushPlatform> its = map.keySet().iterator(); its.hasNext(); ) {
                PushDeviceToken.PushPlatform platform = its.next();
                if (appsMap.get(platform) != null)
                    //暂时推送第一应用,后续有多个应用需求再处理
                    pushAndroidNotifycation(pushMessage, appsMap.get(platform).get(0), map.get(platform), platform);
            }
        } else {
            //广播
            Date minTime = new Date(System.currentTimeMillis() - 1000 * 60 * 60 * 24L * 30);
            //推送最近1个月的活跃
            long count = pushDeviceTokenService.count(detailSystemId, minVersion, minTime);
            //每次拉取2000个数据
            int tp = (int) (count % 2000 == 0 ? count / 2000 : count / 2000 + 1);
            for (int i = 0; i < tp; i++) {
                List<PushDeviceToken> list = pushDeviceTokenService.list(detailSystemId, minVersion, minTime, i + 1, 2000);
                Map<PushDeviceToken.PushPlatform, List<String>> map = distributeTokens(list);
                for (Iterator<PushDeviceToken.PushPlatform> its = map.keySet().iterator(); its.hasNext(); ) {
                    PushDeviceToken.PushPlatform platform = its.next();
                    if (appsMap.get(platform) != null)
                        //暂时推送第一应用,后续有多个应用需求再处理
                        pushAndroidNotifycation(pushMessage, appsMap.get(platform).get(0), map.get(platform), platform);
                }
            }
        }
    }
    /**
     * 推送数据
     *
     * @param message
     * @param appInfo
     * @param tokens   一次最多500
     * @param platform
     * @throws Exception
     */
    private void pushAndroidNotifycation(PushMessage message, PushAppInfo appInfo, List<String> tokens, PushDeviceToken.PushPlatform platform) throws Exception {
        if (tokens == null || tokens.size() == 0)
            return;
        List<String> tempTokens = null;
        List<String> leftTokens = null;
        if (tokens.size() > 500) {
            tempTokens = tokens.subList(0, 500);
            leftTokens = tokens.subList(500, tokens.size());
        } else {
            tempTokens = tokens;
        }
        if (platform == PushDeviceToken.PushPlatform.xm) {
            XiaoMiPushUtil.pushNotificationByRegIds(appInfo, message, tempTokens);
        } else if (platform == PushDeviceToken.PushPlatform.hw) {
            HuaWeiPushUtil.pushNotificationByTokens(appInfo, message, tempTokens);
        } else if (platform == PushDeviceToken.PushPlatform.oppo) {
            OppoPushUtil.pushNotificationAll(appInfo, message, tempTokens);
        } else if (platform == PushDeviceToken.PushPlatform.vivo) {
            VIVOPushUtil.pushNotificationByRegIds(appInfo, message, tempTokens);
        } else if (platform == PushDeviceToken.PushPlatform.mz) {
            MeiZuPushUtil.pushNotificationByPushId(appInfo, message, tempTokens);
        }
        if (leftTokens != null && leftTokens.size() > 0) {
            pushAndroidNotifycation(message, appInfo, leftTokens, platform);
        }
    }
}
src/main/java/com/yeshi/buwan/vo/video/VideoAdminInfoVO.java
@@ -4,16 +4,27 @@
import com.yeshi.buwan.domain.VideoInfo;
import com.yeshi.buwan.util.StringUtil;
import com.yeshi.buwan.util.TimeUtil;
import com.yeshi.buwan.util.video.VideoConstant;
public class VideoAdminInfoVO {
    private String id;
    private String name;
    private String picture;
    private String hpicture;
    private String vpicture;
    private String updatetime;
    private String show;
    private String tag;
    private Integer freeType;
    private String area;
    public String getArea() {
        return area;
    }
    public void setArea(String area) {
        this.area = area;
    }
    public Integer getFreeType() {
        return freeType;
@@ -43,7 +54,12 @@
        VideoAdminInfoVO vo = new VideoAdminInfoVO();
        vo.setId(video.getId());
        vo.setName(video.getName());
        vo.setPicture(video.getHpicture());
        if (video.getVideoType() != null && VideoConstant.isMainCategory(video.getVideoType().getId()))
            vo.setVpicture(video.getVpicture());
        else
            vo.setHpicture(video.getHpicture());
        vo.setShow(video.getShow() + "");
        vo.setUpdatetime(TimeUtil.getGernalTime(
                Long.parseLong(
@@ -58,7 +74,10 @@
        VideoAdminInfoVO vo = new VideoAdminInfoVO();
        vo.setId(solrVideo.getId());
        vo.setName(solrVideo.getName());
        vo.setPicture(solrVideo.getHpicture());
        if (VideoConstant.isMainCategory(solrVideo.getRootVideoType()))
            vo.setVpicture(solrVideo.getPicture());
        else
            vo.setHpicture(solrVideo.getHpicture());
        vo.setShow(solrVideo.getShow() + "");
        vo.setUpdatetime(TimeUtil.getGernalTime(
                Long.parseLong(
@@ -66,6 +85,7 @@
                "yyyy-MM-dd"));
        vo.setTag(solrVideo.getTag());
        vo.setFreeType(solrVideo.getFreeType());
        vo.setArea(solrVideo.getArea());
        return vo;
    }
@@ -85,14 +105,6 @@
        this.name = name;
    }
    public String getPicture() {
        return picture;
    }
    public void setPicture(String picture) {
        this.picture = picture;
    }
    public String getUpdatetime() {
        return updatetime;
    }
@@ -101,4 +113,19 @@
        this.updatetime = updatetime;
    }
    public String getHpicture() {
        return hpicture;
    }
    public void setHpicture(String hpicture) {
        this.hpicture = hpicture;
    }
    public String getVpicture() {
        return vpicture;
    }
    public void setVpicture(String vpicture) {
        this.vpicture = vpicture;
    }
}
src/main/webapp/admin/new/add-banner.html
@@ -1,396 +1,428 @@
<html lang="zh-cn">
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="referrer" content="never">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <title>添加推荐Banner</title>
        <link href="css/bootstrap.min.css" rel="stylesheet">
        <link href="css/maincontent.css" rel="stylesheet">
        <link href="css/tablestyle.css" rel="stylesheet">
        <style>
            .form-group {
                margin-bottom: 30px;
            }
            .checkbox input[type=checkbox] {
                top: 6px;
            }
            #container-video {
                display: block;
            }
            #container-web {
                display: none;
            }
            #container-special {
                display: none;
            }
            #dialog-chooselink {
                padding: 20px;
            }
            #dialog-chooselink select {
                width: 100px;
            }
            #dialog-chooselink label {
                display: inline;
            }
            #dialog-chooselink input[type=text] {
                display: inline;
                width: 500px;
            }
            #dialog-chooselink ul {
                display: block;
                list-style: none;
            }
            #dialog-chooselink ul li {
                display: inline;
                list-style: none;
                width: 33%;
                float: left;
            }
            #dialog-chooselink input[type=radio] {
                width: 20px;
                height: 20px;
            }
            #dialog-chooselink .search-result {
                height: 630px;
                overflow-y: scroll;
            }
        </style>
    </head>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="referrer" content="never">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>添加推荐Banner</title>
    <link href="css/bootstrap.min.css" rel="stylesheet">
    <link href="css/maincontent.css" rel="stylesheet">
    <link href="css/tablestyle.css" rel="stylesheet">
    <style>
        .form-group {
            margin-bottom: 30px;
        }
    <body>
        <nav class="navbar navbar-default navbar-fixed-top">
        </nav>
        <div id="mainbody">
            <div id="sidebar">
                <dl>
                </dl>
            </div>
            <div id="neirong">
                <div class="erjidh">
                    <ol class="breadcrumb">
                        <li>
                            <a href="tuijian-lanmuneirong.html">推荐Banner</a>
                        </li>
                        <li class="active">添加内容</li>
                    </ol>
                </div>
                <form class="form-horizontal">
                    <div class="form-group">
                        <label for="input1" class="changdu1 control-label">图片链接</label>
                        <div class="col-sm-7">
                            <input type="text" class="form-control" id="picture" placeholder="必须填写">
                        </div>
                    </div>
        .checkbox input[type=checkbox] {
            top: 6px;
        }
                    <div class="form-group">
                        <label for="input2" class="changdu1 control-label">权重</label>
                        <div class="col-sm-7">
                            <input type="text" class="form-control" id="orderby" placeholder="必须填写">
                        </div>
                    </div>
        #container-video {
            display: block;
        }
                    <div class="form-group">
                        <label for="input3" class="changdu1 control-label">简要介绍</label>
                        <div class="col-sm-7">
                            <input type="text" class="form-control" id="introduction" placeholder="">
                        </div>
                    </div>
        #container-web {
            display: none;
        }
                    <div class="form-group">
                        <label for="input4" class="changdu1 control-label">跳转详情</label>
                        <div class="col-sm-7">
                            <label id="jump-detail"></label>
                            <input type="hidden" id="linkType" />
                            <input type="hidden" id="linkValue" />
        #container-special {
            display: none;
        }
                            <a href="javascript:void(0)" class="btn btn-info" id="choose-link">选择</a>
                        </div>
                    </div>
        #dialog-chooselink {
            padding: 20px;
        }
                    <div class="form-group">
                        <label for="input5" class="changdu1 control-label">备注</label>
                        <div class="col-sm-7">
                            <textarea class="form-control" id="beizhu"></textarea>
                        </div>
                    </div>
        #dialog-chooselink select {
            width: 100px;
        }
                    <div class="form-group">
                        <label for="input7" class="changdu1 control-label">媒体</label>
                        <div class="col-sm-7 detailsystem">
        #dialog-chooselink label {
            display: inline;
        }
                        </div>
                    </div>
        #dialog-chooselink input[type=text] {
            display: inline;
            width: 500px;
        }
                    <div class="button0">
                        <div class="button">
                            <button type="button" class="btn btn-primary save">保存</button>
                        </div>
                        <div class="button">
                            <input type="reset" class="btn btn-default" value="重置" />
                        </div>
                    </div>
                </form>
        #dialog-chooselink ul {
            display: block;
            list-style: none;
        }
            </div>
            <div id="dialog-chooselink" style="display: none;">
                <div class="row" style="height: 690px;">
                    <div class="col-lg-3 col-md-3" style="display: inline;">
                        <select class="form-control">
                            <option value="1">视频</option>
                            <option value="2">网页</option>
                            <option value="3">合集</option>
                        </select>
                    </div>
                    <div class="col-lg-9 col-md-9" style="display: inline;">
                        <!--视频选择 -->
                        <div id="container-video">
                            <div class="search">
                                <input type="text" class="form-control" placeholder="请输入关键字" style="width: 200px;display: inline;" />
                                <button class="btn btn-info">搜索</button>
                            </div>
        #dialog-chooselink ul li {
            display: inline;
            list-style: none;
            width: 33%;
            float: left;
        }
                            <!-- 搜索结果展示区域-->
                            <div class="search-result">
                                <table class="table">
                                    <thead>
                                        <th>编号</th>
                                        <th>名称</th>
                                        <th>封面</th>
                                        <th>是否显示</th>
                                        <th>选择</th>
        #dialog-chooselink input[type=radio] {
            width: 20px;
            height: 20px;
        }
                                    </thead>
        #dialog-chooselink .search-result {
            height: 630px;
            overflow-y: scroll;
        }
    </style>
</head>
                                    <tbody>
<body>
<nav class="navbar navbar-default navbar-fixed-top">
</nav>
<div id="mainbody">
    <div id="sidebar">
        <dl>
        </dl>
    </div>
    <div id="neirong">
        <div class="erjidh">
            <ol class="breadcrumb">
                <li>
                    <a href="tuijian-banner.html">推荐Banner</a>
                </li>
                <li class="active">添加内容</li>
            </ol>
        </div>
        <form class="form-horizontal">
            <div class="form-group">
                <label for="input1" class="changdu1 control-label">图片链接</label>
                <div class="col-sm-7">
                    <input type="text" class="form-control" id="picture" placeholder="必须填写">
                </div>
            </div>
                                    </tbody>
                                </table>
            <div class="form-group">
                <label for="input2" class="changdu1 control-label">顶部标签</label>
                <div class="col-sm-7">
                    <select class="form-control" id="special" style="max-width: 150px;">
                    </select>
                </div>
            </div>
                            </div>
            <div class="form-group">
                <label for="input2" class="changdu1 control-label">权重</label>
                <div class="col-sm-7">
                    <input type="text" class="form-control" id="orderby" placeholder="必须填写">
                </div>
            </div>
                        </div>
                        <!--网页填写 -->
                        <div id="container-web">
                            <label>网页链接:</label>
                            <input type="text" class="form-control" />
                        </div>
                        <!--合集选择 -->
                        <div id="container-special">
                            <label>合集列表</label>
                            <ul>
                                <li>
                                    <div class="checkbox"><label><input type="checkbox" value="46" >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;布丸影视大全Web1</label></div>
                                </li>
                                <li>
                                    <div class="checkbox"><label><input type="checkbox" value="46" >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;布丸影视大全Web2</label></div>
                                </li>
            <div class="form-group">
                <label for="input3" class="changdu1 control-label">简要介绍</label>
                <div class="col-sm-7">
                    <input type="text" class="form-control" id="introduction" placeholder="">
                </div>
            </div>
                            </ul>
            <div class="form-group">
                <label for="input4" class="changdu1 control-label">跳转详情</label>
                <div class="col-sm-7">
                    <label id="jump-detail"></label>
                    <input type="hidden" id="linkType"/>
                    <input type="hidden" id="linkValue"/>
                        </div>
                    </div>
                    <a href="javascript:void(0)" class="btn btn-info" id="choose-link">选择</a>
                </div>
            </div>
                </div>
            <div class="form-group">
                <label for="input5" class="changdu1 control-label">备注</label>
                <div class="col-sm-7">
                    <textarea class="form-control" id="beizhu"></textarea>
                </div>
            </div>
                <div style="float: right;">
                    <button class="btn btn-info sure">确定</button>
                    <button class="btn btn-default cancel">取消</button>
                </div>
            <div class="form-group">
                <label for="input7" class="changdu1 control-label">媒体</label>
                <div class="col-sm-7 detailsystem">
            </div>
                </div>
            </div>
        </div>
            <div class="button0">
                <div class="button">
                    <button type="button" class="btn btn-primary save">保存</button>
                </div>
                <div class="button">
                    <input type="reset" class="btn btn-default" value="重置"/>
                </div>
            </div>
        </form>
        <script src="//cdn.bootcss.com/jquery/1.10.1/jquery.min.js"></script>
        <script src="js/bootstrap.min.js"></script>
        <script src="js/nav.js"></script>
        <script src="js/common.js"></script>
        <script src="layer/layer.js"></script>
        <script>
            var index;
            $(function() {
                $.post('/BuWan/admin/new/api/common/detailsystemlist', function(data) {
                    if(data.code == 0) {
                        var dsStr = "";
                        data.data.forEach(function(ds) {
                            dsStr += "<div class='checkbox '><label>";
                            dsStr += "<input type='checkbox' value=" + ds.id + ">";
                            dsStr += "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" + ds.name;
                            dsStr += "</label></div>";
                        });
                        $(".detailsystem").html(dsStr);
                    }
                }, 'json');
    </div>
    <div id="dialog-chooselink" style="display: none;">
        <div class="row" style="height: 690px;">
            <div class="col-lg-3 col-md-3" style="display: inline;">
                <select class="form-control">
                    <option value="1">视频</option>
                    <option value="2">网页</option>
                    <option value="3">合集</option>
                </select>
            </div>
            <div class="col-lg-9 col-md-9" style="display: inline;">
                <!--视频选择 -->
                <div id="container-video">
                    <div class="search">
                        <input type="text" class="form-control" placeholder="请输入关键字"
                               style="width: 200px;display: inline;"/>
                        <button class="btn btn-info">搜索</button>
                    </div>
                $(".save").click(function() {
                    if($("#linkType").val() == undefined || $("#linkType").val().length < 1 || $("#linkType").val() == '') {
                        layer.msg("请选择跳转类型");
                        return;
                    }
                    <!-- 搜索结果展示区域-->
                    <div class="search-result">
                        <table class="table">
                            <thead>
                            <th>编号</th>
                            <th>名称</th>
                            <th>封面</th>
                            <th>是否显示</th>
                            <th>选择</th>
                    if($("#linkValue").val() == undefined || $("#linkValue").val().length < 1 || $("#linkValue").val() == '') {
                        layer.msg("请选择跳转类型");
                        return;
                    }
                            </thead>
                    var $detailsystems = $(".detailsystem input[type=checkbox]");
                    var dess = "";
                    for(var i = 0; i < $detailsystems.length; i++) {
                        if($detailsystems.eq(i).is(":checked")) {
                            dess += $detailsystems.eq(i).val() + ",";
                        }
                    }
                    if(dess.length > 0)
                        dess = dess.substr(0, dess.length - 1);
                            <tbody>
                    var index = layer.load(0, {
                        'shade': false
                    });
                    $.post('/BuWan/admin/new/api/homebanner/addhomead', {
                        'picture': $("#picture").val(),
                        'orderby': $("#orderby").val(),
                        'introduction': $("#introduction").val(),
                        'beizhu': $("#beizhu").val(),
                        'linkType': $("#linkType").val(),
                        'linkValue': $("#linkValue").val(),
                        'detailsystemids': dess
                    }, function(data) {
                        layer.close(index);
                        layer.msg(data.msg);
                        doResponse(data, function() {
                            </tbody>
                        });
                    }, 'json');
                        </table>
                });
                    </div>
            });
        </script>
        <script>
            $(function() {
                $("#dialog-chooselink select").eq(0).change(function() {
                    var linkType = $(this).val();
                    if(linkType == 1) {
                        $("#container-special").css("display", "none");
                        $("#container-video").css("display", "block");
                        $("#container-web").css("display", "none");
                    } else if(linkType == 2) {
                        $("#container-special").css("display", "none");
                        $("#container-video").css("display", "none");
                        $("#container-web").css("display", "block");
                    } else if(linkType == 3) {
                        $("#container-special").css("display", "block");
                        $("#container-video").css("display", "none");
                        $("#container-web").css("display", "none");
                    }
                });
                </div>
                <!--网页填写 -->
                <div id="container-web">
                    <label>网页链接:</label>
                    <input type="text" class="form-control"/>
                </div>
                <!--合集选择 -->
                <div id="container-special">
                    <label>合集列表</label>
                    <ul>
                        <li>
                            <div class="checkbox"><label><input type="checkbox" value="46">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;布丸影视大全Web1</label>
                            </div>
                        </li>
                        <li>
                            <div class="checkbox"><label><input type="checkbox" value="46">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;布丸影视大全Web2</label>
                            </div>
                        </li>
                //获取专辑列表
                $.post('/BuWan/admin/new/api/special/getspeciallist', {}, function(data) {
                    if(data.code == 0) {
                        $("#container-special ul").empty();
                        data.data.forEach(function(special) {
                            $("#container-special ul").append("<li><div class='checkbox'><label><input type='radio' name='special-choose' value='" + special.id + "' >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" + special.name + "</label></div></li>");
                        });
                    }
                }, 'json');
                    </ul>
                //搜索点击
                $("#container-video .search button").click(function() {
                    var key = $("#container-video .search input").val();
                    var index = layer.load(0, {
                        'shade': false
                    });
                    $.post('/BuWan/admin/new/api/common/searchvideo', {
                        'key': key
                    }, function(data) {
                        layer.close(index);
                        if(data.code == 0) {
                            $(".search-result table tbody").empty();
                            var html = "";
                            data.data.forEach(function(video) {
                                html += "<tr><td>" + video.id;
                                html += "</td><td>" + video.name + "</td><td><img style='width: 80px;' src=" + video.picture + "> </td><td>" + (video.show == 1 ? '显示' : '不显示') + "</td>";
                                html += "<td><input type='radio' name='choose-video' value=" + video.id + "></td></tr>";
                            });
                            $(".search-result table tbody").html(html);
                        }
                </div>
            </div>
                    }, 'json');
                });
        </div>
                $("#dialog-chooselink .sure").click(function() {
                    var type = $("#dialog-chooselink select").eq(0).val();
                    var value;
                    if(type == 1) {
                        var videoid = $('#dialog-chooselink .search-result input[name="choose-video"]:checked').val();
                        console.log(videoid);
                        if(videoid == undefined || videoid == null) {
                            layer.msg("请选择视频");
                            return;
                        }
                        value = videoid;
                        $("#jump-detail").html("视频:" + videoid);
        <div style="float: right;">
            <button class="btn btn-info sure">确定</button>
            <button class="btn btn-default cancel">取消</button>
        </div>
                    } else if(type == 2) {
                        var url = $("#container-web input[type=text]").val();
                        if(url == undefined || url == '' || url.length < 1) {
                            layer.msg("请输入网页链接");
                            return;
                        }
                        value = url;
                        $("#jump-detail").html("网页链接:" + url);
    </div>
                    } else if(type == 3) {
                        var specialid = $('#dialog-chooselink #container-special input[name="special-choose"]:checked').val();
                        console.log(specialid);
                        if(specialid == undefined || specialid == null) {
                            layer.msg("请选择专辑");
                            return;
                        }
                        value = specialid;
                        $("#jump-detail").html("专辑:" + specialid);
                    }
</div>
                    $("#linkType").val(type);
                    $("#linkValue").val(value);
                    layer.close(index);
<script src="//cdn.bootcss.com/jquery/1.10.1/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/nav.js"></script>
<script src="js/common.js"></script>
<script src="layer/layer.js"></script>
<script>
    var index;
    $(function () {
        $.post('api/homerecommend/getSpcialList', {
            "page": 1
        }, function (data) {
            if (data.code == 0) {
                var datas = data.data.data;
                $("#special").empty();
                for (var i = 0; i < datas.length; i++) {
                    var html = "<option";
                    html += " value=" + datas[i].special.dataKey + " >";
                    html += datas[i].special.name;
                    html += "</option>";
                    $("#special").append(html);
                }
                });
            }
                $("#dialog-chooselink .cancel").click(function() {
                    layer.close(index);
                });
        }, "json");
                $("#choose-link").click(function() {
                    index = layer.open({
                        type: 1,
                        title: '链接选择',
                        shadeClose: true,
                        shade: 0.8,
                        area: ['1000px', '800px'],
                        content: $("#dialog-chooselink")
                    });
                });
            });
        </script>
        $.post('/BuWan/admin/new/api/common/detailsystemlist', function (data) {
            if (data.code == 0) {
                var dsStr = "";
                data.data.forEach(function (ds) {
                    dsStr += "<div class='checkbox '><label>";
                    dsStr += "<input type='checkbox' value=" + ds.id + ">";
                    dsStr += "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" + ds.name;
                    dsStr += "</label></div>";
                });
                $(".detailsystem").html(dsStr);
            }
        }, 'json');
    </body>
        $(".save").click(function () {
            if ($("#linkType").val() == undefined || $("#linkType").val().length < 1 || $("#linkType").val() == '') {
                layer.msg("请选择跳转类型");
                return;
            }
            if ($("#linkValue").val() == undefined || $("#linkValue").val().length < 1 || $("#linkValue").val() == '') {
                layer.msg("请选择跳转类型");
                return;
            }
            var $detailsystems = $(".detailsystem input[type=checkbox]");
            var dess = "";
            for (var i = 0; i < $detailsystems.length; i++) {
                if ($detailsystems.eq(i).is(":checked")) {
                    dess += $detailsystems.eq(i).val() + ",";
                }
            }
            if (dess.length > 0)
                dess = dess.substr(0, dess.length - 1);
            var index = layer.load(0, {
                'shade': false
            });
            $.post('/BuWan/admin/new/api/homebanner/addhomead', {
                'picture': $("#picture").val(),
                'orderby': $("#orderby").val(),
                'introduction': $("#introduction").val(),
                'beizhu': $("#beizhu").val(),
                'linkType': $("#linkType").val(),
                'linkValue': $("#linkValue").val(),
                'detailsystemids': dess,
                'specialDataKey': $("#special").val()
            }, function (data) {
                layer.close(index);
                layer.msg(data.msg);
                doResponse(data, function () {
                });
            }, 'json');
        });
    });
</script>
<script>
    $(function () {
        $("#dialog-chooselink select").eq(0).change(function () {
            var linkType = $(this).val();
            if (linkType == 1) {
                $("#container-special").css("display", "none");
                $("#container-video").css("display", "block");
                $("#container-web").css("display", "none");
            } else if (linkType == 2) {
                $("#container-special").css("display", "none");
                $("#container-video").css("display", "none");
                $("#container-web").css("display", "block");
            } else if (linkType == 3) {
                $("#container-special").css("display", "block");
                $("#container-video").css("display", "none");
                $("#container-web").css("display", "none");
            }
        });
        //获取专辑列表
        $.post('/BuWan/admin/new/api/special/getspeciallist', {}, function (data) {
            if (data.code == 0) {
                $("#container-special ul").empty();
                data.data.forEach(function (special) {
                    $("#container-special ul").append("<li><div class='checkbox'><label><input type='radio' name='special-choose' value='" + special.id + "' >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" + special.name + "</label></div></li>");
                });
            }
        }, 'json');
        //搜索点击
        $("#container-video .search button").click(function () {
            var key = $("#container-video .search input").val();
            var index = layer.load(0, {
                'shade': false
            });
            $.post('/BuWan/admin/new/api/common/searchvideo', {
                'key': key
            }, function (data) {
                layer.close(index);
                if (data.code == 0) {
                    $(".search-result table tbody").empty();
                    var html = "";
                    data.data.forEach(function (video) {
                        html += "<tr><td>" + video.id;
                        html += "</td><td>" + video.name + "</td><td><img style='width: 80px;' src=" + video.picture + "> </td><td>" + (video.show == 1 ? '显示' : '不显示') + "</td>";
                        html += "<td><input type='radio' name='choose-video' value=" + video.id + "></td></tr>";
                    });
                    $(".search-result table tbody").html(html);
                }
            }, 'json');
        });
        $("#dialog-chooselink .sure").click(function () {
            var type = $("#dialog-chooselink select").eq(0).val();
            var value;
            if (type == 1) {
                var videoid = $('#dialog-chooselink .search-result input[name="choose-video"]:checked').val();
                console.log(videoid);
                if (videoid == undefined || videoid == null) {
                    layer.msg("请选择视频");
                    return;
                }
                value = videoid;
                $("#jump-detail").html("视频:" + videoid);
            } else if (type == 2) {
                var url = $("#container-web input[type=text]").val();
                if (url == undefined || url == '' || url.length < 1) {
                    layer.msg("请输入网页链接");
                    return;
                }
                value = url;
                $("#jump-detail").html("网页链接:" + url);
            } else if (type == 3) {
                var specialid = $('#dialog-chooselink #container-special input[name="special-choose"]:checked').val();
                console.log(specialid);
                if (specialid == undefined || specialid == null) {
                    layer.msg("请选择专辑");
                    return;
                }
                value = specialid;
                $("#jump-detail").html("专辑:" + specialid);
            }
            $("#linkType").val(type);
            $("#linkValue").val(value);
            layer.close(index);
        });
        $("#dialog-chooselink .cancel").click(function () {
            layer.close(index);
        });
        $("#choose-link").click(function () {
            index = layer.open({
                type: 1,
                title: '链接选择',
                shadeClose: true,
                shade: 0.8,
                area: ['1000px', '800px'],
                content: $("#dialog-chooselink")
            });
        });
    });
</script>
</body>
</html>
src/main/webapp/admin/new/add-lmneirong.html
@@ -1,209 +1,216 @@
<html lang="zh-cn">
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <meta name="referrer" content="never">
        <title>添加栏目</title>
        <link href="css/bootstrap.min.css" rel="stylesheet">
        <link href="css/maincontent.css" rel="stylesheet">
        <link href="css/tablestyle.css" rel="stylesheet">
        <style>
            .form-group {
                margin-bottom: 30px;
            }
            .checkbox input[type=checkbox] {
                top: 6px;
            }
        </style>
    </head>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="referrer" content="never">
    <title>添加栏目</title>
    <link href="css/bootstrap.min.css" rel="stylesheet">
    <link href="css/maincontent.css" rel="stylesheet">
    <link href="css/tablestyle.css" rel="stylesheet">
    <style>
        .form-group {
            margin-bottom: 30px;
        }
    <body>
        <nav class="navbar navbar-default navbar-fixed-top">
        </nav>
        <div id="mainbody">
            <div id="sidebar">
                <dl>
                </dl>
            </div>
            <div id="neirong">
                <div class="erjidh">
                    <ol class="breadcrumb">
                        <li>
                            <a href="tuijian-lanmuneirong.html">栏目内容</a>
                        </li>
                        <li class="active">添加内容</li>
                    </ol>
                </div>
                <form class="form-horizontal" role="form">
                    <div class="form-group">
                        <label for="input1" class="changdu1 control-label">名称</label>
                        <div class="col-sm-7">
                            <input type="text" class="form-control" id="name" placeholder="必须填写">
                        </div>
                    </div>
        .checkbox input[type=checkbox] {
            top: 6px;
        }
    </style>
</head>
                    <div class="form-group">
                        <label for="input1" class="changdu1 control-label">图标</label>
                        <div class="col-sm-7">
                            <img style="width: 50px;" class="icon-img" />
                            <input type="text" class="form-control" id="icon" placeholder="必须填写">
                        </div>
                    </div>
<body>
<nav class="navbar navbar-default navbar-fixed-top">
</nav>
<div id="mainbody">
    <div id="sidebar">
        <dl>
        </dl>
    </div>
    <div id="neirong">
        <div class="erjidh">
            <ol class="breadcrumb">
                <li>
                    <a href="tuijian-lanmuneirong.html">栏目内容</a>
                </li>
                <li class="active">添加内容</li>
            </ol>
        </div>
        <form class="form-horizontal" role="form">
            <div class="form-group">
                <label for="input1" class="changdu1 control-label">名称</label>
                <div class="col-sm-7">
                    <input type="text" class="form-control" id="name" placeholder="必须填写">
                </div>
            </div>
                    <div class="form-group">
                        <label for="input2" class="changdu1 control-label">权重</label>
                        <div class="col-sm-7">
                            <input type="text" class="form-control" id="orderby" placeholder="必须填写">
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="input2" class="changdu1 control-label">所属分类</label>
                        <div class="col-sm-7">
                            <select id="classtype"></select>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="input2" class="changdu1 control-label">是否显示更多</label>
                        <div class="col-sm-7">
                            <div class="checkbox">
                                <label>
                      <input type="checkbox" id="hasMore" value="#">
                </label>
                            </div>
                        </div>
                    </div>
            <div class="form-group">
                <label for="input1" class="changdu1 control-label">图标</label>
                <div class="col-sm-7">
                    <img style="width: 50px;" class="icon-img"/>
                    <input type="text" class="form-control" id="icon" placeholder="必须填写">
                </div>
            </div>
                    <div class="form-group">
                        <label for="input3" class="changdu1 control-label">显示列数</label>
                        <div class="col-sm-7">
                            <input type="text" class="form-control" id="column" placeholder="必须填写">
                        </div>
                    </div>
            <div class="form-group">
                <label for="input2" class="changdu1 control-label">权重</label>
                <div class="col-sm-7">
                    <input type="text" class="form-control" id="orderby" placeholder="必须填写">
                </div>
            </div>
                    <div class="form-group">
                        <label for="input4" class="changdu1 control-label">显示个数</label>
                        <div class="col-sm-7">
                            <input type="text" class="form-control" id="number" placeholder="必须填写">
                        </div>
                    </div>
            <div class="form-group">
                <label for="input2" class="changdu1 control-label">顶部标签</label>
                <div class="col-sm-7">
                    <select id="classtype" class="form-control" style="max-width: 150px;"></select>
                </div>
            </div>
                    <div class="form-group">
                        <label for="input5" class="changdu1 control-label">Android跳转到的类</label>
                        <div class="col-sm-7">
                            <input type="text" class="form-control" id="activity" placeholder="">
                        </div>
                    </div>
            <div class="form-group">
                <label for="input2" class="changdu1 control-label">是否显示更多</label>
                <div class="col-sm-7">
                    <div class="checkbox">
                        <label>
                            <input type="checkbox" id="hasMore" value="#">
                        </label>
                    </div>
                </div>
            </div>
                    <div class="form-group">
                        <label for="input6" class="changdu1 control-label">IOS跳转到的类</label>
                        <div class="col-sm-7">
                            <input type="text" class="form-control" id="ioscontrol" placeholder="">
                        </div>
                    </div>
            <div class="form-group">
                <label for="input3" class="changdu1 control-label">显示列数</label>
                <div class="col-sm-7">
                    <input type="text" class="form-control" id="column" placeholder="必须填写">
                </div>
            </div>
                    <div class="form-group">
                        <label for="input7" class="changdu1 control-label">跳转参数</label>
                        <div class="col-sm-7">
                            <textarea class="form-control" rows="7" id="params"></textarea>
                        </div>
                    </div>
            <div class="form-group">
                <label for="input4" class="changdu1 control-label">显示个数</label>
                <div class="col-sm-7">
                    <input type="text" class="form-control" id="number" placeholder="必须填写">
                </div>
            </div>
                    <div class="form-group">
                        <label for="input7" class="changdu1 control-label">媒体</label>
                        <div class="col-sm-7 detailsystem">
            <div class="form-group">
                <label for="input5" class="changdu1 control-label">Android跳转到的类</label>
                <div class="col-sm-7">
                    <input type="text" class="form-control" id="activity" placeholder="">
                </div>
            </div>
                        </div>
                    </div>
                    <div class="button0">
                        <div class="button">
                            <button type="button" class="btn btn-primary save">保存</button>
                        </div>
                        <div class="button">
                            <input type="reset" class="btn btn-default" value="重置" />
                        </div>
                    </div>
                </form>
            <div class="form-group">
                <label for="input6" class="changdu1 control-label">IOS跳转到的类</label>
                <div class="col-sm-7">
                    <input type="text" class="form-control" id="ioscontrol" placeholder="">
                </div>
            </div>
            </div>
        </div>
            <div class="form-group">
                <label for="input7" class="changdu1 control-label">跳转参数</label>
                <div class="col-sm-7">
                    <textarea class="form-control" rows="7" id="params"></textarea>
                </div>
            </div>
        <script src="//cdn.bootcss.com/jquery/1.10.1/jquery.min.js"></script>
        <script src="js/bootstrap.min.js"></script>
        <script src="js/nav.js"></script>
        <script src="js/common.js"></script>
        <script src="layer/layer.js"></script>
        <script>
            $(function() {
                $.post('api/videoType/getAllVideoType',function(data){
                    if(data.code==0){
                        var list = data.list;
                        for(var i= 0;i <list.length;i++){
                            var vt = list[i];
                            var vid =vt.id;
                            $("#classtype").append("<option key='"+vid+"'>"+vt.name+"</option>")
                        }
                    }
                },'json')
                $.post('api/common/detailsystemlist', function(data) {
                    if(data.code == 0) {
                        var dsStr = "";
                        data.data.forEach(function(ds) {
                            dsStr += "<div class='checkbox '><label>";
                            dsStr += "<input type='checkbox' value=" + ds.id + ">";
                            dsStr += "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" + ds.name;
                            dsStr += "</label></div>";
                        });
                        $(".detailsystem").html(dsStr);
                    }
                }, 'json');
            <div class="form-group">
                <label for="input7" class="changdu1 control-label">媒体</label>
                <div class="col-sm-7 detailsystem">
                $(".save").click(function() {
                    var $detailsystems = $(".detailsystem input[type=checkbox]");
                    var dess = "";
                    for(var i = 0; i < $detailsystems.length; i++) {
                        if($detailsystems.eq(i).is(":checked")) {
                            dess += $detailsystems.eq(i).val() + ",";
                        }
                    }
                    if(dess.length > 0)
                        dess = dess.substr(0, dess.length - 1);
                </div>
            </div>
            <div class="button0">
                <div class="button">
                    <button type="button" class="btn btn-primary save">保存</button>
                </div>
                <div class="button">
                    <input type="reset" class="btn btn-default" value="重置"/>
                </div>
            </div>
        </form>
                    var index = layer.load(0, {
                        'shade': false
                    });
                    $.post('api/home/addhometype', {
                        'name': $("#name").val(),
                        'orderby': $("#orderby").val(),
                        'activity': $("#activity").val(),
                        'params': $("#params").val(),
                        'iosControl': $("#ioscontrol").val(),
                        'columns': $("#column").val(),
                        'number': $("#number").val(),
                        'hasMore': $("#hasMore").is(":checked") ? true : false,
                        'icon': $("#icon").val(),
                        'detailsystemids': dess,
                        'videoType.id':$("#classtype :checked").attr("key")
                    }, function(data) {
                        layer.close(index);
                        layer.msg(data.msg);
                        doResponse(data, function() {
    </div>
</div>
                        });
                    }, 'json');
<script src="//cdn.bootcss.com/jquery/1.10.1/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/nav.js"></script>
<script src="js/common.js"></script>
<script src="layer/layer.js"></script>
<script>
    $(function () {
                });
        $.post('api/homerecommend/getSpcialList', {
            "page": 1
        }, function (data) {
            if (data.code == 0) {
                var datas = data.data.data;
                $("#classtype").empty();
                for (var i = 0; i < datas.length; i++) {
                    var html = "<option";
                    html += " value=" + datas[i].special.dataKey + " >";
                    html += datas[i].special.name;
                    html += "</option>";
                    $("#classtype").append(html);
                }
            });
        </script>
    </body>
            }
        }, "json");
        $.post('api/common/detailsystemlist', function (data) {
            if (data.code == 0) {
                var dsStr = "";
                data.data.forEach(function (ds) {
                    dsStr += "<div class='checkbox '><label>";
                    dsStr += "<input type='checkbox' value=" + ds.id + ">";
                    dsStr += "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" + ds.name;
                    dsStr += "</label></div>";
                });
                $(".detailsystem").html(dsStr);
            }
        }, 'json');
        $(".save").click(function () {
            var $detailsystems = $(".detailsystem input[type=checkbox]");
            var dess = "";
            for (var i = 0; i < $detailsystems.length; i++) {
                if ($detailsystems.eq(i).is(":checked")) {
                    dess += $detailsystems.eq(i).val() + ",";
                }
            }
            if (dess.length > 0)
                dess = dess.substr(0, dess.length - 1);
            var index = layer.load(0, {
                'shade': false
            });
            $.post('api/home/addhometype', {
                'name': $("#name").val(),
                'orderby': $("#orderby").val(),
                'activity': $("#activity").val(),
                'params': $("#params").val(),
                'iosControl': $("#ioscontrol").val(),
                'columns': $("#column").val(),
                'number': $("#number").val(),
                'hasMore': $("#hasMore").is(":checked") ? true : false,
                'icon': $("#icon").val(),
                'detailsystemids': dess,
                'specialDataKey': $("#classtype").val()
            }, function (data) {
                layer.close(index);
                layer.msg(data.msg);
                doResponse(data, function () {
                });
            }, 'json');
        });
    });
</script>
</body>
</html>
src/main/webapp/admin/new/edit-banner.html
@@ -1,431 +1,464 @@
<html lang="zh-cn">
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <meta name="referrer" content="never">
        <title>添加推荐Banner</title>
        <link href="css/bootstrap.min.css" rel="stylesheet">
        <link href="css/maincontent.css" rel="stylesheet">
        <link href="css/tablestyle.css" rel="stylesheet">
        <style>
            .form-group {
                margin-bottom: 30px;
            }
            .checkbox input[type=checkbox] {
                top: 6px;
            }
            #container-video {
                display: block;
            }
            #container-web {
                display: none;
            }
            #container-special {
                display: none;
            }
            #dialog-chooselink {
                padding: 20px;
            }
            #dialog-chooselink select {
                width: 100px;
            }
            #dialog-chooselink label {
                display: inline;
            }
            #dialog-chooselink input[type=text] {
                display: inline;
                width: 500px;
            }
            #dialog-chooselink ul {
                display: block;
                list-style: none;
            }
            #dialog-chooselink ul li {
                display: inline;
                list-style: none;
                width: 33%;
                float: left;
            }
            #dialog-chooselink input[type=radio] {
                width: 20px;
                height: 20px;
            }
            #dialog-chooselink .search-result {
                height: 630px;
                overflow-y: scroll;
            }
        </style>
    </head>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="referrer" content="never">
    <title>添加推荐Banner</title>
    <link href="css/bootstrap.min.css" rel="stylesheet">
    <link href="css/maincontent.css" rel="stylesheet">
    <link href="css/tablestyle.css" rel="stylesheet">
    <style>
        .form-group {
            margin-bottom: 30px;
        }
    <body>
        <nav class="navbar navbar-default navbar-fixed-top">
        </nav>
        <div id="mainbody">
            <div id="sidebar">
                <dl>
                </dl>
            </div>
            <div id="neirong">
                <div class="erjidh">
                    <ol class="breadcrumb">
                        <li>
                            <a href="tuijian-lanmuneirong.html">推荐Banner</a>
                        </li>
                        <li class="active">添加内容</li>
                    </ol>
                </div>
                <form class="form-horizontal">
                    <div class="form-group">
                        <label for="input1" class="changdu1 control-label">图片链接</label>
                        <div class="col-sm-7">
                            <input type="text" class="form-control" id="picture" placeholder="必须填写">
                        </div>
                    </div>
        .checkbox input[type=checkbox] {
            top: 6px;
        }
                    <div class="form-group">
                        <label for="input2" class="changdu1 control-label">权重</label>
                        <div class="col-sm-7">
                            <input type="text" class="form-control" id="orderby" placeholder="必须填写">
                        </div>
                    </div>
        #container-video {
            display: block;
        }
                    <div class="form-group">
                        <label for="input3" class="changdu1 control-label">简要介绍</label>
                        <div class="col-sm-7">
                            <input type="text" class="form-control" id="introduction" placeholder="">
                        </div>
                    </div>
        #container-web {
            display: none;
        }
                    <div class="form-group">
                        <label for="input4" class="changdu1 control-label">跳转详情</label>
                        <div class="col-sm-7">
                            <label id="jump-detail"></label>
                            <input type="hidden" id="linkType" />
                            <input type="hidden" id="linkValue" />
                            <a href="javascript:void(0)" class="btn btn-info" id="choose-link">选择</a>
                        </div>
                    </div>
        #container-special {
            display: none;
        }
                    <div class="form-group">
                        <label for="input5" class="changdu1 control-label">备注</label>
                        <div class="col-sm-7">
                            <textarea class="form-control" id="beizhu"></textarea>
                        </div>
                    </div>
        #dialog-chooselink {
            padding: 20px;
        }
                    <div class="button0">
                        <div class="button">
                            <button type="button" class="btn btn-primary save">保存</button>
                        </div>
                        <div class="button">
                            <input type="reset" class="btn btn-default" value="重置" />
                        </div>
                    </div>
                </form>
        #dialog-chooselink select {
            width: 100px;
        }
            </div>
            <div id="dialog-chooselink" style="display: none;">
                <div class="row" style="height: 690px;">
                    <div class="col-lg-3 col-md-3" style="display: inline;">
                        <select class="form-control">
                            <option value="1">视频</option>
                            <option value="2">网页</option>
                            <option value="3">合集</option>
                        </select>
                    </div>
                    <div class="col-lg-9 col-md-9" style="display: inline;">
                        <!--视频选择 -->
                        <div id="container-video">
                            <div class="search">
                                <input type="text" class="form-control" placeholder="请输入关键字" style="width: 200px;display: inline;" />
                                <button class="btn btn-info">搜索</button>
                            </div>
        #dialog-chooselink label {
            display: inline;
        }
                            <!-- 搜索结果展示区域-->
                            <div class="search-result">
                                <table class="table">
                                    <thead>
                                        <th>编号</th>
                                        <th>名称</th>
                                        <th>封面</th>
                                        <th>是否显示</th>
                                        <th>选择</th>
        #dialog-chooselink input[type=text] {
            display: inline;
            width: 500px;
        }
                                    </thead>
        #dialog-chooselink ul {
            display: block;
            list-style: none;
        }
                                    <tbody>
        #dialog-chooselink ul li {
            display: inline;
            list-style: none;
            width: 33%;
            float: left;
        }
                                    </tbody>
        #dialog-chooselink input[type=radio] {
            width: 20px;
            height: 20px;
        }
                                </table>
        #dialog-chooselink .search-result {
            height: 630px;
            overflow-y: scroll;
        }
    </style>
</head>
                            </div>
<body>
<nav class="navbar navbar-default navbar-fixed-top">
</nav>
<div id="mainbody">
    <div id="sidebar">
        <dl>
        </dl>
    </div>
    <div id="neirong">
        <div class="erjidh">
            <ol class="breadcrumb">
                <li>
                    <a href="tuijian-banner">推荐Banner</a>
                </li>
                <li class="active">添加内容</li>
            </ol>
        </div>
        <form class="form-horizontal">
            <div class="form-group">
                <label for="input1" class="changdu1 control-label">图片链接</label>
                <div class="col-sm-7">
                    <input type="text" class="form-control" id="picture" placeholder="必须填写">
                </div>
            </div>
                        </div>
                        <!--网页填写 -->
                        <div id="container-web">
                            <label>网页链接:</label>
                            <input type="text" class="form-control" />
                        </div>
                        <!--合集选择 -->
                        <div id="container-special">
                            <label>合集列表</label>
                            <ul>
                                <li>
                                    <div class="checkbox"><label><input type="checkbox" value="46" >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;布丸影视大全Web1</label></div>
                                </li>
                                <li>
                                    <div class="checkbox"><label><input type="checkbox" value="46" >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;布丸影视大全Web2</label></div>
                                </li>
                            </ul>
            <div class="form-group">
                <label for="input2" class="changdu1 control-label">顶部标签</label>
                <div class="col-sm-7">
                    <select id="special" class="form-control" style="max-width: 150px;">
                        </div>
                    </div>
                </div>
                    </select>
                </div>
            </div>
                <div style="float: right;">
                    <button class="btn btn-info sure">确定</button>
                    <button class="btn btn-default cancel">取消</button>
                </div>
            <div class="form-group">
                <label for="input2" class="changdu1 control-label">权重</label>
                <div class="col-sm-7">
                    <input type="text" class="form-control" id="orderby" placeholder="必须填写">
                </div>
            </div>
            </div>
            <div class="form-group">
                <label for="input3" class="changdu1 control-label">简要介绍</label>
                <div class="col-sm-7">
                    <input type="text" class="form-control" id="introduction" placeholder="">
                </div>
            </div>
        </div>
            <div class="form-group">
                <label for="input4" class="changdu1 control-label">跳转详情</label>
                <div class="col-sm-7">
                    <label id="jump-detail"></label>
                    <input type="hidden" id="linkType"/>
                    <input type="hidden" id="linkValue"/>
                    <a href="javascript:void(0)" class="btn btn-info" id="choose-link">选择</a>
                </div>
            </div>
        <script src="//cdn.bootcss.com/jquery/1.10.1/jquery.min.js"></script>
        <script src="js/bootstrap.min.js"></script>
        <script src="js/nav.js"></script>
        <script src="js/common.js"></script>
        <script src="layer/layer.js"></script>
        <script>
            function getQueryString(name) {
                var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
                var r = window.location.search.substr(1).match(reg);
                if(r != null) return unescape(r[2]);
                return null;
            }
            var id = getQueryString("id");
            $(function() {
            <div class="form-group">
                <label for="input5" class="changdu1 control-label">备注</label>
                <div class="col-sm-7">
                    <textarea class="form-control" id="beizhu"></textarea>
                </div>
            </div>
                var inx = layer.load(0, {
                    "shade": false
                });
                $.post('api/homebanner/gethomead', {
                    'id': id
                }, function(data) {
                    layer.close(inx);
                    if(data.code == 0) {
                        $("#picture").val(data.data.picture);
                        $("#orderby").val(data.data.orderby);
                        $("#introduction").val(data.data.introduction);
                        $("#beizhu").val(data.data.beizhu);
                        if(data.data.linkType == 1) {
                            $("#jump-detail").html("视频:" + data.data.linkValue);
                        } else if(data.data.linkType == 2) {
                            $("#jump-detail").html("网页链接:" + data.data.linkValue);
                        } else if(data.data.linkType == 3) {
                            $("#jump-detail").html("专辑:" + data.data.linkValue);
                        }
            <div class="button0">
                <div class="button">
                    <button type="button" class="btn btn-primary save">保存</button>
                </div>
                <div class="button">
                    <input type="reset" class="btn btn-default" value="重置"/>
                </div>
            </div>
        </form>
                        $("#linkType").val(data.data.linkType);
                        $("#linkValue").val(data.data.linkValue);
    </div>
    <div id="dialog-chooselink" style="display: none;">
        <div class="row" style="height: 690px;">
            <div class="col-lg-3 col-md-3" style="display: inline;">
                <select class="form-control">
                    <option value="1">视频</option>
                    <option value="2">网页</option>
                    <option value="3">合集</option>
                </select>
            </div>
            <div class="col-lg-9 col-md-9" style="display: inline;">
                <!--视频选择 -->
                <div id="container-video">
                    <div class="search">
                        <input type="text" class="form-control" placeholder="请输入关键字"
                               style="width: 200px;display: inline;"/>
                        <button class="btn btn-info">搜索</button>
                    </div>
                    }
                    <!-- 搜索结果展示区域-->
                    <div class="search-result">
                        <table class="table">
                            <thead>
                            <th>编号</th>
                            <th>名称</th>
                            <th>封面</th>
                            <th>是否显示</th>
                            <th>选择</th>
                    doResponse(data, function() {
                            </thead>
                    });
                }, 'json');
                            <tbody>
            });
        </script>
                            </tbody>
        <script>
            var index;
            $(function() {
                $.post('/BuWan/admin/new/api/common/detailsystemlist', function(data) {
                    if(data.code == 0) {
                        var dsStr = "";
                        data.data.forEach(function(ds) {
                            dsStr += "<div class='checkbox '><label>";
                            dsStr += "<input type='checkbox' value=" + ds.id + ">";
                            dsStr += "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" + ds.name;
                            dsStr += "</label></div>";
                        });
                        $(".detailsystem").html(dsStr);
                    }
                }, 'json');
                        </table>
                $(".save").click(function() {
                    if($("#linkType").val() == undefined || $("#linkType").val().length < 1 || $("#linkType").val() == '') {
                        layer.msg("请选择跳转类型");
                        return;
                    }
                    </div>
                    if($("#linkValue").val() == undefined || $("#linkValue").val().length < 1 || $("#linkValue").val() == '') {
                        layer.msg("请选择跳转类型");
                        return;
                    }
                </div>
                <!--网页填写 -->
                <div id="container-web">
                    <label>网页链接:</label>
                    <input type="text" class="form-control"/>
                </div>
                <!--合集选择 -->
                <div id="container-special">
                    <label>合集列表</label>
                    <ul>
                        <li>
                            <div class="checkbox"><label><input type="checkbox" value="46">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;布丸影视大全Web1</label>
                            </div>
                        </li>
                        <li>
                            <div class="checkbox"><label><input type="checkbox" value="46">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;布丸影视大全Web2</label>
                            </div>
                        </li>
                    var $detailsystems = $(".detailsystem input[type=checkbox]");
                    var dess = "";
                    for(var i = 0; i < $detailsystems.length; i++) {
                        if($detailsystems.eq(i).is(":checked")) {
                            dess += $detailsystems.eq(i).val() + ",";
                        }
                    }
                    if(dess.length > 0)
                        dess = dess.substr(0, dess.length - 1);
                    </ul>
                    var index = layer.load(0, {
                        'shade': false
                    });
                    $.post('/BuWan/admin/new/api/homebanner/updatehomead', {
                        'id': id,
                        'picture': $("#picture").val(),
                        'orderby': $("#orderby").val(),
                        'introduction': $("#introduction").val(),
                        'beizhu': $("#beizhu").val(),
                        'linkType': $("#linkType").val(),
                        'linkValue': $("#linkValue").val()
                    }, function(data) {
                        layer.close(index);
                        layer.msg(data.msg);
                        doResponse(data, function() {
                </div>
            </div>
                        });
                    }, 'json');
        </div>
                });
        <div style="float: right;">
            <button class="btn btn-info sure">确定</button>
            <button class="btn btn-default cancel">取消</button>
        </div>
            });
        </script>
        <script>
            $(function() {
                $("#dialog-chooselink select").eq(0).change(function() {
                    var linkType = $(this).val();
                    if(linkType == 1) {
                        $("#container-special").css("display", "none");
                        $("#container-video").css("display", "block");
                        $("#container-web").css("display", "none");
                    } else if(linkType == 2) {
                        $("#container-special").css("display", "none");
                        $("#container-video").css("display", "none");
                        $("#container-web").css("display", "block");
                    } else if(linkType == 3) {
                        $("#container-special").css("display", "block");
                        $("#container-video").css("display", "none");
                        $("#container-web").css("display", "none");
                    }
                });
    </div>
                //获取专辑列表
                $.post('/BuWan/admin/new/api/special/getspeciallist', {}, function(data) {
                    if(data.code == 0) {
                        $("#container-special ul").empty();
                        data.data.forEach(function(special) {
                            $("#container-special ul").append("<li><div class='checkbox'><label><input type='radio' name='special-choose' value='" + special.id + "' >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" + special.name + "</label></div></li>");
                        });
                    }
                }, 'json');
</div>
                //搜索点击
                $("#container-video .search button").click(function() {
                    var key = $("#container-video .search input").val();
                    var index = layer.load(0, {
                        'shade': false
                    });
                    $.post('/BuWan/admin/new/api/common/searchvideo', {
                        'key': key
                    }, function(data) {
                        layer.close(index);
                        if(data.code == 0) {
                            $(".search-result table tbody").empty();
                            var html = "";
                            data.data.forEach(function(video) {
                                html += "<tr><td>" + video.id;
                                html += "</td><td>" + video.name + "</td><td><img style='width: 80px;' src=" + video.picture + "> </td><td>" + (video.show == 1 ? '显示' : '不显示') + "</td>";
                                html += "<td><input type='radio' name='choose-video' value=" + video.id + "></td></tr>";
                            });
                            $(".search-result table tbody").html(html);
                        }
<script src="//cdn.bootcss.com/jquery/1.10.1/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/nav.js"></script>
<script src="js/common.js"></script>
<script src="layer/layer.js"></script>
<script>
    function getQueryString(name) {
        var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
        var r = window.location.search.substr(1).match(reg);
        if (r != null) return unescape(r[2]);
        return null;
    }
                    }, 'json');
                });
    var id = getQueryString("id");
    $(function () {
                $("#dialog-chooselink .sure").click(function() {
                    var type = $("#dialog-chooselink select").eq(0).val();
                    var value;
                    if(type == 1) {
                        var videoid = $('#dialog-chooselink .search-result input[name="choose-video"]:checked').val();
                        console.log(videoid);
                        if(videoid == undefined || videoid == null) {
                            layer.msg("请选择视频");
                            return;
                        }
                        value = videoid;
                        $("#jump-detail").html("视频:" + videoid);
        var inx = layer.load(0, {
            "shade": false
        });
        $.post('api/homebanner/gethomead', {
            'id': id
        }, function (data) {
            layer.close(inx);
            if (data.code == 0) {
                $("#picture").val(data.data.picture);
                $("#orderby").val(data.data.orderby);
                $("#introduction").val(data.data.introduction);
                $("#beizhu").val(data.data.beizhu);
                if (data.data.linkType == 1) {
                    $("#jump-detail").html("视频:" + data.data.linkValue);
                } else if (data.data.linkType == 2) {
                    $("#jump-detail").html("网页链接:" + data.data.linkValue);
                } else if (data.data.linkType == 3) {
                    $("#jump-detail").html("专辑:" + data.data.linkValue);
                }
                    } else if(type == 2) {
                        var url = $("#container-web input[type=text]").val();
                        if(url == undefined || url == '' || url.length < 1) {
                            layer.msg("请输入网页链接");
                            return;
                        }
                        value = url;
                        $("#jump-detail").html("网页链接:" + url);
                $("#linkType").val(data.data.linkType);
                $("#linkValue").val(data.data.linkValue);
                var specialKey = data.data.specialDataKey;
                    } else if(type == 3) {
                        var specialid = $('#dialog-chooselink #container-special input[name="special-choose"]:checked').val();
                        console.log(specialid);
                        if(specialid == undefined || specialid == null) {
                            layer.msg("请选择专辑");
                            return;
                        }
                        value = specialid;
                        $("#jump-detail").html("专辑:" + specialid);
                    }
                $.post('api/homerecommend/getSpcialList', {
                    "page": 1
                }, function (data) {
                    if (data.code == 0) {
                        var list = data.data.data;
                        $("#special").empty();
                        for (var i = 0; i < list.length; i++) {
                            var vt = list[i];
                            $("#special").append("<option key='" + vt.special.dataKey + "'>" + vt.special.name + "</option>")
                        }
                        if (specialKey)
                            $("#special option[key=" + specialKey + "]")[0].selected = true;
                    }
                    $("#linkType").val(type);
                    $("#linkValue").val(value);
                    layer.close(index);
                }, "json");
                });
            }
                $("#dialog-chooselink .cancel").click(function() {
                    layer.close(index);
                });
            doResponse(data, function () {
                $("#choose-link").click(function() {
                    index = layer.open({
                        type: 1,
                        title: '链接选择',
                        shadeClose: true,
                        shade: 0.8,
                        area: ['1000px', '800px'],
                        content: $("#dialog-chooselink")
                    });
            });
        }, 'json');
                });
            });
        </script>
    });
</script>
    </body>
<script>
    var index;
    $(function () {
        $.post('/BuWan/admin/new/api/common/detailsystemlist', function (data) {
            if (data.code == 0) {
                var dsStr = "";
                data.data.forEach(function (ds) {
                    dsStr += "<div class='checkbox '><label>";
                    dsStr += "<input type='checkbox' value=" + ds.id + ">";
                    dsStr += "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" + ds.name;
                    dsStr += "</label></div>";
                });
                $(".detailsystem").html(dsStr);
            }
        }, 'json');
        $(".save").click(function () {
            if ($("#linkType").val() == undefined || $("#linkType").val().length < 1 || $("#linkType").val() == '') {
                layer.msg("请选择跳转类型");
                return;
            }
            if ($("#linkValue").val() == undefined || $("#linkValue").val().length < 1 || $("#linkValue").val() == '') {
                layer.msg("请选择跳转类型");
                return;
            }
            var $detailsystems = $(".detailsystem input[type=checkbox]");
            var dess = "";
            for (var i = 0; i < $detailsystems.length; i++) {
                if ($detailsystems.eq(i).is(":checked")) {
                    dess += $detailsystems.eq(i).val() + ",";
                }
            }
            if (dess.length > 0)
                dess = dess.substr(0, dess.length - 1);
            var index = layer.load(0, {
                'shade': false
            });
            $.post('/BuWan/admin/new/api/homebanner/updatehomead', {
                'id': id,
                'picture': $("#picture").val(),
                'orderby': $("#orderby").val(),
                'introduction': $("#introduction").val(),
                'beizhu': $("#beizhu").val(),
                'linkType': $("#linkType").val(),
                'linkValue': $("#linkValue").val(),
                'specialDataKey': $("#special :checked").attr("key")
            }, function (data) {
                layer.close(index);
                layer.msg(data.msg);
                doResponse(data, function () {
                });
            }, 'json');
        });
    });
</script>
<script>
    $(function () {
        $("#dialog-chooselink select").eq(0).change(function () {
            var linkType = $(this).val();
            if (linkType == 1) {
                $("#container-special").css("display", "none");
                $("#container-video").css("display", "block");
                $("#container-web").css("display", "none");
            } else if (linkType == 2) {
                $("#container-special").css("display", "none");
                $("#container-video").css("display", "none");
                $("#container-web").css("display", "block");
            } else if (linkType == 3) {
                $("#container-special").css("display", "block");
                $("#container-video").css("display", "none");
                $("#container-web").css("display", "none");
            }
        });
        //获取专辑列表
        $.post('/BuWan/admin/new/api/special/getspeciallist', {}, function (data) {
            if (data.code == 0) {
                $("#container-special ul").empty();
                data.data.forEach(function (special) {
                    $("#container-special ul").append("<li><div class='checkbox'><label><input type='radio' name='special-choose' value='" + special.id + "' >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" + special.name + "</label></div></li>");
                });
            }
        }, 'json');
        //搜索点击
        $("#container-video .search button").click(function () {
            var key = $("#container-video .search input").val();
            var index = layer.load(0, {
                'shade': false
            });
            $.post('/BuWan/admin/new/api/common/searchvideo', {
                'key': key
            }, function (data) {
                layer.close(index);
                if (data.code == 0) {
                    $(".search-result table tbody").empty();
                    var html = "";
                    data.data.forEach(function (video) {
                        html += "<tr><td>" + video.id;
                        html += "</td><td>" + video.name + "</td><td><img style='width: 80px;' src=" + video.picture + "> </td><td>" + (video.show == 1 ? '显示' : '不显示') + "</td>";
                        html += "<td><input type='radio' name='choose-video' value=" + video.id + "></td></tr>";
                    });
                    $(".search-result table tbody").html(html);
                }
            }, 'json');
        });
        $("#dialog-chooselink .sure").click(function () {
            var type = $("#dialog-chooselink select").eq(0).val();
            var value;
            if (type == 1) {
                var videoid = $('#dialog-chooselink .search-result input[name="choose-video"]:checked').val();
                console.log(videoid);
                if (videoid == undefined || videoid == null) {
                    layer.msg("请选择视频");
                    return;
                }
                value = videoid;
                $("#jump-detail").html("视频:" + videoid);
            } else if (type == 2) {
                var url = $("#container-web input[type=text]").val();
                if (url == undefined || url == '' || url.length < 1) {
                    layer.msg("请输入网页链接");
                    return;
                }
                value = url;
                $("#jump-detail").html("网页链接:" + url);
            } else if (type == 3) {
                var specialid = $('#dialog-chooselink #container-special input[name="special-choose"]:checked').val();
                console.log(specialid);
                if (specialid == undefined || specialid == null) {
                    layer.msg("请选择专辑");
                    return;
                }
                value = specialid;
                $("#jump-detail").html("专辑:" + specialid);
            }
            $("#linkType").val(type);
            $("#linkValue").val(value);
            layer.close(index);
        });
        $("#dialog-chooselink .cancel").click(function () {
            layer.close(index);
        });
        $("#choose-link").click(function () {
            index = layer.open({
                type: 1,
                title: '链接选择',
                shadeClose: true,
                shade: 0.8,
                area: ['1000px', '800px'],
                content: $("#dialog-chooselink")
            });
        });
    });
</script>
</body>
</html>
src/main/webapp/admin/new/edit-lmneirong.html
@@ -1,230 +1,237 @@
<html lang="zh-cn">
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <meta name="referrer" content="never">
        <title>添加栏目</title>
        <link href="css/bootstrap.min.css" rel="stylesheet">
        <link href="css/maincontent.css" rel="stylesheet">
        <link href="css/tablestyle.css" rel="stylesheet">
        <style>
            .form-group {
                margin-bottom: 30px;
            }
            .checkbox input[type=checkbox] {
                top: 6px;
            }
        </style>
    </head>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="referrer" content="never">
    <title>添加栏目</title>
    <link href="css/bootstrap.min.css" rel="stylesheet">
    <link href="css/maincontent.css" rel="stylesheet">
    <link href="css/tablestyle.css" rel="stylesheet">
    <style>
        .form-group {
            margin-bottom: 30px;
        }
    <body>
        <nav class="navbar navbar-default navbar-fixed-top">
        </nav>
        <div id="mainbody">
            <div id="sidebar">
                <dl>
                </dl>
            </div>
            <div id="neirong">
                <div class="erjidh">
                    <ol class="breadcrumb">
                        <li>
                            <a href="tuijian-lanmuneirong.html">栏目内容</a>
                        </li>
                        <li class="active">修改内容</li>
                    </ol>
                </div>
                <form class="form-horizontal" role="form">
                    <div class="form-group">
                        <label for="input1" class="changdu1 control-label">名称</label>
                        <div class="col-sm-7">
                            <input type="text" class="form-control" id="name" placeholder="">
                        </div>
                    </div>
        .checkbox input[type=checkbox] {
            top: 6px;
        }
    </style>
</head>
                    <div class="form-group">
                        <label for="input1" class="changdu1 control-label">图标</label>
                        <div class="col-sm-7">
                            <img style="width: 50px;" class="icon-img" />
                            <input type="text" class="form-control" id="icon" placeholder="">
                        </div>
                    </div>
<body>
<nav class="navbar navbar-default navbar-fixed-top">
</nav>
<div id="mainbody">
    <div id="sidebar">
        <dl>
        </dl>
    </div>
    <div id="neirong">
        <div class="erjidh">
            <ol class="breadcrumb">
                <li>
                    <a href="tuijian-lanmuneirong.html">栏目内容</a>
                </li>
                <li class="active">修改内容</li>
            </ol>
        </div>
        <form class="form-horizontal" role="form">
            <div class="form-group">
                <label for="input1" class="changdu1 control-label">名称</label>
                <div class="col-sm-7">
                    <input type="text" class="form-control" id="name" placeholder="">
                </div>
            </div>
                    <div class="form-group">
                        <label for="input2" class="changdu1 control-label">权重</label>
                        <div class="col-sm-7">
                            <input type="text" class="form-control" id="orderby" placeholder="">
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="input2" class="changdu1 control-label">所属分类</label>
                        <div class="col-sm-7">
                            <select id="classtype"></select>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="input2" class="changdu1 control-label">是否显示更多</label>
                        <div class="col-sm-7">
                            <div class="checkbox">
                                <label>
                      <input type="checkbox" id="hasMore" value="#">
                </label>
                            </div>
                        </div>
                    </div>
            <div class="form-group">
                <label for="input1" class="changdu1 control-label">图标</label>
                <div class="col-sm-7">
                    <img style="width: 50px;" class="icon-img"/>
                    <input type="text" class="form-control" id="icon" placeholder="">
                </div>
            </div>
                    <div class="form-group">
                        <label for="input3" class="changdu1 control-label">显示列数</label>
                        <div class="col-sm-7">
                            <input type="text" class="form-control" id="column" placeholder="">
                        </div>
                    </div>
            <div class="form-group">
                <label for="input2" class="changdu1 control-label">权重</label>
                <div class="col-sm-7">
                    <input type="text" class="form-control" id="orderby" placeholder="">
                </div>
            </div>
                    <div class="form-group">
                        <label for="input4" class="changdu1 control-label">显示个数</label>
                        <div class="col-sm-7">
                            <input type="text" class="form-control" id="number" placeholder="">
                        </div>
                    </div>
            <div class="form-group">
                <label for="input2" class="changdu1 control-label">顶部标签</label>
                <div class="col-sm-7">
                    <select id="classtype" class="form-control" style="max-width: 150px;"></select>
                </div>
            </div>
                    <div class="form-group">
                        <label for="input5" class="changdu1 control-label">Android跳转到的类</label>
                        <div class="col-sm-7">
                            <input type="text" class="form-control" id="activity" placeholder="">
                        </div>
                    </div>
            <div class="form-group">
                <label for="input2" class="changdu1 control-label">是否显示更多</label>
                <div class="col-sm-7">
                    <div class="checkbox">
                        <label>
                            <input type="checkbox" id="hasMore" value="#">
                        </label>
                    </div>
                </div>
            </div>
                    <div class="form-group">
                        <label for="input6" class="changdu1 control-label">IOS跳转到的类</label>
                        <div class="col-sm-7">
                            <input type="text" class="form-control" id="ioscontrol" placeholder="">
                        </div>
                    </div>
            <div class="form-group">
                <label for="input3" class="changdu1 control-label">显示列数</label>
                <div class="col-sm-7">
                    <input type="text" class="form-control" id="column" placeholder="">
                </div>
            </div>
                    <div class="form-group">
                        <label for="input7" class="changdu1 control-label">跳转参数</label>
                        <div class="col-sm-7">
                            <textarea class="form-control" rows="7" id="params"></textarea>
                        </div>
                    </div>
            <div class="form-group">
                <label for="input4" class="changdu1 control-label">显示个数</label>
                <div class="col-sm-7">
                    <input type="text" class="form-control" id="number" placeholder="">
                </div>
            </div>
                    <div class="form-group">
                        <label for="input7" class="changdu1 control-label">媒体</label>
                        <div class="col-sm-7 detailsystem">
            <div class="form-group">
                <label for="input5" class="changdu1 control-label">Android跳转到的类</label>
                <div class="col-sm-7">
                    <input type="text" class="form-control" id="activity" placeholder="">
                </div>
            </div>
                        </div>
                    </div>
            <div class="form-group">
                <label for="input6" class="changdu1 control-label">IOS跳转到的类</label>
                <div class="col-sm-7">
                    <input type="text" class="form-control" id="ioscontrol" placeholder="">
                </div>
            </div>
                </form>
                <div class="button0">
                    <div class="button">
                        <button type="button" class="btn btn-primary save">保存</button>
                    </div>
                    <div class="button">
                        <a href="tuijian-lanmuneirong.html" class="btn btn-default" role="button">取消</a>
                    </div>
                </div>
            </div>
        </div>
            <div class="form-group">
                <label for="input7" class="changdu1 control-label">跳转参数</label>
                <div class="col-sm-7">
                    <textarea class="form-control" rows="7" id="params"></textarea>
                </div>
            </div>
        <script src="//cdn.bootcss.com/jquery/1.10.1/jquery.min.js"></script>
        <script src="js/bootstrap.min.js"></script>
        <script src="js/nav.js"></script>
        <script src="js/common.js"></script>
        <script src="layer/layer.js"></script>
        <script>
            function getQueryString(name) {
                var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
                var r = window.location.search.substr(1).match(reg);
                if(r != null) return unescape(r[2]);
                return null;
            }
            $(function() {
                //获取参数
                var id = getQueryString("id");
                console.log(id);
                var index = layer.load(0, {
                    'shade': false
                });
                $.post('api/home/gethometype', {
                    'id': id
                }, function(data) {
                    layer.close(index);
                    $("#name").val(data.data.name);
                    $("#orderby").val(data.data.orderby);
                    $("#activity").val(data.data.activity);
                    $("#params").val(data.data.params);
                    $("#ioscontrol").val(data.data.iosControl);
                    $("#column").val(data.data.columns);
                    $("#number").val(data.data.number);
                    $("#icon").val(data.data.icon);
                    $(".icon-img").attr("src", data.data.icon);
                    $("#hasMore").attr("checked", data.data.hasMore);
                    var mvid = data.data.videoType.id;
                    $.post('api/videoType/getAllVideoType',function(data){
                    if(data.code==0){
                        var list = data.list;
                        for(var i= 0;i <list.length;i++){
                            var vt = list[i];
                            var vid =vt.id;
                            $("#classtype").append("<option key='"+vid+"'>"+vt.name+"</option>")
                        }
                        $("#classtype option[key="+mvid+"]")[0].selected=true;
                    }
                    },'json')
                    var dsStr = "";
                    data.detailsystemselect.forEach(function(ds) {
                        dsStr += "<div class='checkbox '><label>";
                        dsStr += "<input type='checkbox' value=" + ds.detailSystem.id + " " + (ds.selected == true ? 'checked' : '') + ">";
                        dsStr += "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" + ds.detailSystem.appName;
                        dsStr += "</label></div>";
                    });
                    $(".detailsystem").html(dsStr);
                }, 'json');
            <div class="form-group">
                <label for="input7" class="changdu1 control-label">媒体</label>
                <div class="col-sm-7 detailsystem">
                $(".save").click(function() {
                    var $detailsystems = $(".detailsystem input[type=checkbox]");
                    var dess = "";
                    for(var i = 0; i < $detailsystems.length; i++) {
                        if($detailsystems.eq(i).is(":checked")) {
                            dess += $detailsystems.eq(i).val() + ",";
                        }
                    }
                    if(dess.length > 0)
                        dess = dess.substr(0, dess.length - 1);
                </div>
            </div>
                    $.post('api/home/updatehometype', {
                        'id': id,
                        'name': $("#name").val(),
                        'orderby': $("#orderby").val(),
                        'activity': $("#activity").val(),
                        'params': $("#params").val(),
                        'iosControl': $("#ioscontrol").val(),
                        'columns': $("#column").val(),
                        'number': $("#number").val(),
                        'hasMore': $("#hasMore").is(":checked") ? true : false,
                        'icon': $("#icon").val(),
                        'detailsystemids': dess,
                        'videoType.id':$("#classtype :checked").attr("key")
                    }, function(data) {
                        layer.close(index);
                        layer.msg(data.msg);
                        doResponse(data, function() {
        </form>
        <div class="button0">
            <div class="button">
                <button type="button" class="btn btn-primary save">保存</button>
            </div>
            <div class="button">
                <a href="tuijian-lanmuneirong.html" class="btn btn-default" role="button">取消</a>
            </div>
        </div>
    </div>
</div>
                        });
                    }, 'json');
<script src="//cdn.bootcss.com/jquery/1.10.1/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/nav.js"></script>
<script src="js/common.js"></script>
<script src="layer/layer.js"></script>
<script>
    function getQueryString(name) {
        var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
        var r = window.location.search.substr(1).match(reg);
        if (r != null) return unescape(r[2]);
        return null;
    }
                });
    $(function () {
            });
        </script>
    </body>
        //获取参数
        var id = getQueryString("id");
        console.log(id);
        var index = layer.load(0, {
            'shade': false
        });
        $.post('api/home/gethometype', {
            'id': id
        }, function (data) {
            layer.close(index);
            $("#name").val(data.data.name);
            $("#orderby").val(data.data.orderby);
            $("#activity").val(data.data.activity);
            $("#params").val(data.data.params);
            $("#ioscontrol").val(data.data.iosControl);
            $("#column").val(data.data.columns);
            $("#number").val(data.data.number);
            $("#icon").val(data.data.icon);
            $(".icon-img").attr("src", data.data.icon);
            $("#hasMore").attr("checked", data.data.hasMore);
            var specialKey = data.data.specialDataKey;
            $.post('api/homerecommend/getSpcialList', {
                "page": 1
            }, function (data) {
                if (data.code == 0) {
                    var list = data.data.data;
                    $("#classtype").empty();
                    for (var i = 0; i < list.length; i++) {
                        var vt = list[i];
                        $("#classtype").append("<option key='" + vt.special.dataKey + "'>" + vt.special.name + "</option>")
                    }
                    if (specialKey)
                        $("#classtype option[key=" + specialKey + "]")[0].selected = true;
                }
            }, "json");
            var dsStr = "";
            data.detailsystemselect.forEach(function (ds) {
                dsStr += "<div class='checkbox '><label>";
                dsStr += "<input type='checkbox' value=" + ds.detailSystem.id + " " + (ds.selected == true ? 'checked' : '') + ">";
                dsStr += "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" + ds.detailSystem.appName;
                dsStr += "</label></div>";
            });
            $(".detailsystem").html(dsStr);
        }, 'json');
        $(".save").click(function () {
            var $detailsystems = $(".detailsystem input[type=checkbox]");
            var dess = "";
            for (var i = 0; i < $detailsystems.length; i++) {
                if ($detailsystems.eq(i).is(":checked")) {
                    dess += $detailsystems.eq(i).val() + ",";
                }
            }
            if (dess.length > 0)
                dess = dess.substr(0, dess.length - 1);
            $.post('api/home/updatehometype', {
                'id': id,
                'name': $("#name").val(),
                'orderby': $("#orderby").val(),
                'activity': $("#activity").val(),
                'params': $("#params").val(),
                'iosControl': $("#ioscontrol").val(),
                'columns': $("#column").val(),
                'number': $("#number").val(),
                'hasMore': $("#hasMore").is(":checked") ? true : false,
                'icon': $("#icon").val(),
                'detailsystemids': dess,
                'specialDataKey': $("#classtype :checked").attr("key")
            }, function (data) {
                layer.close(index);
                layer.msg(data.msg);
                doResponse(data, function () {
                });
            }, 'json');
        });
    });
</script>
</body>
</html>
src/main/webapp/admin/new/fenqu.html
@@ -116,6 +116,17 @@
                <option value="1">会员</option>
            </select>
            <select name="select" class="form-control search area">
                <option value="">--请选择区域--</option>
                <option value="内地">内地</option>
                <option value="香港">香港</option>
                <option value="台湾">台湾</option>
                <option value="美国">美国</option>
                <option value="泰国">泰国</option>
                <option value="韩国">韩国</option>
                <option value="日本">日本</option>
            </select>
            <select name="select" class="form-control search type">
                <option value="name" selected>片名</option>
@@ -186,7 +197,7 @@
                    <thead>
                    <th width="7%">选择</th>
                    <th width="7%">编号</th>
                    <th width="12%">来源</th>
                    <th width="5%">区域</th>
                    <th width="12%">封面</th>
                    <th width="17%">名称</th>
                    <th width="15%">更新时间</th>
@@ -208,11 +219,11 @@
                            <div class="bianhao videoid">623</div>
                        </td>
                        <td width="12%">
                            <div class="source" style="text-align: center;line-height: 105px;"></div>
                            <div class="area" style="text-align: center;line-height: 105px;"></div>
                        </td>
                        <td width="12%">
                            <div class="tupian-banner" style="position: relative">
                                <img alt src="image/banner/青云志.jpg" class="video-img" style="width: 240px;">
                                <img alt src="image/banner/青云志.jpg" class="video-img">
                                <span style="position: absolute;right: 2px;bottom: 2px;color: red" class="tag"></span>
@@ -665,6 +676,7 @@
                "type": $(".search-div .type").val(),
                "contenttype": $(".contenttype").val(),
                "freeType": $(".freeType").val(),
                "area": $(".area").val(),
                "key": $("#kw").val(),
                "resourceIds": JSON.stringify(resourceIds)
            }, function (data) {
@@ -688,7 +700,14 @@
                    fk.find(".videoid").html(da.id);
                    fk.find(".video-name").html(da.name);
                    fk.find(".tag").html(da.tag);
                    fk.find(".video-img").attr("src", da.picture);
                    if(da.vpicture) {
                        fk.find(".video-img").attr("src", da.vpicture);
                        fk.find(".video-img").css("width","180px");
                    }else{
                        fk.find(".video-img").attr("src", da.hpicture);
                        fk.find(".video-img").css("width","240px");
                    }
                    fk.find(".video-updatetime").html(da.updatetime);
                    if (da.show == 1)
                        fk.find(".video-show").attr("checked", true);
@@ -698,7 +717,7 @@
                    fk.find(".addrecommend a").attr("key", da.id);
                    fk.find(".edit").attr("key", da.id);
                    fk.find(".delete").attr("key", da.id);
                    fk.find(".source").text(da.source);
                    fk.find(".area").text(da.area);
                    fk.find(".edit").attr("href","edit-lmneirong-video.html?id=" + da.id);
                    if (da.freeType == 1)
src/main/webapp/admin/new/tuijian-banner.html
@@ -1,322 +1,360 @@
<html lang="zh-cn">
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <meta name="referrer" content="never">
        <title>推荐-Banner</title>
        <link href="css/bootstrap.min.css" rel="stylesheet">
        <link href="css/maincontent.css" rel="stylesheet">
        <style>
            .search {
                display: inline;
                width: auto;
            }
        </style>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="referrer" content="never">
    <title>推荐-Banner</title>
    <link href="css/bootstrap.min.css" rel="stylesheet">
    <link href="css/maincontent.css" rel="stylesheet">
    <style>
        .search {
            display: inline;
            width: auto;
        }
    </style>
    </head>
</head>
    <body>
        <nav class="navbar navbar-default navbar-fixed-top">
<body>
<nav class="navbar navbar-default navbar-fixed-top">
        </nav>
        <div id="mainbody">
            <div id="sidebar">
</nav>
<div id="mainbody">
    <div id="sidebar">
            </div>
            <div id="neirong">
                <div class="erjidh search-div" style="padding: 10px;">
    </div>
    <div id="neirong">
        <div class="erjidh search-div" style="padding: 10px;">
                    <select name="select" class="form-control search select-detailsystem">
            <select name="select" class="form-control search select-detailsystem">
                    </select>
            </select>
                    <div class="form-group search" role="search">
                        <input type="text" class="form-control search" id="kw" style="width: 200px;" placeholder="搜索">
                    </div>
                    <button type="button" class="btn btn-default search-button">搜索</button>
            <select name="select" class="form-control search recommend-labels">
                    <div class="tianjia" class="search">
                        <a href="add-banner.html" class="btn btn-primary" role="button">添加内容&nbsp;+</a>
                    </div>
            </select>
                </div>
                <div class="bottom">
                    <div class="qx">
                        <div class="checkbox">
                            <label>
          <input type="checkbox" class="check-all" value="#">
          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;全选</label>
                        </div>
                    </div>
                    <button class="btn btn-warning pl-del" type="button">批量删除</button>
                    <div class="page">
                        <ul class="pagination">
                            <li class="disabled pre">
                                <a href="#">&laquo;</a>
                            </li>
                            <li class="active">
                                <a href="#">1</a>
                            </li>
                            <li>
                                <a href="#">2</a>
                            </li>
                            <li>
                                <a href="#" class="next">&raquo;</a>
                            </li>
                        </ul>
                        <div class="form-group">
                            <div class="tzan">
                                <button type="button" class="btn btn-primary">跳转</button>
                            </div>
                            <div class="tz">
                                <input class="form-control" type="text" placeholder="页数">
                            </div>
                        </div>
                    </div>
            <div class="form-group search" role="search">
                <input type="text" class="form-control search" id="kw" style="width: 200px;" placeholder="搜索">
            </div>
            <button type="button" class="btn btn-default search-button">搜索</button>
                </div>
                <div class="zhuti">
                    <div class="zhutisousuo">
                        <table class="table">
                            <thead>
                                <th width="7%">选择</th>
                                <th width="7%">编号</th>
                                <th width="20%">封面</th>
                                <th width="22%">APP名称</th>
                                <th width="15%">排序值</th>
                                <th width="15%">创建时间</th>
                                <th width="7%">删除</th>
                                <th width="7%">编辑</th>
                            </thead>
            <div class="tianjia" class="search">
                <a href="add-banner.html" class="btn btn-primary" role="button">添加内容&nbsp;+</a>
            </div>
                            <tbody>
                                <tr style="display: none;">
                                    <td>
                                        <div class="xuanze">
                                            <label>
                 <input type="checkbox" class="check-item"
                                            value="#">
                </label>
                                        </div>
                                    </td>
                                    <td>
                                        <div class="bianhao homeadid">623</div>
                                    </td>
                                    <td>
                                        <div class="bianhao picture">
                                            <img style="width: 200px;" />
                                        </div>
                                    </td>
        </div>
        <div class="bottom">
            <div class="qx">
                <div class="checkbox">
                    <label>
                        <input type="checkbox" class="check-all" value="#">
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;全选</label>
                </div>
            </div>
            <button class="btn btn-warning pl-del" type="button">批量删除</button>
            <div class="page">
                <ul class="pagination">
                    <li class="disabled pre">
                        <a href="#">&laquo;</a>
                    </li>
                    <li class="active">
                        <a href="#">1</a>
                    </li>
                    <li>
                        <a href="#">2</a>
                    </li>
                    <li>
                        <a href="#" class="next">&raquo;</a>
                    </li>
                </ul>
                <div class="form-group">
                    <div class="tzan">
                        <button type="button" class="btn btn-primary">跳转</button>
                    </div>
                    <div class="tz">
                        <input class="form-control" type="text" placeholder="页数">
                    </div>
                </div>
            </div>
                                    <td class="apps">
                                    </td>
                                    <td style="text-align:center;line-height:105px;" class="orderby"></td>
                                    <td style="text-align:center;line-height:105px;" class="createtime"></td>
                                    <td>
                                        <div class="anniu"><img src="image/dustbin.png" class="delete">
                                        </div>
                                    </td>
                                    <td>
                                        <div class="anniu">
                                            <a key="370" href="javascript:void(0)" class="edit"><img src="image/bianji.png"></a>
                                        </div>
                                    </td>
                                </tr>
                            </tbody>
        </div>
        <div class="zhuti">
            <div class="zhutisousuo">
                <table class="table">
                    <thead>
                    <th width="7%">选择</th>
                    <th width="7%">编号</th>
                    <th width="20%">封面</th>
                    <th width="22%">APP名称</th>
                    <th width="10%">顶部标签</th>
                    <th width="10%">排序值</th>
                    <th width="15%">创建时间</th>
                    <th width="7%">删除</th>
                    <th width="7%">编辑</th>
                    </thead>
                        </table>
                    </div>
                </div>
                <div class="bottom">
                    <div class="qx">
                        <div class="checkbox">
                            <label>
         <input type="checkbox" class="check-all" value="#">
          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;全选</label>
                        </div>
                    </div>
                    <button class="btn btn-warning pl-del" type="button">批量删除</button>
                    <div class="page">
                        <ul class="pagination">
                            <li class="disabled pre">
                                <a href="#">&laquo;</a>
                            </li>
                            <li class="active">
                                <a href="#">1</a>
                            </li>
                            <li>
                                <a href="#">2</a>
                            </li>
                            <li>
                                <a href="#" class="next">&raquo;</a>
                            </li>
                        </ul>
                        <div class="form-group">
                            <div class="tzan">
                                <button type="button" class="btn btn-primary">跳转</button>
                            </div>
                            <div class="tz">
                                <input class="form-control" type="text" placeholder="页数">
                            </div>
                        </div>
                    </div>
                    <tbody>
                    <tr style="display: none;">
                        <td>
                            <div class="xuanze">
                                <label>
                                    <input type="checkbox" class="check-item"
                                           value="#">
                                </label>
                            </div>
                        </td>
                        <td>
                            <div class="bianhao homeadid">623</div>
                        </td>
                        <td>
                            <div class="bianhao picture">
                                <img style="width: 200px;"/>
                            </div>
                        </td>
                </div>
            </div>
            <script src="//cdn.bootcss.com/jquery/1.10.1/jquery.min.js"></script>
            <script src="js/bootstrap.min.js"></script>
            <script src="js/page.js"></script>
            <script src="js/nav.js"></script>
            <script src="js/common.js"></script>
            <script src="layer/layer.js"></script>
            <script>
                function getCommonTime(timestamp) {
                    var newDate = new Date();
                    newDate.setTime(timestamp);
                    return newDate.getFullYear() + "-" + (newDate.getMonth() + 1) + "-" + (newDate.getDay() + 1) + " " + newDate.getHours() + ":" + newDate.getMinutes();
                }
                        <td class="apps">
                $(function() {
                    var htmlSrc = "<tr>" + $(".zhuti .table tbody tr").eq(0).html() + "</tr>";
                        </td>
                        <td style="text-align:center;line-height:105px;" class="special"></td>
                        <td style="text-align:center;line-height:105px;" class="orderby"></td>
                        <td style="text-align:center;line-height:105px;" class="createtime"></td>
                        <td>
                            <div class="anniu"><img src="image/dustbin.png" class="delete">
                            </div>
                        </td>
                        <td>
                            <div class="anniu">
                                <a key="370" href="javascript:void(0)" class="edit"><img src="image/bianji.png"></a>
                            </div>
                        </td>
                    </tr>
                    </tbody>
                    function getData(page) {
                        var index = layer.load(1, {
                            shade: false
                        })
                        $.post('/BuWan/admin/new/api/homebanner/gethomeadlistadmin', {
                            "page": page,
                            "detailsystem": $(".search-div .select-detailsystem").val(),
                            "key": $("#kw").val()
                        }, function(data) {
                            layer.close(index);
                            if(data.code != 0)
                                return;
                </table>
            </div>
        </div>
        <div class="bottom">
            <div class="qx">
                <div class="checkbox">
                    <label>
                        <input type="checkbox" class="check-all" value="#">
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;全选</label>
                </div>
            </div>
            <button class="btn btn-warning pl-del" type="button">批量删除</button>
            <div class="page">
                <ul class="pagination">
                    <li class="disabled pre">
                        <a href="#">&laquo;</a>
                    </li>
                    <li class="active">
                        <a href="#">1</a>
                    </li>
                    <li>
                        <a href="#">2</a>
                    </li>
                    <li>
                        <a href="#" class="next">&raquo;</a>
                    </li>
                </ul>
                <div class="form-group">
                    <div class="tzan">
                        <button type="button" class="btn btn-primary">跳转</button>
                    </div>
                    <div class="tz">
                        <input class="form-control" type="text" placeholder="页数">
                    </div>
                </div>
            </div>
                            fillPage(data.data.pageEntity, function(pageIndex) {
                                getData(pageIndex);
                            });
                            //填充数据
        </div>
    </div>
    <script src="//cdn.bootcss.com/jquery/1.10.1/jquery.min.js"></script>
    <script src="js/bootstrap.min.js"></script>
    <script src="js/page.js"></script>
    <script src="js/nav.js"></script>
    <script src="js/common.js"></script>
    <script src="layer/layer.js"></script>
    <script>
        function getCommonTime(timestamp) {
            var newDate = new Date();
            newDate.setTime(timestamp);
            return newDate.getFullYear() + "-" + (newDate.getMonth() + 1) + "-" + (newDate.getDay() + 1) + " " + newDate.getHours() + ":" + newDate.getMinutes();
        }
                            $(".zhuti .table tbody").empty();
                            for(var i = 0; i < data.data.data.length; i++) {
                                var da = data.data.data[i];
                                var appHtml = "";
                                da.detailSystemList.forEach(function(ds) {
                                    console.log(ds.selected);
                                    appHtml += "<div class='appname'><div class='checkbox'><label><input type='checkbox' value='" + ds.detailSystem.id + "'   key='" + da.homeAd.id + "' " + (ds.selected == true ? "checked" : '') + ">";
                                    appHtml += "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" + ds.detailSystem.appName + "</label>";
                                    appHtml += "</div></div>";
                                });
        $(function () {
            var htmlSrc = "<tr>" + $(".zhuti .table tbody tr").eq(0).html() + "</tr>";
                                $(".zhuti .table tbody").append(htmlSrc);
                                var fk = $(".zhuti .table tbody tr").eq(i);
                                fk.find(".check-item").attr("key", da.homeAd.id);
                                fk.find(".homeadid").html(da.homeAd.id);
                                fk.find(".picture img").attr("src",da.homeAd.picture);
                                fk.find(".apps").html(appHtml);
                                fk.find(".orderby").html(da.homeAd.orderby);
                                fk.find(".createtime").html(getCommonTime(da.homeAd.createtime));
                                fk.find(".edit").attr("key", da.homeAd.id);
                                fk.find(".delete").attr("key", da.homeAd.id);
                                fk.css("display", "table-row");
                                fk.find(".apps").find(".appname input[type=checkbox]").bind("change", function() {
                                    var detailsystemid = $(this).val();
                                    var homeadid = $(this).attr("key");
                                    if($(this).is(":checked")) {
                                        $.post('/BuWan/admin/new/api/homebanner/addsuperhomead', {
                                            'id': homeadid,
                                            'detailsystem': detailsystemid
                                        }, function(data) {
                                            layer.msg(data.msg);
                                        }, 'json');
                                    } else {
                                        $.post('/BuWan/admin/new/api/homebanner/deletesuperhomead', {
                                            'id': homeadid,
                                            'detailsystem': detailsystemid
                                        }, function(data) {
                                            layer.msg(data.msg);
                                        }, 'json');
                                    }
                                });
            function getData(page) {
                var index = layer.load(1, {
                    shade: false
                })
                $.post('/BuWan/admin/new/api/homebanner/gethomeadlistadmin', {
                    "page": page,
                    "detailsystem": $(".search-div .select-detailsystem").val(),
                    "key": $("#kw").val(),
                    "special": $(".recommend-labels").val()
                }, function (data) {
                    layer.close(index);
                    if (data.code != 0)
                        return;
                            }
                    fillPage(data.data.pageEntity, function (pageIndex) {
                        getData(pageIndex);
                    });
                    //填充数据
                            $(".table .anniu .delete").bind("click", function() {
                                var id = $(this).attr("key");
                                var $deleteElement = $(this);
                                var index = layer.confirm('是否删除该条目?', {
                                    btn: ['是', '否'] //按钮
                                }, function() {
                                    $.post('/BuWan/admin/new/api/homebanner/deletehomead', {
                                        'ids': id
                                    }, function(data) {
                                        layer.msg(data.msg);
                                        layer.close(index);
                                        if(data.code == 0) {
                                            $deleteElement.parent().parent().parent().remove();
                                        }
                                    }, 'json');
                                }, function() {
                    $(".zhuti .table tbody").empty();
                    for (var i = 0; i < data.data.data.length; i++) {
                        var da = data.data.data[i];
                        var appHtml = "";
                        da.detailSystemList.forEach(function (ds) {
                            console.log(ds.selected);
                            appHtml += "<div class='appname'><div class='checkbox'><label><input type='checkbox' value='" + ds.detailSystem.id + "'   key='" + da.homeAd.id + "' " + (ds.selected == true ? "checked" : '') + ">";
                            appHtml += "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" + ds.detailSystem.appName + "</label>";
                            appHtml += "</div></div>";
                        });
                                });
                        $(".zhuti .table tbody").append(htmlSrc);
                        var fk = $(".zhuti .table tbody tr").eq(i);
                        fk.find(".check-item").attr("key", da.homeAd.id);
                        fk.find(".homeadid").html(da.homeAd.id);
                        fk.find(".picture img").attr("src", da.homeAd.picture);
                        fk.find(".apps").html(appHtml);
                        if (da.special) {
                            fk.find(".special").html(da.special.name);
                        } else {
                            fk.find(".special").html("");
                        }
                        fk.find(".orderby").html(da.homeAd.orderby);
                        fk.find(".createtime").html(getCommonTime(da.homeAd.createtime));
                        fk.find(".edit").attr("key", da.homeAd.id);
                        fk.find(".delete").attr("key", da.homeAd.id);
                        fk.css("display", "table-row");
                        fk.find(".apps").find(".appname input[type=checkbox]").bind("change", function () {
                            var detailsystemid = $(this).val();
                            var homeadid = $(this).attr("key");
                            if ($(this).is(":checked")) {
                                $.post('/BuWan/admin/new/api/homebanner/addsuperhomead', {
                                    'id': homeadid,
                                    'detailsystem': detailsystemid
                                }, function (data) {
                                    layer.msg(data.msg);
                                }, 'json');
                            } else {
                                $.post('/BuWan/admin/new/api/homebanner/deletesuperhomead', {
                                    'id': homeadid,
                                    'detailsystem': detailsystemid
                                }, function (data) {
                                    layer.msg(data.msg);
                                }, 'json');
                            }
                        });
                            });
                    }
                            $(".table .anniu .edit").bind("click", function() {
                                window.location.href = "edit-banner.html?id=" + $(this).attr("key");
                            });
                    $(".table .anniu .delete").bind("click", function () {
                        var id = $(this).attr("key");
                        var $deleteElement = $(this);
                        var index = layer.confirm('是否删除该条目?', {
                            btn: ['是', '否'] //按钮
                        }, function () {
                            $.post('/BuWan/admin/new/api/homebanner/deletehomead', {
                                'ids': id
                            }, function (data) {
                                layer.msg(data.msg);
                                layer.close(index);
                                if (data.code == 0) {
                                    $deleteElement.parent().parent().parent().remove();
                                }
                            }, 'json');
                        }, function () {
                        }, 'json');
                    }
                        });
                    $(".search-div .search-button").click(function() {
                        getData(1);
                    });
                    });
                    setTimeout(function() {
                        getData(1);
                    }, 2000);
                    $(".table .anniu .edit").bind("click", function () {
                        window.location.href = "edit-banner.html?id=" + $(this).attr("key");
                    });
                });
            </script>
                }, 'json');
            }
            <script>
                $(function() {
                    function getCheckedItems() {
                        var ids = "";
                        for(var i = 0; i < $(".check-item").length; i++) {
                            if($(".check-item").eq(i).is(':checked')) {
                                ids += $(".check-item").eq(i).attr("key") + ",";
                            }
                        }
                        if(ids.length > 0)
                            ids = ids.substr(0, ids.length - 1);
                        return ids;
                    }
                    $(".pl-del").click(function() {
                        var ids = getCheckedItems();
                        if(ids.length < 1) {
                            layer.msg("请选择栏目");
                            return;
                        }
            function getLabels() {
                        $.post('/BuWan/admin/new/api/homebanner/deletehomead', {
                            'ids': ids
                        }, function(data) {
                            layer.msg(data.msg);
                            if(data.code == 0) {
                $.post('api/homerecommend/getSpcialList', {
                    "page": 1
                }, function (data) {
                    if (data.code == 0) {
                        var datas = data.data.data;
                        $(".recommend-labels").empty();
                        $(".recommend-labels").append("<option value='0'>全部标签</option>");
                            }
                        }, 'json');
                        for (var i = 0; i < datas.length; i++) {
                            var html = "<option";
                            html += " value=" + datas[i].special.id + " >";
                            html += datas[i].special.name;
                            html += "</option>";
                            $(".recommend-labels").append(html);
                        }
                    });
                    }
                });
            </script>
    </body>
                }, "json");
            }
            $(".search-div .search-button").click(function () {
                getData(1);
            });
            setTimeout(function () {
                getData(1);
            }, 2000);
            getLabels();
        });
    </script>
    <script>
        $(function () {
            function getCheckedItems() {
                var ids = "";
                for (var i = 0; i < $(".check-item").length; i++) {
                    if ($(".check-item").eq(i).is(':checked')) {
                        ids += $(".check-item").eq(i).attr("key") + ",";
                    }
                }
                if (ids.length > 0)
                    ids = ids.substr(0, ids.length - 1);
                return ids;
            }
            $(".pl-del").click(function () {
                var ids = getCheckedItems();
                if (ids.length < 1) {
                    layer.msg("请选择栏目");
                    return;
                }
                $.post('/BuWan/admin/new/api/homebanner/deletehomead', {
                    'ids': ids
                }, function (data) {
                    layer.msg(data.msg);
                    if (data.code == 0) {
                    }
                }, 'json');
            });
        });
    </script>
</body>
</html>
src/main/webapp/admin/new/tuijian-lanmuneirong.html
@@ -1,310 +1,345 @@
<html lang="zh-cn">
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <meta name="referrer" content="never">
        <title>推荐-栏目内容</title>
        <link href="css/bootstrap.min.css" rel="stylesheet">
        <link href="css/maincontent.css" rel="stylesheet">
        <style>
            .search {
                display: inline;
                width: auto;
            }
        </style>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="referrer" content="never">
    <title>推荐-栏目内容</title>
    <link href="css/bootstrap.min.css" rel="stylesheet">
    <link href="css/maincontent.css" rel="stylesheet">
    <style>
        .search {
            display: inline;
            width: auto;
        }
    </style>
    </head>
</head>
    <body>
        <nav class="navbar navbar-default navbar-fixed-top">
<body>
<nav class="navbar navbar-default navbar-fixed-top">
        </nav>
        <div id="mainbody">
            <div id="sidebar">
</nav>
<div id="mainbody">
    <div id="sidebar">
            </div>
            <div id="neirong">
                <div class="erjidh search-div" style="padding: 10px;">
    </div>
    <div id="neirong">
        <div class="erjidh search-div" style="padding: 10px;">
                    <select name="select" class="form-control search select-detailsystem">
            <select name="select" class="form-control search select-detailsystem">
                    </select>
            </select>
                    <div class="form-group search" role="search">
                        <input type="text" class="form-control search" id="kw" style="width: 200px;" placeholder="搜索">
                    </div>
                    <button type="button" class="btn btn-default search-button">搜索</button>
            <select name="select" class="form-control search recommend-labels">
                    <div class="tianjia" class="search">
                        <a href="add-lmneirong.html" class="btn btn-primary" role="button">添加内容&nbsp;+</a>
                    </div>
            </select>
                </div>
                <div class="zhuti">
                    <div class="zhutisousuo">
                        <table class="table">
                            <thead>
                                <th width="7%">选择</th>
                                <th width="7%">编号</th>
                                <th width="15%">栏目名称</th>
                                <th width="17%">APP名称</th>
                                <th width="10">所属分类</th>
                                <th width="15%">排序值</th>
                                <th width="15%">创建时间</th>
                                <th width="7%">删除</th>
                                <th width="7%">编辑</th>
                            </thead>
            <div class="form-group search" role="search">
                <input type="text" class="form-control search" id="kw" style="width: 200px;" placeholder="搜索">
            </div>
            <button type="button" class="btn btn-default search-button">搜索</button>
                            <tbody>
                                <tr style="display: none;">
                                    <td>
                                        <div class="xuanze">
                                            <label>
                 <input type="checkbox" class="check-item"
                                            value="#">
                </label>
                                        </div>
                                    </td>
                                    <td>
                                        <div class="bianhao hometypeid">623</div>
                                    </td>
                                    <td>
                                        <div class="bianhao name">
                                            <a href="#">今日热点</a>
                                        </div>
                                    </td>
            <div class="tianjia" class="search">
                <a href="add-lmneirong.html" class="btn btn-primary" role="button">添加内容&nbsp;+</a>
            </div>
                                    <td class="apps">
                                        <div class="appname">
                                            <div class="checkbox">
                                                <label>
                    <input type="checkbox" value="#">
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;布丸视频</label>
                                            </div>
                                        </div>
                                        <div class="appname">
                                            <div class="checkbox">
                                                <label>
                    <input type="checkbox" value="#">
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;布丸影视大全</label>
                                            </div>
                                        </div>
                                        <div class="appname">
                                            <div class="checkbox">
                                                <label>
                    <input type="checkbox" value="#">
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;布丸_豆豆影视大全</label>
                                            </div>
                                        </div>
                                    </td>
                                    <td style="text-align:center;line-height:105px;" class="classtype"></td>
                                    <td style="text-align:center;line-height:105px;" class="orderby"></td>
                                    <td style="text-align:center;line-height:105px;" class="createtime"></td>
                                    <td>
                                        <div class="anniu"><img src="image/dustbin.png" class="delete">
                                        </div>
                                    </td>
                                    <td>
                                        <div class="anniu">
                                            <a key="370" href="javascript:void(0)" class="edit"><img src="image/bianji.png"></a>
                                        </div>
                                    </td>
                                </tr>
                            </tbody>
        </div>
        <div class="zhuti">
            <div class="zhutisousuo">
                <table class="table">
                    <thead>
                    <th width="7%">选择</th>
                    <th width="7%">编号</th>
                    <th width="15%">栏目名称</th>
                    <th width="17%">APP名称</th>
                    <th width="10">顶部标签</th>
                    <th width="15%">排序值</th>
                    <th width="15%">创建时间</th>
                    <th width="7%">删除</th>
                    <th width="7%">编辑</th>
                    </thead>
                        </table>
                    </div>
                </div>
                <div class="bottom">
                    <div class="qx">
                        <div class="checkbox">
                            <label>
         <input type="checkbox" class="check-all" value="#">
          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;全选</label>
                        </div>
                    </div>
                    <button class="btn btn-warning pl-del" type="button">批量删除</button>
                    <div class="page">
                        <ul class="pagination">
                            <li class="disabled pre">
                                <a href="#">&laquo;</a>
                            </li>
                            <li class="active">
                                <a href="#">1</a>
                            </li>
                            <li>
                                <a href="#">2</a>
                            </li>
                            <li>
                                <a href="#" class="next">&raquo;</a>
                            </li>
                        </ul>
                        <div class="form-group">
                            <div class="tzan">
                                <button type="button" class="btn btn-primary">跳转</button>
                            </div>
                            <div class="tz">
                                <input class="form-control" type="text" placeholder="页数">
                            </div>
                        </div>
                    </div>
                    <tbody>
                    <tr style="display: none;">
                        <td>
                            <div class="xuanze">
                                <label>
                                    <input type="checkbox" class="check-item"
                                           value="#">
                                </label>
                            </div>
                        </td>
                        <td>
                            <div class="bianhao hometypeid">623</div>
                        </td>
                        <td>
                            <div class="bianhao name">
                                <a href="#">今日热点</a>
                            </div>
                        </td>
                </div>
            </div>
            <script src="//cdn.bootcss.com/jquery/1.10.1/jquery.min.js"></script>
            <script src="js/bootstrap.min.js"></script>
            <script src="js/page.js"></script>
            <script src="js/nav.js"></script>
            <script src="js/common.js"></script>
            <script src="layer/layer.js"></script>
            <script>
                function getCommonTime(timestamp) {
                    var newDate = new Date();
                    newDate.setTime(timestamp);
                    return newDate.getFullYear() + "-" + (newDate.getMonth() + 1) + "-" + (newDate.getDate()) + " " + newDate.getHours() + ":" + newDate.getMinutes();
                }
                        <td class="apps">
                            <div class="appname">
                                <div class="checkbox">
                                    <label>
                                        <input type="checkbox" value="#">
                                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;布丸视频</label>
                                </div>
                            </div>
                            <div class="appname">
                                <div class="checkbox">
                                    <label>
                                        <input type="checkbox" value="#">
                                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;布丸影视大全</label>
                                </div>
                            </div>
                            <div class="appname">
                                <div class="checkbox">
                                    <label>
                                        <input type="checkbox" value="#">
                                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;布丸_豆豆影视大全</label>
                                </div>
                            </div>
                        </td>
                        <td style="text-align:center;line-height:105px;" class="classtype"></td>
                        <td style="text-align:center;line-height:105px;" class="orderby"></td>
                        <td style="text-align:center;line-height:105px;" class="createtime"></td>
                        <td>
                            <div class="anniu"><img src="image/dustbin.png" class="delete">
                            </div>
                        </td>
                        <td>
                            <div class="anniu">
                                <a key="370" href="javascript:void(0)" class="edit"><img src="image/bianji.png"></a>
                            </div>
                        </td>
                    </tr>
                    </tbody>
                $(function() {
                    var htmlSrc = "<tr>" + $(".zhuti .table tbody tr").eq(0).html() + "</tr>";
                </table>
            </div>
        </div>
        <div class="bottom">
            <div class="qx">
                <div class="checkbox">
                    <label>
                        <input type="checkbox" class="check-all" value="#">
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;全选</label>
                </div>
            </div>
            <button class="btn btn-warning pl-del" type="button">批量删除</button>
            <div class="page">
                <ul class="pagination">
                    <li class="disabled pre">
                        <a href="#">&laquo;</a>
                    </li>
                    <li class="active">
                        <a href="#">1</a>
                    </li>
                    <li>
                        <a href="#">2</a>
                    </li>
                    <li>
                        <a href="#" class="next">&raquo;</a>
                    </li>
                </ul>
                <div class="form-group">
                    <div class="tzan">
                        <button type="button" class="btn btn-primary">跳转</button>
                    </div>
                    <div class="tz">
                        <input class="form-control" type="text" placeholder="页数">
                    </div>
                </div>
            </div>
                    function getData(page) {
                        var index = layer.load(1, {
                            shade: false
                        })
                        $.post('api/home/gethometypelistadmin', {
                            "page": page,
                            "detailsystem": $(".search-div .select-detailsystem").val(),
                            "key": $("#kw").val()
                        }, function(data) {
                            layer.close(index);
                            if(data.code != 0)
                                return;
        </div>
    </div>
    <script src="//cdn.bootcss.com/jquery/1.10.1/jquery.min.js"></script>
    <script src="js/bootstrap.min.js"></script>
    <script src="js/page.js"></script>
    <script src="js/nav.js"></script>
    <script src="js/common.js"></script>
    <script src="layer/layer.js"></script>
    <script>
        function getCommonTime(timestamp) {
            var newDate = new Date();
            newDate.setTime(timestamp);
            return newDate.getFullYear() + "-" + (newDate.getMonth() + 1) + "-" + (newDate.getDate()) + " " + newDate.getHours() + ":" + newDate.getMinutes();
        }
                            fillPage(data.data.pageEntity, function(pageIndex) {
                                getData(pageIndex);
                            });
                            //填充数据
        $(function () {
                var htmlSrc = "<tr>" + $(".zhuti .table tbody tr").eq(0).html() + "</tr>";
                            $(".zhuti .table tbody").empty();
                            for(var i = 0; i < data.data.data.length; i++) {
                                var da = data.data.data[i];
                                var appHtml = "";
                                da.detailSystemList.forEach(function(ds) {
                                    console.log(ds.selected);
                                    appHtml += "<div class='appname'><div class='checkbox'><label><input type='checkbox' value='" + ds.detailSystem.id + "'   key='" + da.homeType.id + "' " + (ds.selected == true ? "checked" : '') + ">";
                                    appHtml += "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" + ds.detailSystem.appName + "</label>";
                                    appHtml += "</div></div>";
                                });
                function getData(page) {
                    var index = layer.load(1, {
                        shade: false
                    })
                    $.post('api/home/gethometypelistadmin', {
                        "page": page,
                        "detailsystem": $(".search-div .select-detailsystem").val(),
                        "key": $("#kw").val(),
                        "special":$(".recommend-labels").val()
                    }, function (data) {
                        layer.close(index);
                        if (data.code != 0)
                            return;
                                $(".zhuti .table tbody").append(htmlSrc);
                                var fk = $(".zhuti .table tbody tr").eq(i);
                                fk.find(".check-item").attr("key", da.homeType.id);
                                fk.find(".hometypeid").html(da.homeType.id);
                                fk.find(".name").html("<a href='tuijian-lanmuneirong-videos.html?id="+da.homeType.id+"'>"+da.homeType.name+"</a>");
                                fk.find(".apps").html(appHtml);
                                fk.find(".classtype").text(da.homeType.videoType.name);
                                fk.find(".orderby").html(da.homeType.orderby);
                                fk.find(".createtime").html(getCommonTime(da.homeType.createtime));
                                fk.find(".edit").attr("key", da.homeType.id);
                                fk.find(".delete").attr("key", da.homeType.id);
                                fk.css("display", "table-row");
                                fk.find(".apps").find(".appname input[type=checkbox]").bind("change", function() {
                                    var detailsystemid = $(this).val();
                                    var hometypeid = $(this).attr("key");
                                    if($(this).is(":checked")) {
                                        $.post('api/home/addsuperhometype', {
                                            'id': hometypeid,
                                            'detailsystem': detailsystemid
                                        }, function(data) {
                                            layer.msg(data.msg);
                                        }, 'json');
                                    } else {
                                        $.post('api/home/deletesuperhometype', {
                                            'id': hometypeid,
                                            'detailsystem': detailsystemid
                                        }, function(data) {
                                            layer.msg(data.msg);
                                        }, 'json');
                                    }
                                });
                        fillPage(data.data.pageEntity, function (pageIndex) {
                            getData(pageIndex);
                        });
                        //填充数据
                            }
                        $(".zhuti .table tbody").empty();
                        for (var i = 0; i < data.data.data.length; i++) {
                            var da = data.data.data[i];
                            var appHtml = "";
                            da.detailSystemList.forEach(function (ds) {
                                console.log(ds.selected);
                                appHtml += "<div class='appname'><div class='checkbox'><label><input type='checkbox' value='" + ds.detailSystem.id + "'   key='" + da.homeType.id + "' " + (ds.selected == true ? "checked" : '') + ">";
                                appHtml += "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" + ds.detailSystem.appName + "</label>";
                                appHtml += "</div></div>";
                            });
                            $(".table .anniu .delete").bind("click", function() {
                                var id = $(this).attr("key");
                                var $deleteElement = $(this);
                                var index = layer.confirm('是否删除该条目?', {
                                    btn: ['是', '否'] //按钮
                                }, function() {
                                    $.post('api/home/deletehometype', {
                                        'ids': id
                                    }, function(data) {
                                        layer.msg(data.msg);
                                        layer.close(index);
                                        if(data.code == 0) {
                                            $deleteElement.parent().parent().parent().remove();
                                        }
                                    }, 'json');
                                }, function() {
                            $(".zhuti .table tbody").append(htmlSrc);
                            var fk = $(".zhuti .table tbody tr").eq(i);
                            fk.find(".check-item").attr("key", da.homeType.id);
                            fk.find(".hometypeid").html(da.homeType.id);
                            fk.find(".name").html("<a href='tuijian-lanmuneirong-videos.html?id=" + da.homeType.id + "'>" + da.homeType.name + "</a>");
                            fk.find(".apps").html(appHtml);
                            if (da.special) {
                                fk.find(".classtype").text(da.special.name);
                            } else
                                fk.find(".classtype").text("");
                            fk.find(".orderby").html(da.homeType.orderby);
                            fk.find(".createtime").html(getCommonTime(da.homeType.createtime));
                            fk.find(".edit").attr("key", da.homeType.id);
                            fk.find(".delete").attr("key", da.homeType.id);
                            fk.css("display", "table-row");
                            fk.find(".apps").find(".appname input[type=checkbox]").bind("change", function () {
                                var detailsystemid = $(this).val();
                                var hometypeid = $(this).attr("key");
                                if ($(this).is(":checked")) {
                                    $.post('api/home/addsuperhometype', {
                                        'id': hometypeid,
                                        'detailsystem': detailsystemid
                                    }, function (data) {
                                        layer.msg(data.msg);
                                    }, 'json');
                                } else {
                                    $.post('api/home/deletesuperhometype', {
                                        'id': hometypeid,
                                        'detailsystem': detailsystemid
                                    }, function (data) {
                                        layer.msg(data.msg);
                                    }, 'json');
                                }
                            });
                                });
                        }
                            });
                        $(".table .anniu .delete").bind("click", function () {
                            var id = $(this).attr("key");
                            var $deleteElement = $(this);
                            var index = layer.confirm('是否删除该条目?', {
                                btn: ['是', '否'] //按钮
                            }, function () {
                                $.post('api/home/deletehometype', {
                                    'ids': id
                                }, function (data) {
                                    layer.msg(data.msg);
                                    layer.close(index);
                                    if (data.code == 0) {
                                        $deleteElement.parent().parent().parent().remove();
                                    }
                                }, 'json');
                            }, function () {
                            $(".table .anniu .edit").bind("click", function() {
                                window.location.href = "edit-lmneirong.html?id="+$(this).attr("key");
                            });
                            });
                        }, 'json');
                    }
                        });
                    $(".search-div .search-button").click(function() {
                        getData(1);
                    });
                        $(".table .anniu .edit").bind("click", function () {
                            window.location.href = "edit-lmneirong.html?id=" + $(this).attr("key");
                        });
                    setTimeout(function() {
                        getData(1);
                    }, 3000);
                    }, 'json');
                }
                });
            </script>
            <script>
                $(function() {
                    function getCheckedItems() {
                        var ids = "";
                        for(var i = 0; i < $(".check-item").length; i++) {
                            if($(".check-item").eq(i).is(':checked')) {
                                ids += $(".check-item").eq(i).attr("key") + ",";
                            }
                        }
                        if(ids.length > 0)
                            ids = ids.substr(0, ids.length - 1);
                        return ids;
                    }
                function getLabels() {
                    $(".pl-del").click(function() {
                        var ids = getCheckedItems();
                        if(ids.length < 1) {
                            layer.msg("请选择栏目");
                            return;
                        }
                    $.post('api/homerecommend/getSpcialList', {
                        "page": 1
                    }, function (data) {
                        if (data.code == 0) {
                            var datas = data.data.data;
                            $(".recommend-labels").empty();
                            $(".recommend-labels").append("<option value='0'>全部标签</option>");
                        $.post('/BuWan/admin/new/api/home/deletehometype', {
                            'ids': ids
                        }, function(data) {
                            layer.msg(data.msg);
                            if(data.code == 0) {
                            }
                        }, 'json');
                            for (var i = 0; i < datas.length; i++) {
                                var html = "<option";
                                html += " value=" + datas[i].special.id + " >";
                                html += datas[i].special.name;
                                html += "</option>";
                                $(".recommend-labels").append(html);
                            }
                    });
                        }
                });
            </script>
    </body>
                    }, "json");
                }
                $(".search-div .search-button").click(function () {
                    getData(1);
                });
                setTimeout(function () {
                    getData(1);
                }, 3000);
                getLabels();
            }
        );
    </script>
    <script>
        $(function () {
            function getCheckedItems() {
                var ids = "";
                for (var i = 0; i < $(".check-item").length; i++) {
                    if ($(".check-item").eq(i).is(':checked')) {
                        ids += $(".check-item").eq(i).attr("key") + ",";
                    }
                }
                if (ids.length > 0)
                    ids = ids.substr(0, ids.length - 1);
                return ids;
            }
            $(".pl-del").click(function () {
                var ids = getCheckedItems();
                if (ids.length < 1) {
                    layer.msg("请选择栏目");
                    return;
                }
                $.post('/BuWan/admin/new/api/home/deletehometype', {
                    'ids': ids
                }, function (data) {
                    layer.msg(data.msg);
                    if (data.code == 0) {
                    }
                }, 'json');
            });
        });
    </script>
</body>
</html>
src/test/java/com/hxh/spring/test/PPTVTest.java
@@ -175,7 +175,7 @@
            Sheet sheet = rwb.getSheet(sheetNum);
            for (int c = 1; c < sheet.getRows(); c++) {
                String infoId = sheet.getCell(0, c).getContents().trim();
                String name = sheet.getCell(2, c).getContents().trim();
                String name = sheet.getCell(1, c).getContents().trim();
                String del = sheet.getCell(21, c).getContents().trim();
                if (!StringUtil.isNullOrEmpty(infoId) && StringUtil.isNullOrEmpty(del)) {
                    videoList.add(new String[]{infoId, name, del});
@@ -194,31 +194,37 @@
        List<String[]> list1 = getPPTVVideos(new File("C:\\Users\\Administrator\\Desktop\\全量.xls"), 0);
        List<String[]> list2 = getPPTVVideos(new File("C:\\Users\\Administrator\\Desktop\\全量.xls"), 1);
        Map<String, String[]> map = new TreeMap<>();
        Set<String> sets = new HashSet<>();
        for (String[] sts : list1) {
            map.put(sts[0], sts);
            sets.add(sts[1]);
        }
        for (String[] sts : list2) {
            map.put(sts[0], sts);
            sets.add(sts[1]);
        }
        List<PPTVSeries> list = pptvSeriesDao.list(0, 10000);
        Set<String> infoIds = new HashSet<>();
        for (PPTVSeries s : list) {
            infoIds.add(s.getInfoID());
        }
//        List<PPTVSeries> list = pptvSeriesDao.list(0, 10000);
//        Set<String> infoIds = new HashSet<>();
//        for (PPTVSeries s : list) {
//            infoIds.add(s.getInfoID());
//        }
//
//        for (String infoId : infoIds) {
//            map.remove(infoId);
//        }
        for (String infoId : infoIds) {
            map.remove(infoId);
        }
        for (String code : sets)
            getDetail(code);
        try {
            save(map);
        } catch (Exception e) {
            e.printStackTrace();
        }
//        try {
//            save(map);
//        } catch (Exception e) {
//            e.printStackTrace();
//        }
        System.out.println(map);
//        System.out.println(map);
    }
    private void save(Map<String, String[]> data) throws Exception {
@@ -251,11 +257,10 @@
        }
    }
    @Test
    public void getDetail() {
        PPTVSeries series = PPTVApiUtil.getDetail("32385373");
//    @Test
    public void getDetail(String sCode) {
        PPTVSeries series = PPTVApiUtil.getDetail(sCode);
        pptvService.save(series);
        System.out.println(series);
    }