From d95b0a4028550f9b892bf1bbd1ff0a7ff02c6961 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=87=E4=BB=B6=E5=82=B3=E8=BC=B8=E5=8A=A9=E6=89=8B?= <1766219146@qq.com> Date: Thu, 18 Aug 2022 10:15:16 +0800 Subject: [PATCH 1/3] shl --- .../irs/controller/EnterpriseController.java | 13 +++++++----- .../irs/service/EnterpriseService.java | 2 -- .../service/Impl/EnterpriceServiceImpl.java | 4 ---- .../sixteam/irs/mapper/EnterpriseMapper.xml | 2 +- ...\350\241\250\351\241\265\351\235\242.html" | 20 +++++++++---------- ...\344\270\232\351\241\265\351\235\242.html" | 14 ++++++------- ...\344\270\232\351\241\265\351\235\242.html" | 2 +- 7 files changed, 27 insertions(+), 30 deletions(-) diff --git a/src/main/java/com/sixteam/irs/controller/EnterpriseController.java b/src/main/java/com/sixteam/irs/controller/EnterpriseController.java index 37617c1..8f6e8bb 100644 --- a/src/main/java/com/sixteam/irs/controller/EnterpriseController.java +++ b/src/main/java/com/sixteam/irs/controller/EnterpriseController.java @@ -4,6 +4,7 @@ import com.sixteam.irs.entity.Enterprise; import com.sixteam.irs.entity.User; import com.sixteam.irs.service.EnterpriseService; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; @@ -12,7 +13,7 @@ import org.springframework.web.bind.annotation.RestController; import javax.servlet.http.HttpServletRequest; import java.util.List; -@RestController +@Controller @RequestMapping("/enterprise") public class EnterpriseController { @@ -22,9 +23,8 @@ public class EnterpriseController { //查询所有企业 @RequestMapping("/getAllEnterprise") public String getAllEnterprise(HttpServletRequest request){ - List getAllEnterprise = enterpriseService.getAllEnterprise(); - request.setAttribute("getAllEnterprise",getAllEnterprise); - System.out.println(getAllEnterprise); + List enterpriseList = enterpriseService.findAllEnterprise(); + request.setAttribute("enterpriseList",enterpriseList); return "/test/enterprise/企业列表页面.html"; } @@ -63,9 +63,11 @@ public class EnterpriseController { @RequestMapping("/toUpdateEnterprise") - public String toUpdateEnterprise(Enterprise enterprise, Model model, Integer id) { + public String toUpdateEnterprise(Enterprise enterprise, Model model) { + Enterprise enterprise1 = enterpriseService.findById(enterprise); + model.addAttribute("enterprise1", enterprise1); return "/test/enterprise/修改企业页面.html"; @@ -73,6 +75,7 @@ public class EnterpriseController { @RequestMapping(value = "/updateEnterprise") public String updateUser(Enterprise enterprise, Model model) { + System.out.println(enterprise); if (enterpriseService.updateEnterprise(enterprise)>0) { return "redirect:/enterprise/getAllEnterprise"; diff --git a/src/main/java/com/sixteam/irs/service/EnterpriseService.java b/src/main/java/com/sixteam/irs/service/EnterpriseService.java index e2f138b..9e14be1 100644 --- a/src/main/java/com/sixteam/irs/service/EnterpriseService.java +++ b/src/main/java/com/sixteam/irs/service/EnterpriseService.java @@ -6,8 +6,6 @@ import java.util.List; public interface EnterpriseService { - List getAllEnterprise();//查询所有企业 - int addEnterprise(Enterprise enterprise);//添加企业 diff --git a/src/main/java/com/sixteam/irs/service/Impl/EnterpriceServiceImpl.java b/src/main/java/com/sixteam/irs/service/Impl/EnterpriceServiceImpl.java index d1b769e..0a58575 100644 --- a/src/main/java/com/sixteam/irs/service/Impl/EnterpriceServiceImpl.java +++ b/src/main/java/com/sixteam/irs/service/Impl/EnterpriceServiceImpl.java @@ -15,10 +15,6 @@ public class EnterpriceServiceImpl implements EnterpriseService { @Autowired private EnterpriseMapper enterpriseMapper; - @Override - public List getAllEnterprise() { - return null; - } @Override public List findAllEnterprise() { diff --git a/src/main/resources/com/sixteam/irs/mapper/EnterpriseMapper.xml b/src/main/resources/com/sixteam/irs/mapper/EnterpriseMapper.xml index 11cb26f..82edfb5 100644 --- a/src/main/resources/com/sixteam/irs/mapper/EnterpriseMapper.xml +++ b/src/main/resources/com/sixteam/irs/mapper/EnterpriseMapper.xml @@ -40,7 +40,7 @@ e_type = #{eType}, e_founder = #{eFounder}, - where eId = #{eId} + where e_id = #{eId} \ No newline at end of file diff --git "a/src/main/resources/templates/test/enterprise/\344\274\201\344\270\232\345\210\227\350\241\250\351\241\265\351\235\242.html" "b/src/main/resources/templates/test/enterprise/\344\274\201\344\270\232\345\210\227\350\241\250\351\241\265\351\235\242.html" index c6bd1f7..66bb25b 100644 --- "a/src/main/resources/templates/test/enterprise/\344\274\201\344\270\232\345\210\227\350\241\250\351\241\265\351\235\242.html" +++ "b/src/main/resources/templates/test/enterprise/\344\274\201\344\270\232\345\210\227\350\241\250\351\241\265\351\235\242.html" @@ -1,5 +1,5 @@ - + Title @@ -19,16 +19,16 @@ 企业创始人 操作 - - id(遍历的值) - 企业名(遍历的值) - 企业介绍(遍历的值) - 企业成立时间(遍历的值) - 企业类型(遍历的值) - 企业创始人(遍历的值) + + id(遍历的值) + 企业名(遍历的值) + 企业介绍(遍历的值) + 企业成立时间(遍历的值) + 企业类型(遍历的值) + 企业创始人(遍历的值) - 删除 - 修改 + 删除 + 修改 diff --git "a/src/main/resources/templates/test/enterprise/\344\277\256\346\224\271\344\274\201\344\270\232\351\241\265\351\235\242.html" "b/src/main/resources/templates/test/enterprise/\344\277\256\346\224\271\344\274\201\344\270\232\351\241\265\351\235\242.html" index 3b753d8..1fb58d1 100644 --- "a/src/main/resources/templates/test/enterprise/\344\277\256\346\224\271\344\274\201\344\270\232\351\241\265\351\235\242.html" +++ "b/src/main/resources/templates/test/enterprise/\344\277\256\346\224\271\344\274\201\344\270\232\351\241\265\351\235\242.html" @@ -1,5 +1,5 @@ - + Title @@ -8,12 +8,12 @@

修改企业页面

- - 公司名:
- 公司介绍:
- 公司起始时间:
- 公司类型:
- 公司创始人:
+ + 公司名:
+ 公司介绍:
+ 公司起始时间:
+ 公司类型:
+ 公司创始人:
diff --git "a/src/main/resources/templates/test/enterprise/\346\267\273\345\212\240\344\274\201\344\270\232\351\241\265\351\235\242.html" "b/src/main/resources/templates/test/enterprise/\346\267\273\345\212\240\344\274\201\344\270\232\351\241\265\351\235\242.html" index 20a2db1..bffe50c 100644 --- "a/src/main/resources/templates/test/enterprise/\346\267\273\345\212\240\344\274\201\344\270\232\351\241\265\351\235\242.html" +++ "b/src/main/resources/templates/test/enterprise/\346\267\273\345\212\240\344\274\201\344\270\232\351\241\265\351\235\242.html" @@ -8,7 +8,7 @@

添加企业页面

- + 公司Id:
公司名:
公司介绍:
公司起始时间:
-- Gitee From 38b6aead551b80ece849f190c215da20436b1ea8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=87=E4=BB=B6=E5=82=B3=E8=BC=B8=E5=8A=A9=E6=89=8B?= <1766219146@qq.com> Date: Thu, 18 Aug 2022 16:25:44 +0800 Subject: [PATCH 2/3] shl --- .../irs/controller/UserController.java | 5 ++ src/main/resources/templates/test/index.html | 7 +-- .../test/\345\244\264\345\203\217.html" | 47 +++++++++++++++++++ 3 files changed, 56 insertions(+), 3 deletions(-) create mode 100644 "src/main/resources/templates/test/\345\244\264\345\203\217.html" diff --git a/src/main/java/com/sixteam/irs/controller/UserController.java b/src/main/java/com/sixteam/irs/controller/UserController.java index d01ae62..e2fba7a 100644 --- a/src/main/java/com/sixteam/irs/controller/UserController.java +++ b/src/main/java/com/sixteam/irs/controller/UserController.java @@ -128,6 +128,11 @@ public class UserController { } } + @RequestMapping("/touxiang") + public String touxiang(){ + return "/test/头像.html"; + } + // @RequestMapping("/findAllUser") // public String findAllUser(Model model){ diff --git a/src/main/resources/templates/test/index.html b/src/main/resources/templates/test/index.html index 6abb779..6cb03ac 100644 --- a/src/main/resources/templates/test/index.html +++ b/src/main/resources/templates/test/index.html @@ -5,11 +5,12 @@ Title -

首页

+

首页

职场百科列表 企业列表 权限列表 -去管理员页面 -去用户页面 + 去管理员页面 + 去用户页面 + 头像 \ No newline at end of file diff --git "a/src/main/resources/templates/test/\345\244\264\345\203\217.html" "b/src/main/resources/templates/test/\345\244\264\345\203\217.html" new file mode 100644 index 0000000..49872be --- /dev/null +++ "b/src/main/resources/templates/test/\345\244\264\345\203\217.html" @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + User Image + + + + + + -- Gitee From 14a5877edb9e1d316c743c924b567871c906bc4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=87=E4=BB=B6=E5=82=B3=E8=BC=B8=E5=8A=A9=E6=89=8B?= <1766219146@qq.com> Date: Fri, 19 Aug 2022 14:36:47 +0800 Subject: [PATCH 3/3] shl --- .../irs/controller/EnterpriseController.java | 13 ++++++------- .../resources/com/sixteam/irs/mapper/UserMapper.xml | 2 +- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/sixteam/irs/controller/EnterpriseController.java b/src/main/java/com/sixteam/irs/controller/EnterpriseController.java index 8f6e8bb..829acd8 100644 --- a/src/main/java/com/sixteam/irs/controller/EnterpriseController.java +++ b/src/main/java/com/sixteam/irs/controller/EnterpriseController.java @@ -6,14 +6,13 @@ import com.sixteam.irs.service.EnterpriseService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletRequest; import java.util.List; -@Controller +@RestController +@CrossOrigin @RequestMapping("/enterprise") public class EnterpriseController { @@ -22,10 +21,10 @@ public class EnterpriseController { //查询所有企业 @RequestMapping("/getAllEnterprise") - public String getAllEnterprise(HttpServletRequest request){ + @ResponseBody + public List getAllEnterprise(HttpServletRequest request){ List enterpriseList = enterpriseService.findAllEnterprise(); - request.setAttribute("enterpriseList",enterpriseList); - return "/test/enterprise/企业列表页面.html"; + return enterpriseList; } @RequestMapping("/toAddEnterprise") diff --git a/src/main/resources/com/sixteam/irs/mapper/UserMapper.xml b/src/main/resources/com/sixteam/irs/mapper/UserMapper.xml index db767ac..c3abc96 100644 --- a/src/main/resources/com/sixteam/irs/mapper/UserMapper.xml +++ b/src/main/resources/com/sixteam/irs/mapper/UserMapper.xml @@ -67,7 +67,7 @@ where u_id = #{uId} - select * from irs_user where u_email = #{uEmail} and u_password = #{uPassword} or u_phone =#{uPhone} and u_password = #{uPassword} \ No newline at end of file -- Gitee