178 Commits 4c01188741 ... 38e1b09b77

Author SHA1 Message Date
  songshuai 38e1b09b77 Merge branch 'master' of http://gogs.efunbox.cn/yaobo/efunbox_audio 5 years ago
  songshuai 00f861928b Commit. 5 years ago
  songshuai 5fa24cd667 Commit. 5 years ago
  songshuai 757a978a8e Merge branch 'master' of http://gogs.efunbox.cn/yaobo/efunbox_audio 5 years ago
  songshuai 22507d4b6b Commit. 5 years ago
  songshuai cc495f830b Commit. 5 years ago
  songshuai 2250bb5fd2 Commit. 5 years ago
  songshuai 705c05cf74 Commit. 5 years ago
  songshuai e8bff9430e Commit. 5 years ago
  songshuai 5f032fbd9c Commit. 5 years ago
  songshuai f6dfaec610 Commit. 5 years ago
  songshuai 4e1353cecd Commit. 5 years ago
  songshuai da1be1fd6d 新增获取分类下的专辑列表接口 5 years ago
  songshuai fa5780e8fc Commit. 5 years ago
  songshuai 2d56a4f545 Commit. 5 years ago
  songshuai 551c12a518 新增获取分类列表接口 5 years ago
  songshuai 3294ac0c96 新增分类、专辑、节目Dao层 5 years ago
  songshuai d431b6f863 新增分类、专辑、节目实体类 5 years ago
  songshuai a4006b18c2 杭研接口使用。 5 years ago
  xushengqiang 1dcfca2586 error code 5 years ago
  xushengqiang 55478915d9 error code 5 years ago
  xushengqiang 5819711150 error code 5 years ago
  songshuai 858ce87945 更换image地址域名。 5 years ago
  xushengqiang 3efaa10d91 error code 5 years ago
  xushengqiang 6f6a93eca9 bug fix 5 years ago
  xushengqiang b0de7cfb45 bug fix 5 years ago
  xushengqiang a893dba915 bug fix 5 years ago
  xushengqiang ac9d78f14d bug fix 5 years ago
  xushengqiang ef8cabf6f8 bug fix 5 years ago
  xushengqiang ed8ca4bf20 bug fix 5 years ago
  xushengqiang e43c593f8e 专辑 课件搜索 5 years ago
  xushengqiang 533a169190 专辑 课件搜索 5 years ago
  xushengqiang a91d9093ba 专辑 课件搜索 5 years ago
  wangys c3c9bf1807 拦截bug 5 years ago
  wangys 2c5f1a7ae3 修改拦截 5 years ago
  wangys bfb69f3dfe 配置 5 years ago
  wangys a7cedf34b7 线上配置 5 years ago
  wangys f03ec46776 解决冲突 5 years ago
  wangys 43c9ca3f67 修改/findAlbum接口 5 years ago
  wangys ccc72bdbab bugfix 5 years ago
  wangys 72b62158d0 根据deviceId获取专辑列表 5 years ago
  wangys 33678640f4 修改资源文件访问域名 5 years ago
  xushengqiang 670651afd8 add keyword 5 years ago
  xushengqiang ba0290c154 bugfix 6 years ago
  xushengqiang f771239365 bugfix 6 years ago
  xushengqiang 87787f05b8 bugfix 6 years ago
  xushengqiang 84ad5782d4 bugfix 6 years ago
  xushengqiang ead50273a9 bugfix 6 years ago
  xushengqiang 1d1a4d2a04 将md5加密改成sha256 6 years ago
  xushengqiang de1d87cd3b 将md5加密改成sha256 6 years ago
  xushengqiang 3a39fce394 获取用户token 添加签名验证 6 years ago
  xushengqiang 71854ec95a 获取用户token 6 years ago
  xushengqiang 04be4cce2c 获取用户token 6 years ago
  xushengqiang 8bd1797e46 bugfix 6 years ago
  xushengqiang fc5fcb19c7 bugfix 6 years ago
  xushengqiang 886d07e6d4 统计相关 6 years ago
  xushengqiang 530fdc0646 权限验证 6 years ago
  xushengqiang 4779fd9b93 bugfix 6 years ago
  xushengqiang 07c489a7a5 bugfix 6 years ago
  xushengqiang cddda468b1 config 6 years ago
  xushengqiang 8852eacbc3 获取单个音频信息 6 years ago
  xushengqiang cb0d1be449 获取音频列表 6 years ago
  xushengqiang 8a2730fc99 获取音频列表 6 years ago
  xushengqiang 63092cb8c5 bugfix 6 years ago
  xushengqiang 1de76cbe86 url update 6 years ago
  xushengqiang bb40c53297 url update 6 years ago
  xushengqiang 605815b1fc 音频检索接口 6 years ago
  xushengqiang 3d49c2f179 album page list 6 years ago
  xushengqiang b58ee2b768 img path 6 years ago
  xushengqiang 1a9520fedd device id修改 6 years ago
  xushengqiang 07b34aaaba album 6 years ago
  xushengqiang d2fee5072b 添加专题 6 years ago
  yaobo 53f9358fc0 自动根据url路径检测并开始oss授权 7 years ago
  yaobo 78cf303c33 搜索视频时,优先返回mp4或标清格式的 7 years ago
  yaobo 17e10e24cc fixbug 7 years ago
  yaobo b41c2f6702 fixbug 7 years ago
  yaobo 08e1583fa2 device/trail的都是都增加时间起始点的判断 7 years ago
  yaobo 320dc803c1 点播记录搜索时增加时间起始点的判断 7 years ago
  yaobo e1796b0810 管理员根据idAudio来搜索音频 7 years ago
  yaobo cb1557d2c4 模糊搜索 7 years ago
  yaobo fd2bf29620 搜索资源平台的page从0开始,0表示第一页 7 years ago
  yaobo bcbeac4519 根据id、no,title来搜索资源平台 7 years ago
  yaobo 79a1d31e56 增加发票类型 7 years ago
  yaobo 8c8c84fb92 增加渠道的属性信息 7 years ago
  yaobo f3e67d4950 fixbug 7 years ago
  yaobo 743f9f7c84 记录管理员的操作日志 7 years ago
  yaobo e816ec2f16 增加对视频格式的支持 7 years ago
  yaobo 2f39346df6 增加退出登录接口 7 years ago
  yaobo 420ac69a44 fixbug 7 years ago
  yaobo a2cba81570 testcode 7 years ago
  yaobo 3d0567300a test code 7 years ago
  yaobo d419394d64 修改域名 7 years ago
  yaobo 4848a7ea1f 修改正式服务器的配置 7 years ago
  yaobo 43d1246999 修改正式服务器链接的redis信息 7 years ago
  yaobo bd42e6b59d 增加多运行环境的配置 7 years ago
  yaobo 6376f845da 分页功能返回总数 7 years ago
  yaobo 82fdcaef07 分页搜索 7 years ago
  yaobo 01d58523ef 搜索接口增加page,size,pageable分页检索功能 7 years ago
  yaobo 471ebeb68e 减少返回信息 7 years ago
  yaobo 3f87ddfe10 修改接口返回方式 7 years ago
  yaobo 769763769b fixbug 7 years ago
  yaobo a01cdfa60a 修改返回结果 7 years ago
  yaobo 173574ce45 与资源平台对接,根据资源id获取url 7 years ago
  yaobo 777be89bfd 新设备注册的同时,向数据资源云平台注册 7 years ago
  yaobo be05dda653 fixbug 7 years ago
  yaobo f807f6b7f6 屏蔽feignclient 7 years ago
  yaobo 51decc0700 删除无用代码 7 years ago
  yaobo e480e6f909 通过RestTemplate调用远程用户接口,测试feignclient调用,但是返回错误 7 years ago
  yaobo ba7a398bb6 修改entity中变量类型为对象,不能是基本数据类型,如int,boolean,否则利用java反射进行对象拷贝时会出错 7 years ago
  yaobo bb15ae4ec9 insert和update返回接口增加code 7 years ago
  yaobo a93bfaeaf8 渠道支撑查询第一级结果 7 years ago
  yaobo d143820fe1 fixbug 7 years ago
  yaobo 2298135dfd 为渠道、资源组增加子节点标记,并在新增、删除时动态修改标记 7 years ago
  yaobo fa16924d27 fixbug 7 years ago
  yaobo f20d63939d 屏蔽账号信息 7 years ago
  yaobo 63ac3f0dcc fixbug 7 years ago
  yaobo 5e8126a399 增加更新、删除接口 7 years ago
  yaobo 99d51d6ff8 将同类型的两个对象的数据进行合并,objTarget中为null的数据用objSource中的元素代替 7 years ago
  yaobo f8d6691d95 fixbug 7 years ago
  yaobo 36069d0824 测试拦截器 7 years ago
  yaobo 810ef5d9c1 开启权限验证 7 years ago
  yaobo 2419536b4e test 7 years ago
  yaobo 700167d333 header 7 years ago
  yaobo 5451a257ef test1 7 years ago
  yaobo 3938d9d258 test9 7 years ago
  yaobo 6a97f1717d test8 7 years ago
  yaobo 3b25670d4b test7 7 years ago
  yaobo 01aa2a1384 test6 7 years ago
  yaobo d634bdfc3f test5 7 years ago
  yaobo ab091f6cd8 test4 7 years ago
  yaobo 4c47a9c7a1 test3 7 years ago
  yaobo aa5c43eca1 test2 7 years ago
  yaobo 052c001e06 test 7 years ago
  yaobo 21421a44cb 测试 7 years ago
  yaobo ca8bbe12ee 更换filter 7 years ago
  yaobo d2c789224e 增加返回值 7 years ago
  yaobo 5835544a39 判断请求类型 7 years ago
  yaobo 7afc212201 允许header 7 years ago
  yaobo a0233a20a8 允许在header中增加id、token 7 years ago
  yaobo 2efbec0b9f OPTIONS 7 years ago
  yaobo 2f290dc385 增加数据库的更新功能,支持账号禁用 7 years ago
  yaobo 5bd4e190ab 增加创建时间 7 years ago
  yaobo 1f78f743d0 增加搜索全部的接口 7 years ago
  yaobo 0cbd6770a4 修改参数名称 7 years ago
  yaobo 76d9ed0a21 修改参数名称 7 years ago
  yaobo 515df62206 新增数据时将id/token放入header,主参数体放入body 7 years ago
  yaobo fc792bbfbf 音频所属资源组 7 years ago
  yaobo 84332081c4 区分用户、管理员接口进行鉴权,增加设备的搜索接口 7 years ago
  yaobo 19d471ccb1 测试新的跨域访问 7 years ago
  yaobo 3a20e58f18 fix 7 years ago
  yaobo 52baffcc2a test 7 years ago
  yaobo 15b5c7a222 屏蔽跨域测试代码 7 years ago
  yaobo e81a95dea1 test 7 years ago
  yaobo 334b1866c4 跨域过滤器 7 years ago
  yaobo 2bc90a70f2 测试机的redis信息 7 years ago
  yaobo 3e2180114e 设置跨域访问 7 years ago
  yaobo d925e743ff 修改包名 7 years ago
  yaobo a18434de00 修改db连接为测试机 7 years ago
  yaobo f44309a1c6 增加rid 7 years ago
  yaobo 47bd6b8719 增加管理员登陆验证的过滤器,接口分设备调用、管理员调用进行分别鉴权 7 years ago
  yaobo c36cb642e1 登陆后将admin的token保存至redis 7 years ago
  yaobo ede081a50d 增加md5加密、管理员的注册、登陆功能 7 years ago
  yaobo 3146f8cf15 屏蔽调试信息 7 years ago
  yaobo 8d97bc73ef 设备请求音频资源时,判断设备所属渠道是否有该音频所属资源组的权限,有则随机返回其中一个音频 7 years ago
  yaobo c5a90c58b1 增加资源组、权限组,及相应的创建、搜素等接口 7 years ago
  yaobo 573fe3a387 通过配置文件来对oss进行授权,并将token、url放入redis,设置过期时间 7 years ago
  yaobo 9023fad1ca 以注解bean的方式调用,增加redis的有效时间 7 years ago
  yaobo bcb56c08f4 支持redis 7 years ago
  yaobo 49096f4d17 完成对阿里云oss资源的动态加密,未加密的不能访问 7 years ago
  yaobo 4da796af4d 生成阿里sts验证token 7 years ago
  yaobo c6e067260f 连接测试服务器的数据库 7 years ago
  yaobo 3f6dc9b90e 搜索音频时增加点播记录 7 years ago
  yaobo 5fdf9f71d8 增加对渠道、合作商户的管理接口 7 years ago
  yaobo 6f7fd04379 简化返回结果的处理 7 years ago
  yaobo 6aaef87543 通过interceptor实现用户登录权限的验证 7 years ago
  yaobo b6a76cfc6b 音频资源、接口、服务的实现 7 years ago
  yaobo 9e29c0fd0e 修改id类型 7 years ago
  yaobo f49ab28aa3 智能语音项目初始化,完成设备的登陆、注册 7 years ago

+ 5 - 0
pom.xml

@@ -142,6 +142,11 @@
 			<version>3.13</version>
 		</dependency>
 		<dependency>
+			<groupId>net.sourceforge.jexcelapi</groupId>
+			<artifactId>jxl</artifactId>
+			<version>2.6.10</version>
+		</dependency>
+		<dependency>
 			<groupId>ws.schild</groupId>
 			<artifactId>jave-core</artifactId>
 			<version>2.4.4</version>

+ 0 - 15
src/main/java/cn/efunbox/audio/entity/res/ResWare.java

@@ -55,21 +55,6 @@ public class ResWare {
     @Transient
     private String contentPicUrl;
 
-    @Column(name = "price")
-    private String price;
-
-    @Column(name = "play_count")
-    private String playCount;
-
-    @Column(name = "sort")
-    private String sort;
-
-    @Column(name = "type_id")
-    private String typeId;
-
-    @Column(name = "publish_time")
-    private String publishTime;
-
     @Column(name = "is_del")
     private String isDel;
 

+ 2 - 2
src/main/java/cn/efunbox/audio/impl/res/ResWareServiceImpl.java

@@ -63,9 +63,9 @@ public class ResWareServiceImpl implements ResWareService {
               SortHelper.sortMap2Sort(
                     new LinkedHashMap<String, BaseOrderEnum>() {{
                         if(StringUtils.isBlank(order) || "asc".equals(order)){
-                            put("sort", BaseOrderEnum.ASC);
+                            put("chapterRanking", BaseOrderEnum.ASC);
                         }else{
-                            put("sort",BaseOrderEnum.DESC);
+                            put("chapterRanking",BaseOrderEnum.DESC);
                         }
                     }}
               )

+ 62 - 0
src/main/java/cn/efunbox/audio/utils/DBhepler.java

@@ -0,0 +1,62 @@
+package cn.efunbox.audio.utils;
+
+import java.sql.*;
+
+public class DBhepler {
+	/*String driver = "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+	String url = "jdbc:sqlserver://127.0.0.1;DatabaseName=Mobile";*/
+	
+	String driver = "com.mysql.jdbc.Driver";
+	String url = "jdbc:mysql://192.168.1.96:3306/efunbox_audio?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&allowMultiQueries=true";
+//	String url = "jdbc:mysql://192.168.1.96:3306/audio_bak?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&allowMultiQueries=true";
+
+	
+	Connection con = null;
+	ResultSet res = null;
+
+	public void DataBase() {
+			try {
+				Class.forName(driver);
+				con = DriverManager.getConnection(url, "root", "Efunbox^^2015$");
+			} catch (ClassNotFoundException e) {
+				e.printStackTrace();
+			} catch (SQLException e) {
+				e.printStackTrace();
+			}
+	}
+
+	public ResultSet  Search(String sql, String str[]) {
+		DataBase();
+		try {
+			PreparedStatement pst =con.prepareStatement(sql);
+			if (str != null) {
+				for (int i = 0; i < str.length; i++) {
+					pst.setString(i + 1, str[i]);
+				}
+			}
+			res = pst.executeQuery();
+
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+		return res;
+	}
+
+	public int AddU(String sql, String str[]) {
+		int a = 0;
+		DataBase();
+		try {
+			PreparedStatement pst = con.prepareStatement(sql);
+			if (str != null) {
+				for (int i = 0; i < str.length; i++) {
+					pst.setString(i + 1, str[i]);
+				}
+			}
+			a = pst.executeUpdate();
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+		return a;
+	}
+
+}

+ 226 - 0
src/main/java/cn/efunbox/audio/utils/DateUtil.java

@@ -0,0 +1,226 @@
+package cn.efunbox.audio.utils;
+
+
+import org.apache.commons.lang3.time.DateFormatUtils;
+import org.apache.commons.lang3.time.DateUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.Locale;
+
+/**
+ * 日期工具类
+ */
+public class DateUtil {
+    private static Logger log = LoggerFactory.getLogger(DateUtil.class);
+
+    private static final String DEFAULT_PATTERN = "yyyy-MM-dd";
+    /**
+     * 一天的毫秒数
+     */
+    public static long TIME_OF_ONE_DAY = 24 * 60 * 60 * 1000;
+    /**
+     * 将日期转换为字符串
+     *
+     * @return
+     */
+    public static String dateFormat() {
+        return dateFormat(new Date(), "yyyy-MM-dd HH:mm:ss");
+    }
+
+    public static String dateFormat(String pattern) {
+        return dateFormat(new Date(), pattern);
+    }
+
+    public static String dateFormat(Date date, String pattern) {
+        SimpleDateFormat sdf = new SimpleDateFormat(pattern);
+        return sdf.format(date);
+    }
+
+    /**
+     * 字符串转换为日期
+     *
+     * @param source
+     * @return
+     * @throws ParseException
+     */
+    public static Date StrToDate(String source) throws ParseException {
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        return sdf.parse(source);
+    }
+
+    public static Date StrToDate(String source, String pattern) throws ParseException {
+        SimpleDateFormat sdf = new SimpleDateFormat(pattern);
+        return sdf.parse(source);
+    }
+
+    /**
+     * 增加年
+     *
+     * @param date
+     * @param i
+     * @return
+     */
+    public static Date addYears(Date date, int i) {
+        return DateUtils.addYears(date, i);
+    }
+
+    /**
+     * 增加月
+     *
+     * @param date
+     * @param i
+     * @return
+     */
+    public static Date addMonths(Date date, int i) {
+        return DateUtils.addMonths(date, i);
+    }
+
+    /**
+     * 增加小时
+     *
+     * @param date
+     * @param amount
+     * @return
+     */
+    public static Date addHours(Date date, int amount) {
+        return DateUtils.addHours(date, amount);
+    }
+
+    /**
+     * 增加天数
+     *
+     * @param date
+     * @param amount
+     * @return
+     */
+    public static Date addDays(Date date, int amount) {
+        return DateUtils.addDays(date, amount);
+    }
+
+    /**
+     * 日期格式换行为GMT格式
+     *
+     * @param date
+     * @return
+     */
+    public static String toGMTString(Date date) {
+        SimpleDateFormat df = new SimpleDateFormat("E, dd MMM yyyy HH:mm:ss z", Locale.UK);
+        df.setTimeZone(new java.util.SimpleTimeZone(0, "GMT"));
+        return df.format(date);
+    }
+
+    /**
+     * 获取传入日期和当前当前日期相隔分钟数
+     *
+     * @param date
+     * @return
+     * @throws ParseException
+     */
+    public static int getDateDiffMinutes(String date){
+        long intervalMilli = 0;
+        try {
+            long now = System.currentTimeMillis();
+            long ago = StrToDate(date, "yyyy-MM-dd HH:mm:ss").getTime();
+
+            intervalMilli = now - ago;
+            if (intervalMilli < 0) {
+                return 0;
+            }
+        }catch (Exception e){
+            e.printStackTrace();
+            return 0;
+        }
+        return (int)(intervalMilli / (60 * 1000));
+    }
+
+    /**
+     * 获取传入日期和当前当前日期相隔天数
+     *
+     * @param date
+     * @return
+     * @throws ParseException
+     */
+    public static int getDateDiffDays(String date) throws ParseException {
+        long now = new Date().getTime();
+        long ago = StrToDate(date, "yyyy-MM-dd").getTime();
+
+        long intervalMilli = now - ago;
+        if (intervalMilli < 0) {
+            return 0;
+        }
+        return (int) (intervalMilli / (24 * 3600 * 1000));
+    }
+
+    /**
+     * 获取传入日期和当前当前日期相隔年数
+     *
+     * @param date
+     * @return
+     * @throws ParseException
+     */
+    public static int getDateDiffYears(Date date) {
+        Calendar cal1 = Calendar.getInstance();
+        cal1.setTime(date);
+
+        Calendar cal2 = Calendar.getInstance();
+        cal2.setTime(new Date());
+
+        return cal2.get(Calendar.YEAR) - cal1.get(Calendar.YEAR);
+    }
+
+    /**
+     * 将DATE类型转成String类型,pattern默认为yyyy-MM-dd
+     *
+     * @return
+     */
+    public static String getDateStr() {
+        Date  date = new Date();
+        SimpleDateFormat formater = new SimpleDateFormat(DEFAULT_PATTERN);
+        return formater.format(date);
+    }
+
+    public static String getPreDateStr() {
+        Date  date = new Date(System.currentTimeMillis() - TIME_OF_ONE_DAY);
+        SimpleDateFormat formater = new SimpleDateFormat(DEFAULT_PATTERN);
+        return formater.format(date);
+    }
+
+    public static String formatPreDayEndTime() {
+        Date  date = new Date(System.currentTimeMillis() - TIME_OF_ONE_DAY);
+        return  DateFormatUtils.format(date, "yyyy-MM-dd 23:59:59");
+    }
+
+
+
+    public static String formatPreDayStartTime() {
+        Date  date = new Date(System.currentTimeMillis() - TIME_OF_ONE_DAY);
+        return  DateFormatUtils.format(date, "yyyy-MM-dd 00:00:00");
+    }
+
+    public static Date getPreDayStartTime() {
+
+        String format = DateFormatUtils.format(new Date(System.currentTimeMillis() - TIME_OF_ONE_DAY), "yyyy-MM-dd 00:00:00");
+        java.text.DateFormat dfNew = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        try {
+            return dfNew.parse(format);
+        } catch (ParseException e) {
+            e.printStackTrace();
+        }
+        return new Date();
+    }
+
+
+    public static void main(String[] args) {
+        Date preDayStartTime = getPreDayStartTime();
+        //System.out.println(preDayStartTime);
+
+        //System.out.println(formatPreDayEndTime());
+        System.out.println(dateFormat());
+    }
+
+}

+ 211 - 0
src/main/java/cn/efunbox/audio/utils/ExcelUtil.java

@@ -0,0 +1,211 @@
+package cn.efunbox.audio.utils;
+
+import cn.efunbox.audio.impl.AudioServiceImpl;
+import jxl.Sheet;
+import jxl.Workbook;
+import org.apache.commons.lang3.StringUtils;
+
+import java.io.File;
+import java.util.Objects;
+
+public class ExcelUtil {
+
+
+    /**
+     * 杭研导数据
+     * @param name
+     */
+    public static void hyImportExcel(String name){
+
+        try {
+            Workbook rwb = Workbook.getWorkbook(new File(name));
+            Sheet rs1 = rwb.getSheet("分类列表");
+
+            if (Objects.nonNull(rs1)) {
+
+                int clos1 = rs1.getColumns();
+                int rows1 = rs1.getRows();
+
+                System.out.println("分类=》 cols:" + clos1 + " rows:" + rows1);
+
+                for (int i = 3; i < rows1; i++) {
+
+                    long id = SnowflakeIdUtil.getSnowflakeIdUtil().nextId();
+
+                    String typeId = rs1.getCell(0, i).getContents();
+                    String typeName = rs1.getCell(1, i).getContents();
+                    String parentId = rs1.getCell(2, i).getContents();
+                    String sort = rs1.getCell(3, i).getContents();
+
+                    if (StringUtils.isNotBlank(typeName)) {
+
+                        /***************************分类****************************/
+                        DBhepler db = new DBhepler();
+                        System.out.println("分类入库"+ typeName);
+                        String sql = "insert into res_category (type_id,type_name,parent_id,sort,type_updatetime,is_del,renewal) value (?,?,?,?,?,?,?)";
+                        String[] str = new String[]{id +"", typeName, parentId,sort, DateUtil.dateFormat(),"0","0"};
+                        db.AddU(sql, str);
+
+                        /***************************专辑****************************/
+                        hyImportExcel_Album(rwb,id,typeId);
+                    }
+
+                }
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    /**
+     * 导入专辑数据
+     * @Param parentId Id
+     * @Pararm parentTypeId  分类Id
+     */
+    public static void hyImportExcel_Album( Workbook rwb,long parentId,String parentTypeId){
+        Sheet rs1 = rwb.getSheet("专辑列表");
+
+        if (Objects.nonNull(rs1)) {
+
+            int clos1 = rs1.getColumns();
+            int rows1 = rs1.getRows();
+
+            System.out.println("专辑=》 cols:" + clos1 + " rows:" + rows1);
+
+            for (int i = 3; i < rows1; i++) {
+
+                String typeId = rs1.getCell(16, i).getContents();
+                if(typeId.equals(parentTypeId)){
+                    long id = SnowflakeIdUtil.getSnowflakeIdUtil().nextId();
+
+                    String content_id = rs1.getCell(0, i).getContents();
+                    String content_name = rs1.getCell(1, i).getContents();
+                    String shortrecommend = rs1.getCell(2, i).getContents();
+                    String longrecommend = rs1.getCell(3, i).getContents();
+                    //String author = rs1.getCell(4, i).getContents();
+                    //String reader_name = rs1.getCell(5, i).getContents();
+                    String content_pic_url = "https://ai-admin-image.ai160.com"+rs1.getCell(6, i).getContents();
+                    String chapter_count = rs1.getCell(7, i).getContents();
+                    String cooperation_pay_mode = rs1.getCell(8, i).getContents();
+                    String pay_mode = rs1.getCell(9, i).getContents();
+                    String price = rs1.getCell(11, i).getContents();
+                    String playcount = rs1.getCell(12, i).getContents();
+                    String media_type = rs1.getCell(13, i).getContents();
+                    String publish_time = rs1.getCell(14, i).getContents();
+                    String sort = rs1.getCell(15, i).getContents();
+
+                    if (StringUtils.isNotBlank(content_name)) {
+
+                        /***************************专辑****************************/
+                        DBhepler db = new DBhepler();
+                        System.out.println("专辑入库"+ content_name);
+                        String sql = "insert into res_album (content_id,content_name,shortrecommend,longrecommend" +
+                                                            ",content_pic_url,chapter_count,cooperation_pay_mode,pay_mode" +
+                                                            ",price,playcount,media_type,sort,type_id,publish_time,is_del,renewal" +
+                                       ") value (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
+                        String[] str = new String[]{id +"", content_name, shortrecommend,longrecommend,content_pic_url,chapter_count,cooperation_pay_mode,pay_mode,price,playcount,media_type,sort,parentId+"",publish_time,"0","0"};
+                        db.AddU(sql, str);
+
+
+                        /***************************节目****************************/
+                        hyImportExcel_Ware(rwb,id,content_id);
+                    }
+
+                }
+            }
+        }
+    }
+
+    /**
+     * 导入节目数据
+     * @param rwb
+     * @param parentId
+     * @param parentContentId
+     */
+    public static void hyImportExcel_Ware( Workbook rwb,long parentId,String parentContentId){
+        Sheet rs1 = rwb.getSheet("专辑节目");
+
+        if (Objects.nonNull(rs1)) {
+
+            int clos1 = rs1.getColumns();
+            int rows1 = rs1.getRows();
+
+            System.out.println("节目=》 cols:" + clos1 + " rows:" + rows1);
+
+            for (int i = 3; i < rows1; i++) {
+
+                String contentId = rs1.getCell(8, i).getContents();
+                if (contentId.equals(parentContentId)) {
+                    long id = SnowflakeIdUtil.getSnowflakeIdUtil().nextId();
+
+                    String chapter_name = rs1.getCell(1, i).getContents();
+                    String sort = rs1.getCell(2, i).getContents();
+                    String down_load_flag = rs1.getCell(3, i).getContents();
+                    String chapter_pic_url = "https://ai-admin-image.ai160.com"+rs1.getCell(4, i).getContents();
+                    //String chapter_recommend = rs1.getCell(5, i).getContents();
+                    String pay_mode = rs1.getCell(6, i).getContents();
+                    String media_type = rs1.getCell(7, i).getContents();
+                    String content_id = rs1.getCell(8, i).getContents();
+                    String chapter_url = rs1.getCell(9, i).getContents();
+                    String chapter_duration = secToTime(AudioServiceImpl.getMicrosecondLength(chapter_url));
+
+                    if (StringUtils.isNotBlank(chapter_name)) {
+
+                        /***************************节目****************************/
+                        DBhepler db = new DBhepler();
+                        System.out.println("节目入库" + chapter_name);
+                        String sql = "insert into res_ware (chapter_id,chapter_name,chapter_ranking,chapter_duration,down_load_flag,chapter_pic_url" +
+                                                   ",chapter_url,pay_mode,media_type,content_id," +
+                                                    "is_del,renewal" +
+                                      ") value (?,?,?,?,?,?,?,?,?,?,?,?)";
+                        String[] str = new String[]{id + "", chapter_name, sort, chapter_duration, down_load_flag, chapter_pic_url, chapter_url, pay_mode, media_type, parentId+"", "0", "0"};
+                        db.AddU(sql, str);
+                    }
+
+                }
+            }
+        }
+    }
+
+
+    public static void main(String[] args) {
+        String pathName = "C:\\Users\\Administrator\\Desktop\\移动1.xls";
+        //hyImportExcel(pathName);
+        System.out.println(AudioServiceImpl.getMicrosecondLength("https://ai-admin-audio.ai160.com/audio/050/05007001/05007001004.mp3"));
+        System.out.println(secToTime(225));
+    }
+
+    public static String secToTime(long time) {
+        String timeStr = null;
+        long hour = 0;
+        long minute = 0;
+        long second = 0;
+        if (time <= 0)
+            return "00:00:00";
+        else {
+            minute = time / 60;
+            if (minute < 60) {
+                second = time % 60;
+                timeStr = "00:"+unitFormat(minute) + ":" + unitFormat(second);
+            } else {
+                hour = minute / 60;
+                if (hour > 99)
+                    return "99:59:59";
+                minute = minute % 60;
+                second = time - hour * 3600 - minute * 60;
+                timeStr = unitFormat(hour) + ":" + unitFormat(minute) + ":" + unitFormat(second);
+            }
+        }
+        return timeStr;
+    }
+
+    public static String unitFormat(long i) {
+        String retStr = null;
+        if (i >= 0 && i < 10)
+            retStr = "0" + Long.toString(i);
+        else
+            retStr = "" + i;
+        return retStr;
+    }
+
+}