소스 검색

友情链接与热门城市开发

anderx 4 년 전
부모
커밋
28edac8ed9

+ 46 - 2
src/main/java/com/kede/common/controller/PublicApiController.java

@@ -9,7 +9,12 @@ import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
+import com.kede.common.constant.AFTConstants;
+import com.kede.common.utils.DateUtils;
+import com.kede.common.utils.excel.FileUtils;
 import com.kede.linksAndHot.service.LinkesService;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.http.MediaType;
 import org.springframework.web.bind.annotation.CrossOrigin;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
@@ -38,6 +43,8 @@ import com.kede.visitingCustomers.service.VisitingCustomersService;
 import com.kede.wechat.service.WeChatShareService;
 import com.kede.wxsdk.service.WxService;
 
+import java.util.Date;
+
 
 @RestController
 @RequestMapping(value = "/open")
@@ -65,6 +72,9 @@ public class PublicApiController extends BaseController {
 	private WxService	wxService;
 	@Resource
 	private WeChatShareService 	weChatShareService;
+
+	@Value(value = "${upload.path}")
+	public  String uploadPath = "";
 	
 	/**
 	 * 微信支付,通知--- 成功结果
@@ -221,6 +231,40 @@ public class PublicApiController extends BaseController {
 		Result res=new Result();
 		return res.data(linkesService.getAllLinks());
 	}
-	
-	
+
+	/**
+	 * 	通用下载请求
+	 *
+	 * @param fileName 文件名称
+	 * @param delete 是否删除
+	 */
+	@RequestMapping("/download")
+	public void fileDownload(String fileName, Boolean delete,String attName,
+							 HttpServletResponse response, HttpServletRequest request)
+	{
+		try
+		{
+			if (!FileUtils.checkAllowDownload(fileName))
+			{
+				throw new Exception("文件名称非法,不允许下载。 ");
+			}
+			String realFileName = DateUtils.formatDate(new Date(),AFTConstants.YYYYMMDDHHMMSS)+fileName.substring(fileName.indexOf("_") + 1);
+			String filePath = uploadPath +"/"+ fileName;
+
+			response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE);
+			FileUtils.setAttachmentResponseHeader(response, realFileName,attName);
+			FileUtils.writeBytes(filePath, response.getOutputStream());
+			if(delete==null)delete=true;
+			if (delete)
+			{
+				FileUtils.deleteFile(filePath);
+			}
+		}
+		catch (Exception e)
+		{
+			LoggerUtils.error(PublicApiController.class,"下载文件失败", e);
+		}
+	}
+
+
 }

+ 7 - 1
src/main/java/com/kede/common/controller/WebpageController.java

@@ -45,12 +45,18 @@ public class WebpageController extends BaseController {
 		modelview.setViewName("/admin/login");
 		return modelview;
 	}
-	
+
 	@RequestMapping(value = "/admin/index", method = RequestMethod.GET)
 	public ModelAndView adminHome(HttpServletRequest request, ModelAndView modelview) {
 		modelview.setViewName("/admin/index");
 		return modelview;
 	}
+
+	@RequestMapping(value = "/portal/link", method = RequestMethod.GET)
+	public ModelAndView portalLink(HttpServletRequest request, ModelAndView modelview) {
+		modelview.setViewName("/portal/link");
+		return modelview;
+	}
 	
 	/**
 	 * 关于科德

+ 6 - 1
src/main/java/com/kede/common/mapper/VisitingCustomersMapper.xml

@@ -309,6 +309,9 @@
 	<if test="startTime != null and endTime  != null">
 	and create_time between #{startTime} and #{endTime}
 	</if>
+  <if test="status !=null">
+    and status = #{status}
+  </if>
 	order by status,create_time 
 	<if test="page_sql!=null">
 			${page_sql}
@@ -324,6 +327,8 @@
 	<if test="startTime != null and endTime  != null">
 	and create_time between #{startTime} and #{endTime}
 	</if>
-	
+      <if test="status !=null">
+        and status = #{status}
+      </if>
   </select>
 </mapper>

+ 27 - 0
src/main/java/com/kede/common/utils/StringUtils.java

@@ -22,4 +22,31 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils {
 		return sInput;
 		
 	}
+
+	public static boolean isNull(Object value) {
+		return value == null;
+	}
+
+	/**
+	 * * 判断一个对象是否非空
+	 *
+	 * @param object Object
+	 * @return true:非空 false:空
+	 */
+	public static boolean isNotNull(Object object) {
+		return !isNull(object);
+	}
+
+
+
+	/**
+	 * * 判断一个对象数组是否为空
+	 *
+	 * @param objects 要判断的对象数组
+	 ** @return true:为空 false:非空
+	 */
+	public static boolean isEmpty(Object[] objects) {
+		return isNull(objects) || (objects.length == 0);
+	}
+
 }

+ 178 - 0
src/main/java/com/kede/common/utils/excel/Excel.java

@@ -0,0 +1,178 @@
+package com.kede.common.utils.excel;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+import java.math.BigDecimal;
+
+
+/**
+ * 自定义导出Excel数据注解
+ * 
+ * @author ruoyi
+ */
+@Retention(RetentionPolicy.RUNTIME)
+@Target(ElementType.FIELD)
+public @interface Excel
+{
+    /**
+     * 导出时在excel中排序
+     */
+    public int sort() default Integer.MAX_VALUE;
+
+    /**
+     * 导出到Excel中的名字.
+     */
+    public String name() default "";
+
+    /**
+     * 日期格式, 如: yyyy-MM-dd
+     */
+    public String dateFormat() default "";
+
+    /**
+     * 如果是字典类型,请设置字典的type值 (如: sys_user_sex)
+     */
+    public String dictType() default "";
+    
+    /**
+     * 	枚举名称
+     */
+    public String enumsName() default "";
+
+    /**
+     *	 读取内容转表达式 (如: 0=男,1=女,2=未知)
+     *	
+     */
+    public String readConverterExp() default "";
+
+    /**
+     * 分隔符,读取字符串组内容
+     */
+    public String separator() default ",";
+
+    /**
+     * BigDecimal 精度 默认:-1(默认不开启BigDecimal格式化)
+     */
+    public int scale() default -1;
+
+    /**
+     * BigDecimal 舍入规则 默认:BigDecimal.ROUND_HALF_EVEN
+     */
+    @SuppressWarnings("deprecation")
+	public int roundingMode() default BigDecimal.ROUND_HALF_EVEN;
+
+    /**
+     * 导出类型(0数字 1字符串)
+     */
+    public ColumnType cellType() default ColumnType.STRING;
+
+    /**
+     * 导出时在excel中每个列的高度 单位为字符
+     */
+    public double height() default 14;
+
+    /**
+     * 导出时在excel中每个列的宽 单位为字符
+     */
+    public double width() default 16;
+
+    /**
+     * 文字后缀,如% 90 变成90%
+     */
+    public String suffix() default "";
+
+    /**
+     * 当值为空时,字段的默认值
+     */
+    public String defaultValue() default "";
+
+    /**
+     * 提示信息
+     */
+    public String prompt() default "";
+
+    /**
+     * 设置只能选择不能输入的列内容.
+     */
+    public String[] combo() default {};
+
+    /**
+     * 是否导出数据,应对需求:有时我们需要导出一份模板,这是标题需要但内容需要用户手工填写.
+     */
+    public boolean isExport() default true;
+
+    /**
+     * 另一个类中的属性名称,支持多级获取,以小数点隔开
+     */
+    public String targetAttr() default "";
+
+    /**
+     * 是否自动统计数据,在最后追加一行统计数据总和
+     */
+    public boolean isStatistics() default false;
+
+    /**
+     * 导出字段对齐方式(0:默认;1:靠左;2:居中;3:靠右)
+     */
+    Align align() default Align.AUTO;
+
+    public enum Align
+    {
+        AUTO(0), LEFT(1), CENTER(2), RIGHT(3);
+        private final int value;
+
+        Align(int value)
+        {
+            this.value = value;
+        }
+
+        public int value()
+        {
+            return this.value;
+        }
+    }
+
+    /**
+     * 字段类型(0:导出导入;1:仅导出;2:仅导入)
+     */
+    Type type() default Type.ALL;
+
+    public enum Type
+    {
+        ALL(0), EXPORT(1), IMPORT(2);
+        private final int value;
+
+        Type(int value)
+        {
+            this.value = value;
+        }
+
+        public int value()
+        {
+            return this.value;
+        }
+    }
+
+    /**
+     * 0数字,1字符串,2图片,3枚举获取
+     * @author Administrator
+     *
+     */
+    public enum ColumnType
+    {
+        NUMERIC(0), STRING(1), IMAGE(2),ENUMS(3);
+        private final int value;
+
+        ColumnType(int value)
+        {
+            this.value = value;
+        }
+
+        public int value()
+        {
+            return this.value;
+        }
+    }
+}

+ 9 - 0
src/main/java/com/kede/common/utils/excel/ExcelConstant.java

@@ -0,0 +1,9 @@
+package com.kede.common.utils.excel;
+
+
+public class ExcelConstant {
+	
+
+
+
+}

+ 18 - 0
src/main/java/com/kede/common/utils/excel/Excels.java

@@ -0,0 +1,18 @@
+package com.kede.common.utils.excel;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Excel注解集
+ * 
+ * @author ruoyi
+ */
+@Target(ElementType.FIELD)
+@Retention(RetentionPolicy.RUNTIME)
+public @interface Excels
+{
+    Excel[] value();
+}

+ 232 - 0
src/main/java/com/kede/common/utils/excel/FileUtils.java

@@ -0,0 +1,232 @@
+package com.kede.common.utils.excel;
+
+import com.kede.common.utils.StringUtils;
+import org.apache.commons.lang3.ArrayUtils;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.*;
+import java.net.URLEncoder;
+import java.nio.charset.StandardCharsets;
+
+/**
+ * 文件处理工具类
+ * 
+ * @author ruoyi
+ */
+public class FileUtils extends org.apache.commons.io.FileUtils
+{
+    public static String FILENAME_PATTERN = "[a-zA-Z0-9_\\-\\|\\.\\u4e00-\\u9fa5]+";
+    
+    public static final String[] DEFAULT_ALLOWED_EXTENSION = {
+            // 图片
+            "bmp", "gif", "jpg", "jpeg", "png",
+            // word excel powerpoint
+            "doc", "docx", "xls", "xlsx", "ppt", "pptx", "html", "htm", "txt",
+            // 压缩文件
+            "rar", "zip", "gz", "bz2",
+            // pdf
+            "pdf" };
+
+    /**
+     * 输出指定文件的byte数组
+     * 
+     * @param filePath 文件路径
+     * @param os 输出流
+     * @return
+     */
+    public static void writeBytes(String filePath, OutputStream os) throws IOException
+    {
+        FileInputStream fis = null;
+        try
+        {
+            File file = new File(filePath);
+            if (!file.exists())
+            {
+                throw new FileNotFoundException(filePath);
+            }
+            fis = new FileInputStream(file);
+            byte[] b = new byte[1024];
+            int length;
+            while ((length = fis.read(b)) > 0)
+            {
+                os.write(b, 0, length);
+            }
+        }
+        catch (IOException e)
+        {
+            throw e;
+        }
+        finally
+        {
+            if (os != null)
+            {
+                try
+                {
+                    os.close();
+                }
+                catch (IOException e1)
+                {
+                    e1.printStackTrace();
+                }
+            }
+            if (fis != null)
+            {
+                try
+                {
+                    fis.close();
+                }
+                catch (IOException e1)
+                {
+                    e1.printStackTrace();
+                }
+            }
+        }
+    }
+
+    /**
+     * 删除文件
+     * 
+     * @param filePath 文件
+     * @return
+     */
+    public static boolean deleteFile(String filePath)
+    {
+        boolean flag = false;
+        File file = new File(filePath);
+        // 路径为文件且不为空则进行删除
+        if (file.isFile() && file.exists())
+        {
+            file.delete();
+            flag = true;
+        }
+        return flag;
+    }
+
+    /**
+     * 文件名称验证
+     * 
+     * @param filename 文件名称
+     * @return true 正常 false 非法
+     */
+    public static boolean isValidFilename(String filename)
+    {
+        return filename.matches(FILENAME_PATTERN);
+    }
+
+    /**
+     * 检查文件是否可下载
+     * 
+     * @param resource 需要下载的文件
+     * @return true 正常 false 非法
+     */
+    public static boolean checkAllowDownload(String resource)
+    {
+        // 禁止目录上跳级别
+        if (StringUtils.contains(resource, ".."))
+        {
+            return false;
+        }
+
+        // 检查允许下载的文件规则
+        if (ArrayUtils.contains(DEFAULT_ALLOWED_EXTENSION, getFileType(resource)))
+        {
+            return true;
+        }
+
+        // 不在允许下载的文件规则
+        return false;
+    }
+
+    /**
+     * 下载文件名重新编码
+     * 
+     * @param request 请求对象
+     * @param fileName 文件名
+     * @return 编码后的文件名
+     */
+    public static String setFileDownloadHeader(HttpServletRequest request, String fileName) throws UnsupportedEncodingException
+    {
+        final String agent = request.getHeader("USER-AGENT");
+        String filename = fileName;
+        if (agent.contains("MSIE"))
+        {
+            // IE浏览器
+            filename = URLEncoder.encode(filename, "utf-8");
+            filename = filename.replace("+", " ");
+        }
+        else if (agent.contains("Firefox"))
+        {
+            // 火狐浏览器
+            filename = new String(fileName.getBytes(), "ISO8859-1");
+        }
+        else if (agent.contains("Chrome"))
+        {
+            // google浏览器
+            filename = URLEncoder.encode(filename, "utf-8");
+        }
+        else
+        {
+            // 其它浏览器
+            filename = URLEncoder.encode(filename, "utf-8");
+        }
+        return filename;
+    }
+
+    /**
+     * 下载文件名重新编码
+     *
+     * @param response 响应对象
+     * @param realFileName 真实文件名
+     * @return
+     */
+    public static void setAttachmentResponseHeader(HttpServletResponse response, String realFileName,String attName) throws UnsupportedEncodingException
+    {
+        String percentEncodedFileName=null;
+        if (attName!=null){
+            percentEncodedFileName=percentEncode(attName);
+        } else{
+            percentEncodedFileName=percentEncode(realFileName);
+        }
+        StringBuilder contentDispositionValue = new StringBuilder();
+        contentDispositionValue.append("attachment; filename=")
+            .append(percentEncodedFileName)
+                .append(";")
+                .append("filename*=")
+                .append("utf-8''")
+                .append(percentEncodedFileName);
+
+        response.setHeader("Content-disposition", contentDispositionValue.toString());
+    }
+
+    /**
+     * 百分号编码工具方法
+     *
+     * @param s 需要百分号编码的字符串
+     * @return 百分号编码后的字符串
+     */
+    public static String percentEncode(String s) throws UnsupportedEncodingException
+    {
+        String encode = URLEncoder.encode(s, StandardCharsets.UTF_8.toString());
+        return encode.replaceAll("\\+", "%20");
+    }
+    
+    /**
+     * 获取文件类型
+     * <p>
+     * 例如: ruoyi.txt, 返回: txt
+     *
+     * @param fileName 文件名
+     * @return 后缀(不含".")
+     */
+    public static String getFileType(String fileName)
+    {
+        int separatorIndex = fileName.lastIndexOf(".");
+        if (separatorIndex < 0)
+        {
+            return "";
+        }
+        return fileName.substring(separatorIndex + 1).toLowerCase();
+    }
+
+}

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 1063 - 0
src/main/java/com/kede/common/utils/excel/NewExcelUtil.java


+ 13 - 0
src/main/java/com/kede/linksAndHot/bo/outPopularCitiesList.java

@@ -64,4 +64,17 @@ public class outPopularCitiesList {
     public void setCreateTimes(String createTimes) {
         this.createTimes = createTimes;
     }
+
+    @Override
+    public String toString() {
+        return "outPopularCitiesList{" +
+                "id=" + id +
+                ", sort=" + sort +
+                ", status=" + status +
+                ", name='" + name + '\'' +
+                ", url='" + url + '\'' +
+                ", remarks='" + remarks + '\'' +
+                ", createTimes='" + createTimes + '\'' +
+                '}';
+    }
 }

+ 4 - 2
src/main/java/com/kede/linksAndHot/service/impl/PopularCitiesServiceImpl.java

@@ -17,6 +17,7 @@ import org.springframework.cache.annotation.Cacheable;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
+import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -60,10 +61,11 @@ public class PopularCitiesServiceImpl extends BaseMybatisDao<PopularCitiesMapper
         LoggerUtils.debug(logger, "热门城市缓存");
         Map<String,Object> param=new HashMap<>();
         param.put("status",0);
-        return (List<outPopularCitiesList>) findList("popularCitiesList",param,1,9999);
+        List<outPopularCitiesList> list=(List<outPopularCitiesList>) findList("popularCitiesList",param,1,9999);
+        return list;
     }
 
-    @CacheEvict(value = "getAllLinks", allEntries = true)
+    @CacheEvict(value = "getAllpopularCities", allEntries = true)
     public int cleanAllpopularCities() {
         LoggerUtils.debug(logger, "清除热门城市缓存");
         return 1;

+ 64 - 0
src/main/java/com/kede/visitingCustomers/bo/OutVisitingCustomers.java

@@ -1,9 +1,73 @@
 package com.kede.visitingCustomers.bo;
 
 import com.kede.common.model.VisitingCustomers;
+import com.kede.common.utils.excel.Excel;
 
 public class OutVisitingCustomers extends VisitingCustomers{
+
+	@Excel(name = "编号")
+	private Integer id;
+	@Excel(name = "姓名")
+	private String name;
+	@Excel(name = "联系方式")
+	private String mobile;
+	@Excel(name = "提交时间")
 	private String createTimes;
+	@Excel(name = "是否查看",readConverterExp = "0=未读,1=已读")
+	private Integer status;
+	@Excel(name = "回复备注")
+	private String remark;
+
+
+	@Override
+	public Integer getId() {
+		return id;
+	}
+
+	@Override
+	public void setId(Integer id) {
+		this.id = id;
+	}
+
+	@Override
+	public String getName() {
+		return name;
+	}
+
+	@Override
+	public void setName(String name) {
+		this.name = name;
+	}
+
+	@Override
+	public String getMobile() {
+		return mobile;
+	}
+
+	@Override
+	public void setMobile(String mobile) {
+		this.mobile = mobile;
+	}
+
+	@Override
+	public Integer getStatus() {
+		return status;
+	}
+
+	@Override
+	public void setStatus(Integer status) {
+		this.status = status;
+	}
+
+	@Override
+	public String getRemark() {
+		return remark;
+	}
+
+	@Override
+	public void setRemark(String remark) {
+		this.remark = remark;
+	}
 
 	public String getCreateTimes() {
 		return createTimes;

+ 10 - 2
src/main/java/com/kede/visitingCustomers/controller/AdminVisitingCustomersApiController.java

@@ -56,14 +56,22 @@ public class AdminVisitingCustomersApiController extends BaseApiController {
 		res.data(visitingCustomersService.deleteVisitingCustomers(vc.getId()));
 		return res;
 	}
-	
+
 	@RequestMapping(value = "/listVisitingCustomers", method = RequestMethod.GET)
 	public Result listRecruitment(InputVisitingCustomers vc ) {
 		Result res =new Result();
-		
+
 		res.data(visitingCustomersService.listVisitingCustomers(vc));
 		return res;
 	}
+
+	@RequestMapping(value = "/listVisitingCustomers/export", method = RequestMethod.GET)
+	public Result listRecruitmentExport(InputVisitingCustomers vc ) {
+		Result res =new Result();
+
+		res.data(visitingCustomersService.listRecruitmentExport(vc));
+		return res;
+	}
 	
 	
 	

+ 2 - 0
src/main/java/com/kede/visitingCustomers/service/VisitingCustomersService.java

@@ -1,5 +1,6 @@
 package com.kede.visitingCustomers.service;
 
+import com.kede.common.bo.Result;
 import com.kede.common.model.VisitingCustomers;
 import com.kede.core.mybatis.page.Pagination;
 import com.kede.visitingCustomers.bo.InputVisitingCustomers;
@@ -17,4 +18,5 @@ public interface VisitingCustomersService {
 	Pagination<OutVisitingCustomers> listVisitingCustomers(InputVisitingCustomers vc);
 
 
+	Result listRecruitmentExport(InputVisitingCustomers vc);
 }

+ 82 - 55
src/main/java/com/kede/visitingCustomers/service/impl/VisitingCustomersServiceImpl.java

@@ -1,55 +1,82 @@
-package com.kede.visitingCustomers.service.impl;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-import com.kede.common.dao.VisitingCustomersMapper;
-import com.kede.common.model.VisitingCustomers;
-import com.kede.core.mybatis.BaseMybatisDao;
-import com.kede.core.mybatis.page.Pagination;
-import com.kede.recruitment.bo.OutRecruitment;
-import com.kede.visitingCustomers.bo.InputVisitingCustomers;
-import com.kede.visitingCustomers.bo.OutVisitingCustomers;
-import com.kede.visitingCustomers.service.VisitingCustomersService;
-
-@Service
-public class VisitingCustomersServiceImpl extends BaseMybatisDao<VisitingCustomersMapper> implements VisitingCustomersService {
-	
-	
-	@Autowired
-	private VisitingCustomersMapper	visitingCustomersMapper;
-	
-	@Override
-	public int addVisitingCustomers(VisitingCustomers vc) {
-		
-		return visitingCustomersMapper.insertSelective(vc);
-	}
-
-	@Override
-	public int updateVisitingCustomers(VisitingCustomers vc) {
-		VisitingCustomers v=new VisitingCustomers();
-		v.setId(vc.getId());
-		v.setStatus(vc.getStatus());
-		v.setRemark(vc.getRemark());
-		return visitingCustomersMapper.updateByPrimaryKeySelective(v);
-	}
-
-	@Override
-	public int deleteVisitingCustomers(Integer id) {
-		return visitingCustomersMapper.deleteByPrimaryKey(id);
-	}
-
-	@SuppressWarnings("unchecked")
-	@Override
-	public Pagination<OutVisitingCustomers> listVisitingCustomers(InputVisitingCustomers vc) {
-		Map<String, Object> params=new HashMap<>();
-		params.put("startTime", vc.getStartTime());
-		params.put("endTime", vc.getEndTime()+" 23:59:59");
-		params.put("name", vc.getName());
-		return (Pagination<OutVisitingCustomers>) findPage("findVisitingCustomersList", "findVisitingCustomersCount", params, vc.getPageNo(), vc.getPageSize());
-	}
-
-}
+package com.kede.visitingCustomers.service.impl;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import com.kede.common.bo.Result;
+import com.kede.common.utils.excel.NewExcelUtil;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Service;
+
+import com.kede.common.dao.VisitingCustomersMapper;
+import com.kede.common.model.VisitingCustomers;
+import com.kede.core.mybatis.BaseMybatisDao;
+import com.kede.core.mybatis.page.Pagination;
+import com.kede.recruitment.bo.OutRecruitment;
+import com.kede.visitingCustomers.bo.InputVisitingCustomers;
+import com.kede.visitingCustomers.bo.OutVisitingCustomers;
+import com.kede.visitingCustomers.service.VisitingCustomersService;
+
+@Service
+public class VisitingCustomersServiceImpl extends BaseMybatisDao<VisitingCustomersMapper> implements VisitingCustomersService {
+	@Value(value = "${upload.path}")
+	public  String downloadPath = "";
+	@Autowired
+	private VisitingCustomersMapper	visitingCustomersMapper;
+
+	
+	@Override
+	public int addVisitingCustomers(VisitingCustomers vc) {
+		
+		return visitingCustomersMapper.insertSelective(vc);
+	}
+
+	@Override
+	public int updateVisitingCustomers(VisitingCustomers vc) {
+		VisitingCustomers v=new VisitingCustomers();
+		v.setId(vc.getId());
+		v.setStatus(vc.getStatus());
+		v.setRemark(vc.getRemark());
+		return visitingCustomersMapper.updateByPrimaryKeySelective(v);
+	}
+
+	@Override
+	public int deleteVisitingCustomers(Integer id) {
+		return visitingCustomersMapper.deleteByPrimaryKey(id);
+	}
+
+	@SuppressWarnings("unchecked")
+	@Override
+	public Pagination<OutVisitingCustomers> listVisitingCustomers(InputVisitingCustomers vc) {
+		Map<String, Object> params=new HashMap<>();
+		params.put("startTime", vc.getStartTime());
+		params.put("endTime", vc.getEndTime()+" 23:59:59");
+		params.put("name", vc.getName());
+		return (Pagination<OutVisitingCustomers>) findPage("findVisitingCustomersList", "findVisitingCustomersCount", params, vc.getPageNo(), vc.getPageSize());
+	}
+
+	private void setParams(InputVisitingCustomers vc, Map<String, Object> params) {
+		if(vc.getStartTime()!=null) params.put("startTime", vc.getStartTime());
+		if(vc.getEndTime()!=null) params.put("endTime", vc.getEndTime()+" 23:59:59");
+		if(vc.getName()!=null) params.put("name", vc.getName());
+		if(vc.getStatus()!=null) params.put("status", vc.getStatus());
+	}
+
+	@Override
+	public Result listRecruitmentExport(InputVisitingCustomers vc) {
+		Map<String, Object> params=new HashMap<>();
+		setParams(vc, params);
+		List<OutVisitingCustomers> list = (List<OutVisitingCustomers>) findList("findVisitingCustomersList", params, vc.getPageNo(), vc.getPageSize());
+		NewExcelUtil newExcelUtil=new NewExcelUtil(OutVisitingCustomers.class);
+		StringBuffer str=new StringBuffer("搜索条件=>");
+		if(vc.getStartTime()!=null&&vc.getEndTime()!=null){
+			str=str.append("提交日期:").append(vc.getStartTime()).append("~").append(vc.getEndTime()).append(" 23:59:59,");
+		}
+		if(vc.getName()!=null) str=str.append("姓名:").append(vc.getName()).append(",");
+		if(vc.getStatus()!=null) str=str.append("是否查看:").append(vc.getStatus()==0?"否":"是").append(",");
+		return newExcelUtil.exportExcel(list,"客户访问列表",downloadPath,str.substring(0,str.length()-1));
+	}
+
+}

+ 3 - 1
src/main/resources/props/config_local.properties

@@ -62,7 +62,9 @@ avatar.upload.host=//172.16.0.255:3000/upload
 #连接开�
 portal.host=//kedejs.jishutao.com/portal/1.0.18
 #static.host=//kedejs.jishutao.com/client/1.0.4
-static.host=//172.16.0.255:3000/1.0.5
+static.host=//172.16.0.52/client/1.0.5
+#static.host=//172.16.0.255:3000/1.0.5
+#static.host=//172.16.0.255:3000/1.0.5
 avatar.host=//172.16.0.255:3000
 
 

+ 51 - 10
src/main/webapp/WEB-INF/views/common.html

@@ -381,23 +381,26 @@
 </th:block>
 <!-- 底部 -->
 <th:block th:fragment="copyright">
-    <div class="contentDown">
+    <div class="contentDown" style="height:540px">
         <div class="container">
             <!-- 友情链接 -->
-            <div>
+            <div style="position: relative;top:0;left:0;">
                 <div class="down_left">
                     <p>友情链接</p>
                 </div>
-                <div class="swiper-container" id="swiper5" style="height:140px">
+                <div class="swiper-container" id="swiper5" style="height:70px">
                     <div class="swiper-wrapper">
-                        <div class="swiper-slide" style="display:flex" >
+                        <div class="swiper-slide">
                             <div >
-                                <a style="color:white ;padding: 0 10px;min-width:10%;max-width:25%; word-wrap: break-word;word-break: normal;"  th:each="link:${links}" th:href="${link.url}" th:text="${link.name}"></a>
+                               <span style="display:inline-block;padding: 0 10px;" th:each="link:${links}"> <a style="color:white ; word-wrap: break-word;word-break: normal;"   th:href="${link.url}" th:text="${link.name}"></a></span>
                             </div>
                         </div>
+<!--                        <div class="swipers">-->
 
+<!--                        </div>-->
                     </div>
                 </div>
+                <div style="color:white;position: absolute;right:0;bottom:0;z-index: 999" ><a th:href="${basePath+'/portal/link'}">More<sup>+</sup></a></div>
             </div>
             <div class="row" style="position: relative;">
                 <div class="down_left col-lg-3 ">
@@ -472,6 +475,24 @@
                 <div class="line01"></div>
                 <div class="line02"></div>
             </div>
+<!--    热门城市 -->
+            <div style="display: flex;margin-top: 10px;align-items: center">
+                <div class="down_left">
+                    <p style="width: 80px;text-align: center">热门城市:</p>
+                </div>
+                <div class="swiper-container" id="swiper6x" style="height:20px">
+                    <div class="swiper-wrapper">
+                        <div class="swiper-slide">
+                            <div>
+                                <span style="display:inline-block;padding: 0 10px;" th:each="p:${popularCities}"> <a style="color:white ; word-wrap: break-word;word-break: normal;"   th:href="${p.url}" th:text="${p.name}"></a></span>
+                            </div>
+                        </div>
+                        <!--                        <div class="swipers">-->
+
+                        <!--                        </div>-->
+                    </div>
+                </div>
+            </div>
         </div>
     </div>
 
@@ -634,16 +655,36 @@
             },
             loop: true,
             // slidesPerView:2,
-            grid: {
-                fill: 'column',
-                rows: 3,
-            },
+            // grid: {
+            //     fill: 'column',
+            //     rows: 3,
+            // },
 
         });
-        // const link = globalConfig.links;
+        const link = globalConfig.links;
         // link.forEach(element => {
         //     swiper.appendSlide('<div class="swiper-slide" style="display:flex"><div style="padding: 0 4px"><a style="color:white" href='+element.url+' ><span>'+element.name+'</span></a></div></div>');
         // });
+        // const link = globalConfig.links;
+        // link.forEach(element => {
+        //     $('.links').append('<div class="swiper-slide" ><a style="color:white" href='+element.url+' ><span>'+element.name+'</span></a></div>')
+        // });
+    </script>
+    <script>
+        var swiper = new Swiper("#swiper6x", {
+            direction : 'vertical',
+            autoplay: {
+                delay: 3000,
+                // pauseOnMouseEnter: true,
+            },
+            loop: true,
+            // slidesPerView:2,
+            // grid: {
+            //     fill: 'column',
+            //     rows: 3,
+            // },
+
+        });
     </script>
     <script th:if="${type}!='houtai'">
         var _hmt = _hmt || [];

+ 57 - 0
src/main/webapp/WEB-INF/views/portal/link.html

@@ -0,0 +1,57 @@
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
+<head th:replace="common::header(~{::title},~{::link})">
+    <meta charset="UTF-8">
+    <meta name="viewport" content="width=device-width,initial-scale=1.0, user-scalable=no">
+    <meta http-equiv="X-UA-Compatible" content="ie=edge">
+    <title>友情链接</title>
+    <!-- 二级页面CSS -->
+    <link rel="stylesheet" th:href="${portalHost+'/css/secode.css'}">
+    <!-- 自定义动画样式 -->
+    <link rel="stylesheet" th:href="${portalHost+'/css/swiper.min.css'}">
+</head>
+<style>
+.linkAll>span:hover {
+  color: rgb(10, 98, 156);
+}
+</style>
+<body>
+    <div class="app">
+        <!-- 头部 -->
+        <!-- 头部 -->
+        <header>
+            <div th:replace="common::nav('','')"></div>
+            <div class="swiper-containerx">
+                <img th:src="${banners}==null?${portalHost+'/images/banner/about_bg.png'}:${avatarUploadHost}+${banners.bannerUrl}" />
+                <div class="swiper_title">
+                    <h6>新闻动态</h6>
+                </div>
+            </div>
+        </header>
+        <!-- 主体内容 -->
+        <div class="client main" >
+            <div style="height: 60px;line-height: 60px;width: 70vw;margin: 0 auto;text-align: center;color: rgb(11, 103, 189);box-shadow:0px 0px  5px 2px #aaa;font-weight: bolder;">友情链接</div>
+            <div style="padding:6px 20px;width:70vw;margin: 0 auto;">
+              <h3>友情链接</h3>
+              <div class="linkAll" style="margin: 6px 0;" >
+                      <span style="display: inline-block;padding-right: 6px;" th:each="link:${links}"><a style="color:#333" th:href="${link.url}" th:text="${link.name}"></a></span>
+              </div>
+            </div>
+        </div>
+        <!-- 主体内容  end -->
+        <!-- 底部 -->
+        <footer>
+          <div th:replace="common::copyright"></div>
+        </footer>
+        <!-- 底部  end -->
+    </div>
+
+     <div th:replace="common::footer(~{::script},'')">
+
+    <!-- 引入分页 -->
+    <script th:src="${portalHost+'/js/page.js'}"></script>
+     </div>
+
+</body>
+
+</html>