Browse Source

代码修改

Bingbing 4 năm trước cách đây
mục cha
commit
297bc1048f

+ 1 - 1
guns-main/src/main/java/cn/stylefeng/guns/zjxl/cnotroller/ZjxlBannerCnotroller.java

@ -198,7 +198,7 @@ public class ZjxlBannerCnotroller extends BaseController {
        if (bannerSort != null){
            banner.setBannerSort(bannerSort);
        }
        List<ZjxlBanner> bannerList = bannerService.findBannerAll();
        List<ZjxlBanner> bannerList = bannerService.findBannerAllByCondition(bannerId);
        if (bannerList.size() > 0){
            Iterator<ZjxlBanner> bannerIterator = bannerList.iterator();
            while (bannerIterator.hasNext()){

+ 7 - 1
guns-main/src/main/java/cn/stylefeng/guns/zjxl/service/ZjxlBannerService.java

@ -98,7 +98,7 @@ public class ZjxlBannerService extends BaseService {
    public List<ZjxlBanner> findBannerByIsOnLine(Integer page,Integer pagesize){
        String sql = "SELECT * FROM `guns-separation`.zjxl_banner WHERE banner_is_line=1";
        sql += " ORDER BY concat(banner_sort,banner_create_time) DESC  ";
        sql += " ORDER BY banner_sort asc,banner_create_time DESC  ";
        List<ZjxlBanner> bannerList = jdbcTemplate.query(sql,new BeanPropertyRowMapper(ZjxlBanner.class));
        return bannerList;
    }
@ -115,6 +115,12 @@ public class ZjxlBannerService extends BaseService {
        return bannerList;
    }
    public List<ZjxlBanner> findBannerAllByCondition(String bannerId){
        String sql = "SELECT * FROM `guns-separation`.zjxl_banner WHERE banner_is_line=1 and  banner_id <>'"+bannerId+"' ";
        List<ZjxlBanner> bannerList = jdbcTemplate.query(sql,new BeanPropertyRowMapper(ZjxlBanner.class));
        return bannerList;
    }
    public List<ZjxlBanner> findByIsLine(){
        String sql = "SELECT * FROM `guns-separation`.zjxl_banner WHERE  banner_is_line = 1 ORDER BY concat(banner_sort,banner_create_time) DESC";
        List<ZjxlBanner> bannerList = jdbcTemplate.query(sql,new BeanPropertyRowMapper(ZjxlBanner.class));

+ 21 - 3
guns-main/src/main/java/cn/stylefeng/guns/zjxl/service/ZjxlSystemDictService.java

@ -51,6 +51,24 @@ public class ZjxlSystemDictService extends BaseService {
        return articleContentList;
    }
    public int findSystemDictClassifyByCondition(String systemDictClassify,String dictId){
        String sql = "select count(1) from zjxl_system_dict where system_dict_classify = '"+systemDictClassify+"' ";
        if (StringUtils.isNoneBlank(dictId)){
            sql +="and system_dict_id <>'"+dictId+"' ";
        }
        Integer articleContentList = jdbcTemplate.queryForObject(sql, Integer.class);
        return articleContentList;
    }
    public int findSystemDictSubclassifyByCondition(String systemDictSubclassify,String dictId){
        String sql = "select count(1) from zjxl_system_dict where system_dict_subclassify = '"+systemDictSubclassify+"' ";
        if (StringUtils.isNoneBlank(dictId)){
            sql +="and system_dict_id <>'"+dictId+"' ";
        }
        Integer articleContentList = jdbcTemplate.queryForObject(sql, Integer.class);
        return articleContentList;
    }
    public List<ZjxlSystemDict> findSystemDictById(String id,Integer systemDictType,Integer page,Integer pagesize){
        String sql = "select * from zjxl_system_dict where 1=1 ";
@ -90,7 +108,7 @@ public class ZjxlSystemDictService extends BaseService {
        if (systemDictType != null && systemDictType > 0){
            sql += " and system_dict_type = "+systemDictType+"";
        }
        sql += " group by system_dict_classify ";
        sql += " and system_dict_is_line ='1' group by system_dict_classify ";
        List<ZjxlSystemDict> systemDictList = jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(ZjxlSystemDict.class));
        return systemDictList;
    }
@ -102,9 +120,9 @@ public class ZjxlSystemDictService extends BaseService {
            result.put("status",-1);
            return result;
        }
        int systemDictClassifyList = findSystemDictClassify(systemDictClassify);
        int systemDictClassifyList = findSystemDictClassifyByCondition(systemDictClassify,systemDictId);
        //查询子分类是否存在
        int systemDictSubclassifyList = findSystemDictSubclassify(systemDictSubclassify);
        int systemDictSubclassifyList = findSystemDictSubclassifyByCondition(systemDictSubclassify,systemDictId);
        if (systemDictClassifyList>0&&systemDictSubclassifyList>0){
            result.put("status",0);
            return result;