diff --git a/intellagric-agriecom-web/src/main/java/com/intellagric/agriecom/controller/agriecom_index/IndexController.java b/intellagric-agriecom-web/src/main/java/com/intellagric/agriecom/controller/agriecom_index/IndexController.java index e53ef1a249673335a0216f615e03d2a90bf03c1e..70e4fbcb6a04ed2dd1bff6296809cad30da1a804 100644 --- a/intellagric-agriecom-web/src/main/java/com/intellagric/agriecom/controller/agriecom_index/IndexController.java +++ b/intellagric-agriecom-web/src/main/java/com/intellagric/agriecom/controller/agriecom_index/IndexController.java @@ -14,14 +14,11 @@ import com.intellagric.pojo.SysUser; import com.intellagric.service.module.cms_content.ContentCategoryService; import com.intellagric.service.module.cms_content.ContentService; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.converter.json.MappingJacksonValue; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; import javax.servlet.http.HttpServletRequest; -import java.io.UnsupportedEncodingException; -import java.net.URLEncoder; import java.util.List; @Controller diff --git a/intellagric-agriecom-web/src/test/GrabData/GrabDataDemo.java b/intellagric-agriecom-web/src/test/GrabData/GrabDataDemo.java index c2cd0e0ef2a8c1c3032a9acf1fd843591eae1033..12f736a53a36358620a200fa49bdbfea95a9beba 100644 --- a/intellagric-agriecom-web/src/test/GrabData/GrabDataDemo.java +++ b/intellagric-agriecom-web/src/test/GrabData/GrabDataDemo.java @@ -36,101 +36,103 @@ public class GrabDataDemo { Document document = Jsoup.parse(html); //获取html class 为product-content-ul 的节点 Elements divs = document.getElementsByClass("product-bg"); + for(Element e :divs) { + System.out.println(e); + } - - for(Element e :divs){ - AgriecomProduce p=new AgriecomProduce(); - - p.setProduceId(UUIDUtils.getID()); - //categoryId分类 - p.setCategoryId("41"); - - //显示一张图片 - Elements imgEle= e.select("img.s-image"); - String img=imgEle.get(0).attr("src")+","; - p.setProduceImg(img); - - e=e.selectFirst("#fruit-text"); - //产品名称 - Element nameEle= e.selectFirst("span.fruit-explain"); - String name=nameEle.text(); - p.setProduceName(name); - - //单位 - Elements unitEle= e.select("li span.Jin"); - String unit=unitEle.get(0).text(); - p.setUnit(unit); - //价格 - Elements priceEle= e.select("li span.fruit-price"); - String price=priceEle.get(0).text(); - p.setPrice(Float.parseFloat(price)); - //producingArea产地 - Elements placeEle= e.select("li span.place"); - String producingArea=placeEle.get(1).text(); - p.setProducingArea(producingArea); - //商家名称 - - - //进去产品详情页面,再抓取数据 - - //商品编号 - Elements proIdEle= e.select("a.seller"); - String proId=proIdEle.get(0).attr("href"); - String urlPro = "http://www.cnhnb.com"+proId; - //爬取网页信息 - String htmlPro = pickData(urlPro); - //获取html中的内容 - Document documentPro = Jsoup.parse(htmlPro); - - - //图片区 - Elements imgUl = documentPro.getElementsByClass("ul.clearfix"); - //图片完善 - Elements imgEles= imgUl.select("img.s-image"); - for(int j=1;j1) - params=params.substring(0,params.length()-2);//切掉最后的; - p.setProduceParameter(params); - System.out.println(p.toString()); -// produceService.insertProduce(p); - - } +// +// e=e.selectFirst("#fruit-text"); +// //产品名称 +// Element nameEle= e.selectFirst("span.fruit-explain"); +// String name=nameEle.text(); +// p.setProduceName(name); +// +// //单位 +// Elements unitEle= e.select("li span.Jin"); +// String unit=unitEle.get(0).text(); +// p.setUnit(unit); +// //价格 +// Elements priceEle= e.select("li span.fruit-price"); +// String price=priceEle.get(0).text(); +// p.setPrice(Float.parseFloat(price)); +// //producingArea产地 +// Elements placeEle= e.select("li span.place"); +// String producingArea=placeEle.get(1).text(); +// p.setProducingArea(producingArea); +// //商家名称 +// +// +// //进去产品详情页面,再抓取数据 +// +// //商品编号 +// Elements proIdEle= e.select("a.seller"); +// String proId=proIdEle.get(0).attr("href"); +// String urlPro = "http://www.cnhnb.com"+proId; +// //爬取网页信息 +// String htmlPro = pickData(urlPro); +// //获取html中的内容 +// Document documentPro = Jsoup.parse(htmlPro); +// +// +// //图片区 +// Elements imgUl = documentPro.getElementsByClass("ul.clearfix"); +// //图片完善 +// Elements imgEles= imgUl.select("img.s-image"); +// for(int j=1;j1) +// params=params.substring(0,params.length()-2);//切掉最后的; +// p.setProduceParameter(params); +// System.out.println(p.toString()); +//// produceService.insertProduce(p); +// +// } diff --git a/intellagric-common/src/main/java/com/intellagric/common/utils/CookieUtils.java b/intellagric-common/src/main/java/com/intellagric/common/utils/CookieUtils.java index 4ebe2fb62ec912384ed46481d4cd6149a74be7b5..9a78bd097dd280200af18334973182dcb4baf2d9 100644 --- a/intellagric-common/src/main/java/com/intellagric/common/utils/CookieUtils.java +++ b/intellagric-common/src/main/java/com/intellagric/common/utils/CookieUtils.java @@ -149,9 +149,9 @@ public final class CookieUtils { if (null != request) {// 设置域名的cookie String domainName = getDomainName(request); System.out.println(domainName); - if (!"localhost".equals(domainName)) { - cookie.setDomain(domainName); - } +// if (!"localhost".equals(domainName)) { +// cookie.setDomain(domainName); +// } } cookie.setPath("/"); response.addCookie(cookie); diff --git a/intellagric-manager-web/src/main/java/com/intellagric/controller/module/trace_person/PersonTypeController.java b/intellagric-manager-web/src/main/java/com/intellagric/controller/module/trace_person/PersonTypeController.java index 3d794d2fb0f6bac7a031c6aa80b974e23e1a806a..144f53c40d21d3bb0da2c7fd02f652375146cc1f 100644 --- a/intellagric-manager-web/src/main/java/com/intellagric/controller/module/trace_person/PersonTypeController.java +++ b/intellagric-manager-web/src/main/java/com/intellagric/controller/module/trace_person/PersonTypeController.java @@ -85,15 +85,6 @@ public class PersonTypeController { return personTypeService.getPersonTypeTree(createBy); } - /** - * 查询所有人员类别树信息 - * @return LayuiDataGridResult - */ - @RequestMapping("/person/type/enterprise/tree/select") - @ResponseBody - public List getTreeSelect(String createBy) { - return personTypeService.getPersonTypeTree(createBy).getData(); - } /** diff --git a/intellagric-manager-web/src/main/java/com/intellagric/controller/module/trace_record/InvestRecordController.java b/intellagric-manager-web/src/main/java/com/intellagric/controller/module/trace_record/InvestRecordController.java index 4f5fdb98610e1df7e24f01d79c80295c1a26ff76..005a0a3274d64e3dd1006504ad42d3287d690e64 100644 --- a/intellagric-manager-web/src/main/java/com/intellagric/controller/module/trace_record/InvestRecordController.java +++ b/intellagric-manager-web/src/main/java/com/intellagric/controller/module/trace_record/InvestRecordController.java @@ -35,8 +35,8 @@ public class InvestRecordController { @ResponseBody public ResponseMessage add(TraceRecordInvest recordInvest) { recordInvest.setId(UUID.randomUUID().toString().replaceAll("-","")); - recordInvest.setCreateDate(new Date()); - recordInvest.setUpdateDate(new Date()); + recordInvest.setCreateDate(new Date()); + recordInvest.setUpdateDate(new Date()); return investRecordService.addInvestRecord(recordInvest); } diff --git a/intellagric-manager-web/src/main/java/com/intellagric/controller/page/AdminFilter.java b/intellagric-manager-web/src/main/java/com/intellagric/controller/page/AdminFilter.java index b1d3b839f1e410e70aa5ac321e9aa845a6bb8e8c..c488db43eba5ca88b4b55cf0fe5cc9f84e3951fc 100644 --- a/intellagric-manager-web/src/main/java/com/intellagric/controller/page/AdminFilter.java +++ b/intellagric-manager-web/src/main/java/com/intellagric/controller/page/AdminFilter.java @@ -71,4 +71,5 @@ public class AdminFilter implements Filter { public void destroy() { } -} + +} \ No newline at end of file diff --git a/intellagric-manager-web/src/main/java/com/intellagric/controller/page/PageController.java b/intellagric-manager-web/src/main/java/com/intellagric/controller/page/PageController.java index 5c42a75075149428f8868c74b942e50b2a39b1e1..feb0f29ef6b1550a474eb73adb96063bbc8ba319 100644 --- a/intellagric-manager-web/src/main/java/com/intellagric/controller/page/PageController.java +++ b/intellagric-manager-web/src/main/java/com/intellagric/controller/page/PageController.java @@ -1,8 +1,8 @@ package com.intellagric.controller.page; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestMapping; + import org.springframework.stereotype.Controller; + import org.springframework.web.bind.annotation.PathVariable; + import org.springframework.web.bind.annotation.RequestMapping; /** * 页面跳转 @@ -23,13 +23,13 @@ public class PageController { return page; } - /** - * 后台管理系统模块访问路径 - */ - @RequestMapping("/admin/sys/{module}/{page}") - public String accessSysPage(@PathVariable String module,@PathVariable String page) { - return module + "/" + page; - } + /** + * 后台管理系统模块访问路径 + */ + @RequestMapping("/admin/sys/{module}/{page}") + public String accessSysPage(@PathVariable String module,@PathVariable String page) { + return module + "/" + page; + } /** * 后台管理物联网监控模块访问路径 @@ -64,13 +64,13 @@ public class PageController { return "traceability/" + module + "/" + page + "/" + subPage; } - /** - * 后台管理内容管理模块访问路径 - */ - @RequestMapping("/admin/cms/{module}/{page}") - public String accesscontentSubPage(@PathVariable String module, @PathVariable String page) { - return "cms/" + module + "/" + page; - } + /** + * 后台管理内容管理模块访问路径 + */ + @RequestMapping("/admin/cms/{module}/{page}") + public String accesscontentSubPage(@PathVariable String module, @PathVariable String page) { + return "cms/" + module + "/" + page; + } /** * 后台管理农业电商模块访问路径 @@ -80,16 +80,16 @@ public class PageController { return "agriecom/"+module+"/"+page; } - /** - * 后台管理农技模块访问路径 - */ - @RequestMapping("/admin/agritech/{module}/{page}") - public String accessAgritechPage(@PathVariable String module, @PathVariable String page) { - return "agritech/" + module + "/" + page; - } + /** + * 后台管理农技模块访问路径 + */ + @RequestMapping("/admin/agritech/{module}/{page}") + public String accessAgritechPage(@PathVariable String module, @PathVariable String page) { + return "agritech/" + module + "/" + page; + } - @RequestMapping("/admin/agritech/{module}/{page}/{subPage}") - public String accessAgritechSubPage(@PathVariable String module, @PathVariable String page, @PathVariable String subPage) { - return "agritech/" + module + "/" + page + "/" + subPage; - } + @RequestMapping("/admin/agritech/{module}/{page}/{subPage}") + public String accessAgritechSubPage(@PathVariable String module, @PathVariable String page, @PathVariable String subPage) { + return "agritech/" + module + "/" + page + "/" + subPage; + } } diff --git a/intellagric-portal-web/src/main/java/com/intellagric/controller/portal/iftmonitor/CtrlEquipmentController.java b/intellagric-portal-web/src/main/java/com/intellagric/controller/portal/iftmonitor/CtrlEquipmentController.java index 79e0ec2b0a4ecb197a44edccf45618cb06758a26..1886cd3405e731662170bcc28fee9a0c9fc2324a 100644 --- a/intellagric-portal-web/src/main/java/com/intellagric/controller/portal/iftmonitor/CtrlEquipmentController.java +++ b/intellagric-portal-web/src/main/java/com/intellagric/controller/portal/iftmonitor/CtrlEquipmentController.java @@ -1,7 +1,6 @@ package com.intellagric.controller.portal.iftmonitor; import com.intellagric.common.pojo.LayuiDataGridResult; -import com.intellagric.common.pojo.ResponseMessage; import com.intellagric.module.iftmonitor.CtrlEquipmentVo; import com.intellagric.pojo.IftCtrlEquipment; import com.intellagric.service.iftmonitor.ift_ctrl_equipment.CtrlEquipmentService; @@ -11,8 +10,6 @@ import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; -import java.util.Date; -import java.util.UUID; /** * @Author: zhy diff --git a/intellagric-portal-web/src/main/java/com/intellagric/controller/portal/traceability/ProcessController.java b/intellagric-portal-web/src/main/java/com/intellagric/controller/portal/traceability/ProcessController.java index e5823af41201355eaac414416918a424b7113cb8..a4e55a3bb38e36258589b413a5e2359b57f25bf1 100644 --- a/intellagric-portal-web/src/main/java/com/intellagric/controller/portal/traceability/ProcessController.java +++ b/intellagric-portal-web/src/main/java/com/intellagric/controller/portal/traceability/ProcessController.java @@ -1,7 +1,6 @@ package com.intellagric.controller.portal.traceability; import com.intellagric.common.pojo.LayuiDataGridResult; -import com.intellagric.common.pojo.ResponseMessage; import com.intellagric.pojo.TraceProcess; import com.intellagric.service.traceability.trace_process.ProcessService; import org.springframework.beans.factory.annotation.Autowired; @@ -10,9 +9,7 @@ import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; -import java.util.Date; import java.util.List; -import java.util.UUID; /** * @Author: zhy