|
|
@@ -22,6 +22,7 @@ import top.lvzhiqiang.util.StringUtils;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
import java.io.*;
|
|
|
+import java.lang.reflect.Field;
|
|
|
import java.nio.charset.StandardCharsets;
|
|
|
import java.time.Instant;
|
|
|
import java.time.LocalDate;
|
|
|
@@ -56,6 +57,174 @@ public class BgServiceImpl implements BgService {
|
|
|
private VideoInfoPoolMapper videoInfoPoolMapper;
|
|
|
@Resource
|
|
|
private VideoSitePoolMapper videoSitePoolMapper;
|
|
|
+ @Resource
|
|
|
+ private DicCodeMapper dicCodeMapper;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * findDicCode
|
|
|
+ *
|
|
|
+ * @author lvzhiqiang
|
|
|
+ * 2022/5/3 17:37
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public String findDicCode(String codeDesc, String order) throws IllegalAccessException {
|
|
|
+ List<DicCode> dicCodeList = dicCodeMapper.findByCodeDesc(codeDesc, order);
|
|
|
+
|
|
|
+ StringBuffer sb = new StringBuffer("total:".concat(String.valueOf(dicCodeList.size())).concat("<br/>"));
|
|
|
+ for (DicCode dicCode : dicCodeList) {
|
|
|
+ sb.append("<table border=\"1\" cellspacing=\"0\"><tr><th>key</th><th>value</th></tr>");
|
|
|
+
|
|
|
+ Field[] fields = dicCode.getClass().getDeclaredFields();
|
|
|
+ for (Field field : fields) {
|
|
|
+ field.setAccessible(true);
|
|
|
+ sb.append("<tr>");
|
|
|
+ sb.append("<td>").append(field.getName()).append("</td>");
|
|
|
+ sb.append("<td>").append(field.get(dicCode)).append("</td>");
|
|
|
+ sb.append("</tr>");
|
|
|
+ }
|
|
|
+ sb.append("</table>");
|
|
|
+ }
|
|
|
+
|
|
|
+ return sb.toString();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * findIcodePool
|
|
|
+ *
|
|
|
+ * @author lvzhiqiang
|
|
|
+ * 2022/5/3 17:37
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public String findIcodePool(String identificationCode, Integer status, String order) throws IllegalAccessException {
|
|
|
+ List<IcodePool> icodePoolList = icodePoolMapper.findByCodeAndStatus(identificationCode, status, order);
|
|
|
+
|
|
|
+ StringBuffer sb = new StringBuffer("total:".concat(String.valueOf(icodePoolList.size())).concat("<br/>"));
|
|
|
+ for (IcodePool icodePool : icodePoolList) {
|
|
|
+ sb.append("<table border=\"1\" cellspacing=\"0\"><tr><th>key</th><th>value</th></tr>");
|
|
|
+
|
|
|
+ Field[] fields = icodePool.getClass().getDeclaredFields();
|
|
|
+ for (Field field : fields) {
|
|
|
+ field.setAccessible(true);
|
|
|
+ sb.append("<tr>");
|
|
|
+ sb.append("<td>").append(field.getName()).append("</td>");
|
|
|
+ sb.append("<td>").append(field.get(icodePool)).append("</td>");
|
|
|
+ sb.append("</tr>");
|
|
|
+ }
|
|
|
+ sb.append("</table>");
|
|
|
+ }
|
|
|
+
|
|
|
+ return sb.toString();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * findVideoSitePool
|
|
|
+ *
|
|
|
+ * @author lvzhiqiang
|
|
|
+ * 2022/5/3 17:37
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public String findVideoSitePool(String url, String order) throws IllegalAccessException {
|
|
|
+ List<VideoSitePool> videoSitePoolList = videoSitePoolMapper.findByUrl(url, order);
|
|
|
+
|
|
|
+ StringBuffer sb = new StringBuffer("total:".concat(String.valueOf(videoSitePoolList.size())).concat("<br/>"));
|
|
|
+ for (VideoSitePool videoSitePool : videoSitePoolList) {
|
|
|
+ sb.append("<table border=\"1\" cellspacing=\"0\"><tr><th>key</th><th>value</th></tr>");
|
|
|
+
|
|
|
+ Field[] fields = videoSitePool.getClass().getDeclaredFields();
|
|
|
+ for (Field field : fields) {
|
|
|
+ field.setAccessible(true);
|
|
|
+ sb.append("<tr>");
|
|
|
+ sb.append("<td>").append(field.getName()).append("</td>");
|
|
|
+ sb.append("<td>").append(field.get(videoSitePool)).append("</td>");
|
|
|
+ sb.append("</tr>");
|
|
|
+ }
|
|
|
+ sb.append("</table>");
|
|
|
+ }
|
|
|
+
|
|
|
+ return sb.toString();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * findVideoInfoPool
|
|
|
+ *
|
|
|
+ * @author lvzhiqiang
|
|
|
+ * 2022/5/3 17:37
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public String findVideoInfoPool(String identificationCode, Integer type, String order, String crudT) throws IllegalAccessException {
|
|
|
+ if ("2".equals(crudT)) {
|
|
|
+ //更新
|
|
|
+ if (StringUtils.isEmpty(identificationCode) || null == type) {
|
|
|
+ return "identificationCode和type不能为空";
|
|
|
+ }
|
|
|
+ videoInfoPoolMapper.updateTypeByCode(identificationCode, type);
|
|
|
+ return "success";
|
|
|
+ }
|
|
|
+ if ("3".equals(crudT)) {
|
|
|
+ //删除
|
|
|
+ if (StringUtils.isEmpty(identificationCode)) {
|
|
|
+ return "dentificationCode不能为空";
|
|
|
+ }
|
|
|
+ videoInfoPoolMapper.delByCode(identificationCode);
|
|
|
+ return "success";
|
|
|
+ }
|
|
|
+
|
|
|
+ List<VideoInfoPool> videoInfoPoolList = videoInfoPoolMapper.findByCodeAndType(identificationCode, type, order);
|
|
|
+
|
|
|
+ StringBuffer sb = new StringBuffer("total:".concat(String.valueOf(videoInfoPoolList.size())).concat("<br/>"));
|
|
|
+ for (VideoInfoPool videoInfoPool : videoInfoPoolList) {
|
|
|
+ sb.append("<table border=\"1\" cellspacing=\"0\"><tr><th>key</th><th>value</th></tr>");
|
|
|
+
|
|
|
+ Field[] fields = videoInfoPool.getClass().getDeclaredFields();
|
|
|
+ for (Field field : fields) {
|
|
|
+ field.setAccessible(true);
|
|
|
+ sb.append("<tr>");
|
|
|
+ sb.append("<td>").append(field.getName()).append("</td>");
|
|
|
+ sb.append("<td>").append(field.get(videoInfoPool)).append("</td>");
|
|
|
+ sb.append("</tr>");
|
|
|
+ }
|
|
|
+ sb.append("</table>");
|
|
|
+ }
|
|
|
+
|
|
|
+ return sb.toString();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * findVideoInfo
|
|
|
+ *
|
|
|
+ * @author lvzhiqiang
|
|
|
+ * 2022/5/3 17:37
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public String findVideoInfo(String identificationCode, Integer type, String order, String crudT) throws IllegalAccessException {
|
|
|
+ if ("3".equals(crudT)) {
|
|
|
+ //删除
|
|
|
+ if (StringUtils.isEmpty(identificationCode)) {
|
|
|
+ return "dentificationCode不能为空";
|
|
|
+ }
|
|
|
+ videoInfoMapper.delByCode(identificationCode);
|
|
|
+ return "success";
|
|
|
+ }
|
|
|
+
|
|
|
+ List<VideoInfo> videoInfoList = videoInfoMapper.findByCodeAndType(identificationCode, type, order);
|
|
|
+
|
|
|
+ StringBuffer sb = new StringBuffer("total:".concat(String.valueOf(videoInfoList.size())).concat("<br/>"));
|
|
|
+ for (VideoInfo videoInfo : videoInfoList) {
|
|
|
+ sb.append("<table border=\"1\" cellspacing=\"0\"><tr><th>key</th><th>value</th></tr>");
|
|
|
+
|
|
|
+ Field[] fields = videoInfo.getClass().getDeclaredFields();
|
|
|
+ for (Field field : fields) {
|
|
|
+ field.setAccessible(true);
|
|
|
+ sb.append("<tr>");
|
|
|
+ sb.append("<td>").append(field.getName()).append("</td>");
|
|
|
+ sb.append("<td>").append(field.get(videoInfo)).append("</td>");
|
|
|
+ sb.append("</tr>");
|
|
|
+ }
|
|
|
+ sb.append("</table>");
|
|
|
+ }
|
|
|
+
|
|
|
+ return sb.toString();
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
|
* 初始化骑兵数据
|
|
|
@@ -335,7 +504,7 @@ public class BgServiceImpl implements BgService {
|
|
|
if (imgUrlBytes.length > 251) {
|
|
|
byte[] imgUrlDestBytes = new byte[251];
|
|
|
System.arraycopy(imgUrlBytes, 0, imgUrlDestBytes, 0, 251);
|
|
|
- fileName = new String(imgUrlDestBytes, StandardCharsets.UTF_8).replace("�","");
|
|
|
+ fileName = new String(imgUrlDestBytes, StandardCharsets.UTF_8).replace("�", "");
|
|
|
}
|
|
|
fileName = fileName.concat(".jpg");
|
|
|
|