Commit 314db5be4424feca5486bbe07fa025290f1196b0

Authored by yiming
1 parent e45187ed

bf

Showing 17 changed files with 213 additions and 53 deletions
bsthLineProfiles/src/main/java/com/ruoyi/project/monitor/job/task/RyTask.java
... ... @@ -7,6 +7,11 @@ import java.util.HashMap;
7 7 import java.util.List;
8 8 import java.util.Map;
9 9  
  10 +import com.ruoyi.common.utils.security.ShiroUtils;
  11 +import com.ruoyi.project.system.dept.service.DeptServiceImpl;
  12 +import com.ruoyi.project.system.user.domain.User;
  13 +import org.apache.shiro.util.ThreadContext;
  14 +import org.apache.shiro.web.mgt.DefaultWebSecurityManager;
10 15 import org.springframework.beans.factory.annotation.Autowired;
11 16 import org.springframework.stereotype.Component;
12 17  
... ... @@ -28,6 +33,9 @@ public class RyTask {
28 33 @Autowired
29 34 IBsthTLineService lineService;
30 35  
  36 + @Autowired
  37 + DeptServiceImpl deptService;
  38 +
31 39 public void ryMultipleParams(String s, Boolean b, Long l, Double d, Integer i) {
32 40 System.out.println(StringUtils.format("执行多参方法: 字符串类型{},布尔类型{},长整型{},浮点型{},整形{}", s, b, l, d, i));
33 41 }
... ... @@ -111,6 +119,14 @@ public class RyTask {
111 119  
112 120 public void getCarPlate() {
113 121 System.out.println("获取车辆自编号");
  122 + DefaultWebSecurityManager manager = new DefaultWebSecurityManager();
  123 + ThreadContext.bind(manager);
114 124 lineService.getCarPlate();
115 125 }
  126 +
  127 + public void updateSysDept(){
  128 + DefaultWebSecurityManager manager = new DefaultWebSecurityManager();
  129 + ThreadContext.bind(manager);
  130 + deptService.updateSysDept();
  131 + }
116 132 }
... ...
bsthLineProfiles/src/main/java/com/ruoyi/project/system/dept/controller/DeptController.java
1 1 package com.ruoyi.project.system.dept.controller;
2 2  
3 3 import java.util.List;
  4 +
  5 +import cn.hutool.http.Header;
  6 +import cn.hutool.http.HttpRequest;
  7 +import com.alibaba.fastjson.JSON;
  8 +import com.alibaba.fastjson.JSONArray;
  9 +import com.alibaba.fastjson.JSONObject;
4 10 import org.apache.shiro.authz.annotation.RequiresPermissions;
5 11 import org.springframework.beans.factory.annotation.Autowired;
6 12 import org.springframework.stereotype.Controller;
... ... @@ -197,4 +203,8 @@ public class DeptController extends BaseController
197 203 List<Ztree> ztrees = deptService.roleDeptTreeData(role);
198 204 return ztrees;
199 205 }
  206 +
  207 +
  208 +
  209 +
200 210 }
... ...
bsthLineProfiles/src/main/java/com/ruoyi/project/system/dept/domain/Dept.java
... ... @@ -47,6 +47,9 @@ public class Dept extends BaseEntity
47 47 /** 父部门名称 */
48 48 private String parentName;
49 49  
  50 + private String code;
  51 +
  52 + private String id;
50 53 public Long getDeptId()
51 54 {
52 55 return deptId;
... ... @@ -163,6 +166,22 @@ public class Dept extends BaseEntity
163 166 this.parentName = parentName;
164 167 }
165 168  
  169 + public String getCode() {
  170 + return code;
  171 + }
  172 +
  173 + public void setCode(String code) {
  174 + this.code = code;
  175 + }
  176 +
  177 + public String getId() {
  178 + return id;
  179 + }
  180 +
  181 + public void setId(String id) {
  182 + this.id = id;
  183 + }
  184 +
166 185 @Override
167 186 public String toString() {
168 187 return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
... ...
bsthLineProfiles/src/main/java/com/ruoyi/project/system/dept/mapper/DeptMapper.java
... ... @@ -114,4 +114,6 @@ public interface DeptMapper
114 114 * @return 子部门数
115 115 */
116 116 public int selectNormalChildrenDeptById(Long deptId);
  117 +
  118 + public Dept selectDeptByCode(@Param("code") String code);
117 119 }
... ...
bsthLineProfiles/src/main/java/com/ruoyi/project/system/dept/service/DeptServiceImpl.java
... ... @@ -3,6 +3,13 @@ package com.ruoyi.project.system.dept.service;
3 3 import java.util.ArrayList;
4 4 import java.util.Iterator;
5 5 import java.util.List;
  6 +
  7 +import cn.hutool.http.Header;
  8 +import cn.hutool.http.HttpRequest;
  9 +import com.alibaba.fastjson.JSON;
  10 +import com.alibaba.fastjson.JSONArray;
  11 +import com.alibaba.fastjson.JSONObject;
  12 +import com.ruoyi.project.system.user.domain.User;
6 13 import org.apache.commons.lang3.ArrayUtils;
7 14 import org.springframework.beans.factory.annotation.Autowired;
8 15 import org.springframework.stereotype.Service;
... ... @@ -58,8 +65,7 @@ public class DeptServiceImpl implements IDeptService
58 65  
59 66 /**
60 67 * 查询部门管理树(排除下级)
61   - *
62   - * @param deptId 部门ID
  68 + *
63 69 * @return 所有部门信息
64 70 */
65 71 @Override
... ... @@ -201,7 +207,8 @@ public class DeptServiceImpl implements IDeptService
201 207 {
202 208 throw new BusinessException("部门停用,不允许新增");
203 209 }
204   - dept.setCreateBy(ShiroUtils.getLoginName());
  210 + String name=ShiroUtils.getSysUser()==null?"admin":ShiroUtils.getLoginName();
  211 + dept.setCreateBy(name);
205 212 dept.setAncestors(info.getAncestors() + "," + dept.getParentId());
206 213 return deptMapper.insertDept(dept);
207 214 }
... ... @@ -225,7 +232,8 @@ public class DeptServiceImpl implements IDeptService
225 232 dept.setAncestors(newAncestors);
226 233 updateDeptChildren(dept.getDeptId(), newAncestors, oldAncestors);
227 234 }
228   - dept.setUpdateBy(ShiroUtils.getLoginName());
  235 + String name=ShiroUtils.getSysUser()==null?"admin":ShiroUtils.getLoginName();
  236 + dept.setCreateBy(name);
229 237 int result = deptMapper.updateDept(dept);
230 238 if (UserConstants.DEPT_NORMAL.equals(dept.getStatus()))
231 239 {
... ... @@ -330,4 +338,77 @@ public class DeptServiceImpl implements IDeptService
330 338 }
331 339 return UserConstants.DEPT_NAME_UNIQUE;
332 340 }
  341 +
  342 + @Override
  343 + public Dept selectDeptByCode(String code) {
  344 + return deptMapper.selectDeptByCode(code);
  345 + }
  346 +
  347 + public void updateSysDept() {
  348 + //获取所有部门信息
  349 + JSONObject para = new JSONObject();
  350 + para.put("organizationId", "");
  351 + String deptStr = HttpRequest.post("http://180.169.154.251:8082/businessCenter/organizationInfo/queryOrgUserTreeList")
  352 + .header(Header.ACCEPT, "application/json").header("userName", "tuohua00001").
  353 + header("password", "8602daa59fdd3dcc648c206e334fc268").form(para)
  354 + .execute().body();
  355 + JSONObject jsonObject = JSON.parseObject(deptStr);
  356 + JSONArray dataArr = jsonObject.getJSONArray("data");
  357 + for (int i = 0; i < dataArr.size(); i++) {
  358 + Dept sysDept = this.selectDeptByCode(dataArr.getJSONObject(i).getString("code"));
  359 + this.updateDept(getSysDept(sysDept, dataArr.getJSONObject(i), dataArr.getJSONObject(i).getString("code"), 0, 0));
  360 + if (dataArr.getJSONObject(i).containsKey("children")) {
  361 + synchronousDeptData(dataArr.getJSONObject(i).getJSONArray("children"), 100);
  362 + }
  363 + }
  364 + }
  365 +
  366 + /**
  367 + * 同步部门数据
  368 + *
  369 + * @param parentId 父级id
  370 + * @param jsonArray
  371 + */
  372 + public void synchronousDeptData(JSONArray jsonArray, long parentId) {
  373 + for (int i = 0; i < jsonArray.size(); i++) {
  374 + JSONObject jsonObject = jsonArray.getJSONObject(i);
  375 + if (jsonObject.getString("code") == null) {
  376 + continue;
  377 + }
  378 + Dept sysDept = this.selectDeptByCode(jsonObject.getString("code"));
  379 + if (sysDept != null && sysDept.getDeptId() != null) {
  380 + this.updateDept(getSysDept(sysDept, jsonObject, jsonObject.getString("code"), i, parentId));
  381 + }
  382 + if (sysDept == null) {
  383 + sysDept = getSysDept(new Dept(), jsonObject, jsonObject.getString("code"), i, parentId);
  384 + this.insertDept(sysDept);
  385 + }
  386 + if (jsonObject.containsKey("children") && "1".equals(jsonObject.getString("type"))) {
  387 + synchronousDeptData(jsonObject.getJSONArray("children"), sysDept.getDeptId());
  388 + }
  389 + }
  390 + }
  391 +
  392 +
  393 + /**
  394 + * 获取新对象
  395 + *
  396 + * @param sysDept
  397 + * @param jsonObject
  398 + * @param order
  399 + * @param parentId
  400 + * @return
  401 + */
  402 + public Dept getSysDept(Dept sysDept, JSONObject jsonObject, String code, int order, long parentId) {
  403 + sysDept.setCode(code);
  404 + sysDept.setDeptName(jsonObject.getString("label"));
  405 + sysDept.setOrderNum(String.valueOf(order));
  406 + sysDept.setStatus("0");
  407 + sysDept.setDelFlag("0");
  408 + sysDept.setParentId(parentId);
  409 + sysDept.setUpdateBy(" ");
  410 + sysDept.setId(jsonObject.getString("id"));
  411 + return sysDept;
  412 + }
  413 +
333 414 }
... ...
bsthLineProfiles/src/main/java/com/ruoyi/project/system/dept/service/IDeptService.java
... ... @@ -107,4 +107,13 @@ public interface IDeptService
107 107 * @return 结果
108 108 */
109 109 public String checkDeptNameUnique(Dept dept);
  110 +
  111 + /**
  112 + * 根据Code查询
  113 + * @param code
  114 + * @return
  115 + */
  116 + public Dept selectDeptByCode(String code);
  117 +
  118 + void updateSysDept();
110 119 }
... ...
bsthLineProfiles/src/main/java/com/ruoyi/project/system/line/controller/BsthTLineAddController.java
... ... @@ -10,6 +10,7 @@ import com.ruoyi.framework.web.page.TableDataInfo;
10 10 import com.ruoyi.project.system.dict.domain.DictData;
11 11 import com.ruoyi.project.system.dict.service.IDictDataService;
12 12 import com.ruoyi.project.system.line.domain.BsthTLine;
  13 +import com.ruoyi.project.system.line.domain.Company;
13 14 import com.ruoyi.project.system.line.service.IBsthTLineService;
14 15 import com.ruoyi.project.system.user.domain.User;
15 16 import com.ruoyi.project.system.user.service.IUserService;
... ... @@ -59,7 +60,7 @@ public class BsthTLineAddController extends BaseController
59 60 {
60 61  
61 62 ModelAndView mv=new ModelAndView(prefix + "/line");
62   - List<Map> companyList=bsthTLineService.selectCompany();
  63 + List<Company> companyList=bsthTLineService.selectCompany(new Company());
63 64 mv.addObject("companyList",companyList);
64 65 return mv;
65 66 }
... ... @@ -84,7 +85,7 @@ public class BsthTLineAddController extends BaseController
84 85 public ModelAndView add()
85 86 {
86 87 ModelAndView mv=new ModelAndView(prefix + "/add");
87   - List<Map> companyList=bsthTLineService.selectCompany();
  88 + List<Company> companyList=bsthTLineService.selectCompany(new Company());
88 89 mv.addObject("companyList",companyList);
89 90 return mv;
90 91 }
... ... @@ -129,7 +130,7 @@ public class BsthTLineAddController extends BaseController
129 130 public String edit(@PathVariable("id") Long id, ModelMap mmap)
130 131 {
131 132 BsthTLine bsthTLine = bsthTLineService.selectBsthTLineExamineById(id);
132   - List<Map> companyList=bsthTLineService.selectCompany();
  133 + List<Company> companyList=bsthTLineService.selectCompany(new Company());
133 134 mmap.put("companyList",companyList);
134 135 mmap.put("bsthTLine", bsthTLine);
135 136 return prefix + "/edit";
... ...
bsthLineProfiles/src/main/java/com/ruoyi/project/system/line/controller/BsthTLineController.java
... ... @@ -11,6 +11,7 @@ import com.ruoyi.project.system.dict.domain.DictData;
11 11 import com.ruoyi.project.system.dict.service.IDictDataService;
12 12 import com.ruoyi.project.system.line.domain.BsthTLine;
13 13 import com.ruoyi.project.system.line.domain.BsthTLineKFK;
  14 +import com.ruoyi.project.system.line.domain.Company;
14 15 import com.ruoyi.project.system.line.service.IBsthTLineService;
15 16 import com.ruoyi.project.system.user.domain.User;
16 17 import com.ruoyi.project.system.user.service.IUserService;
... ... @@ -58,7 +59,7 @@ public class BsthTLineController extends BaseController
58 59 public ModelAndView line()
59 60 {
60 61 ModelAndView mv=new ModelAndView(prefix + "/line");
61   - List<Map> companyList=bsthTLineService.selectCompany();
  62 + List<Company> companyList=bsthTLineService.selectCompany(new Company());
62 63 mv.addObject("companyList",companyList);
63 64 return mv;
64 65 }
... ... @@ -298,7 +299,7 @@ public class BsthTLineController extends BaseController
298 299 {
299 300 BsthTLine bsthTLine=new BsthTLine();
300 301 List<BsthTLine> list = bsthTLineService.selectBsthTLineList(bsthTLine);
301   - List<Map> companyList = bsthTLineService.selectCompany();
  302 + List<Company> companyList=bsthTLineService.selectCompany(new Company());
302 303 List<BsthTLineKFK> bsthTLineKFKS=new ArrayList<>();
303 304 for (BsthTLine tLine : list) {
304 305 BsthTLineKFK bsthTLineKFK=new BsthTLineKFK(tLine,companyList);
... ...
bsthLineProfiles/src/main/java/com/ruoyi/project/system/line/controller/BsthTLineExamineController.java
... ... @@ -9,6 +9,7 @@ import com.ruoyi.framework.web.page.TableDataInfo;
9 9  
10 10 import com.ruoyi.project.system.dict.service.IDictDataService;
11 11 import com.ruoyi.project.system.line.domain.BsthTLine;
  12 +import com.ruoyi.project.system.line.domain.Company;
12 13 import com.ruoyi.project.system.line.service.IBsthTLineService;
13 14  
14 15 import com.ruoyi.project.system.user.service.IUserService;
... ... @@ -51,7 +52,7 @@ public class BsthTLineExamineController extends BaseController
51 52 {
52 53  
53 54 ModelAndView mv=new ModelAndView(prefix + "/line");
54   - List<Map> companyList=bsthTLineService.selectCompany();
  55 + List<Company> companyList=bsthTLineService.selectCompany(new Company());
55 56 mv.addObject("companyList",companyList);
56 57 return mv;
57 58 }
... ... @@ -76,7 +77,7 @@ public class BsthTLineExamineController extends BaseController
76 77 {
77 78 BsthTLine bsthTLine = bsthTLineService.selectBsthTLineExamineById(id);
78 79 mmap.put("bsthTLine", bsthTLine);
79   - List<Map> companyList=bsthTLineService.selectCompany();
  80 + List<Company> companyList=bsthTLineService.selectCompany(new Company());
80 81 mmap.put("companyList",companyList);
81 82 return prefix + "/detail";
82 83 }
... ...
bsthLineProfiles/src/main/java/com/ruoyi/project/system/line/controller/BsthTLineHistoryController.java
... ... @@ -4,6 +4,7 @@ package com.ruoyi.project.system.line.controller;
4 4 import java.util.List;
5 5 import java.util.Map;
6 6  
  7 +import com.ruoyi.project.system.line.domain.Company;
7 8 import org.apache.shiro.authz.annotation.RequiresPermissions;
8 9 import org.springframework.beans.factory.annotation.Autowired;
9 10 import org.springframework.stereotype.Controller;
... ... @@ -55,7 +56,7 @@ public class BsthTLineHistoryController extends BaseController
55 56 {
56 57  
57 58 ModelAndView mv=new ModelAndView(prefix + "/line");
58   - List<Map> companyList=bsthTLineService.selectCompany();
  59 + List<Company> companyList=bsthTLineService.selectCompany(new Company());
59 60 mv.addObject("companyList",companyList);
60 61 return mv;
61 62 }
... ... @@ -89,7 +90,7 @@ public class BsthTLineHistoryController extends BaseController
89 90 boolean flag=bsthTLineService.selectHistoryByLineNameAndUpdateStatus(bsthTLine)!=null?true:false;
90 91 mmap.put("flag",flag);
91 92 mmap.put("bsthTLine", bsthTLine);
92   - List<Map> companyList=bsthTLineService.selectCompany();
  93 + List<Company> companyList=bsthTLineService.selectCompany(new Company());
93 94 mmap.put("companyList",companyList);
94 95 return prefix + "/edit";
95 96 }
... ...
bsthLineProfiles/src/main/java/com/ruoyi/project/system/line/domain/BsthTLineKFK.java
... ... @@ -193,7 +193,7 @@ public class BsthTLineKFK
193 193 public BsthTLineKFK(){
194 194  
195 195 }
196   - public BsthTLineKFK(BsthTLine bsthTLine, List<Map> companyList) {
  196 + public BsthTLineKFK(BsthTLine bsthTLine, List<Company> companyList) {
197 197 try {
198 198 Field[] fields=BsthTLineKFK.class.getDeclaredFields();
199 199 for(Field f : fields) {
... ... @@ -207,9 +207,9 @@ public class BsthTLineKFK
207 207 }
208 208 }
209 209 this.fCompany=bsthTLine.getfCompany();
210   - for (Map map : companyList) {
211   - String fc=map.get("fCompany").toString();
212   - String id=map.get("companyID").toString();
  210 + for (Company company : companyList) {
  211 + String fc=company.getfCompany();
  212 + String id=company.getCompanyID();
213 213 if (fc.equals(this.company+"本部")){
214 214 this.companyID=id;
215 215 }if(fc.equals(this.fCompany)){
... ...
bsthLineProfiles/src/main/java/com/ruoyi/project/system/line/mapper/BsthTLineMapper.java
... ... @@ -4,6 +4,7 @@ import java.util.List;
4 4 import java.util.Map;
5 5  
6 6 import com.ruoyi.project.system.line.domain.BsthTLine;
  7 +import com.ruoyi.project.system.line.domain.Company;
7 8 import com.ruoyi.project.system.line.domain.LineHistoryReport;
8 9 import org.apache.ibatis.annotations.Mapper;
9 10  
... ... @@ -68,7 +69,7 @@ public interface BsthTLineMapper
68 69 int deleteBsthTLineHistoryById(Long id);
69 70  
70 71  
71   - List<Map> selectCompany();
  72 + List<Company> selectCompany(Company company);
72 73  
73 74 List<BsthTLine> selectBsthTLineListAndExamine(BsthTLine bsthTLine);
74 75  
... ...
bsthLineProfiles/src/main/java/com/ruoyi/project/system/line/service/IBsthTLineService.java
... ... @@ -5,6 +5,7 @@ import java.util.Map;
5 5  
6 6 import com.ruoyi.project.system.line.domain.BsthTLine;
7 7 import com.ruoyi.project.system.line.domain.BsthTLineKFK;
  8 +import com.ruoyi.project.system.line.domain.Company;
8 9 import com.ruoyi.project.system.line.domain.LineHistoryReport;
9 10  
10 11 /**
... ... @@ -58,7 +59,7 @@ public interface IBsthTLineService
58 59  
59 60 int deleteBsthTLineHistoryById(Long id);
60 61  
61   - List<Map> selectCompany();
  62 + List<Company> selectCompany(Company company);
62 63  
63 64 boolean lineNameIsExistInBsthTLine(String lineName);
64 65  
... ...
bsthLineProfiles/src/main/java/com/ruoyi/project/system/line/service/impl/BsthTLineServiceImpl.java
... ... @@ -10,9 +10,11 @@ import cn.hutool.json.JSON;
10 10 import com.alibaba.fastjson.JSONArray;
11 11 import com.alibaba.fastjson.JSONObject;
12 12 import com.ruoyi.common.utils.security.ShiroUtils;
  13 +import com.ruoyi.framework.aspectj.lang.annotation.DataScope;
13 14 import com.ruoyi.project.system.dict.domain.DictData;
14 15 import com.ruoyi.project.system.dict.service.IDictDataService;
15 16 import com.ruoyi.project.system.line.domain.BsthTLineKFK;
  17 +import com.ruoyi.project.system.line.domain.Company;
16 18 import com.ruoyi.project.system.line.domain.LineHistoryReport;
17 19 import com.ruoyi.project.system.user.domain.User;
18 20 import org.slf4j.Logger;
... ... @@ -69,6 +71,7 @@ public class BsthTLineServiceImpl implements IBsthTLineService
69 71 * @return 【请填写功能名称】
70 72 */
71 73 @Override
  74 + @DataScope(deptAlias = "b")
72 75 public List<BsthTLine> selectBsthTLineList(BsthTLine bsthTLine)
73 76 {
74 77 return bsthTLineMapper.selectBsthTLineList(bsthTLine);
... ... @@ -91,6 +94,7 @@ public class BsthTLineServiceImpl implements IBsthTLineService
91 94  
92 95  
93 96 @Override
  97 + @DataScope(deptAlias = "b")
94 98 public List<BsthTLine> selectBsthTLineHistoryList(BsthTLine bsthTLine) {
95 99 return bsthTLineMapper.selectBsthTLineHistoryList(bsthTLine);
96 100 }
... ... @@ -135,6 +139,7 @@ public class BsthTLineServiceImpl implements IBsthTLineService
135 139  
136 140  
137 141 @Override
  142 + @DataScope(deptAlias = "b")
138 143 public List<BsthTLine> selectBsthTLineExamineList(BsthTLine bsthTLine)
139 144 {
140 145 return bsthTLineMapper.selectBsthTLineExamineList(bsthTLine);
... ... @@ -186,7 +191,7 @@ public class BsthTLineServiceImpl implements IBsthTLineService
186 191 bsthTLineMapper.deleteBsthTLineExamineById(new String[]{bsthTLine.getId().toString()});
187 192  
188 193 //kafka
189   - List<Map> companyList=this.selectCompany();
  194 + List<Company> companyList=this.selectCompany(new Company());
190 195 BsthTLineKFK bsthTLineKFK=new BsthTLineKFK(bl,companyList);
191 196 bsthTLineKFK.setOperationType("insert");
192 197 this.sendKFK(bsthTLineKFK);
... ... @@ -228,7 +233,7 @@ public class BsthTLineServiceImpl implements IBsthTLineService
228 233 //删除审核表记录
229 234 bsthTLineMapper.deleteBsthTLineExamineById(new String[]{String.valueOf(id)});
230 235 //kafka
231   - List<Map> companyList=this.selectCompany();
  236 + List<Company> companyList=this.selectCompany(new Company());
232 237 BsthTLineKFK bsthTLineKFK=new BsthTLineKFK(bl,companyList);
233 238 bsthTLineKFK.setOperationType("update");
234 239 this.sendKFK(bsthTLineKFK);
... ... @@ -272,8 +277,9 @@ public class BsthTLineServiceImpl implements IBsthTLineService
272 277 }
273 278  
274 279 @Override
275   - public List<Map> selectCompany(){
276   - return bsthTLineMapper.selectCompany();
  280 + @DataScope(deptAlias = "c")
  281 + public List<Company> selectCompany(Company company){
  282 + return bsthTLineMapper.selectCompany(company);
277 283 }
278 284  
279 285 public static Date initDateByDay(){
... ...
bsthLineProfiles/src/main/java/com/ruoyi/project/system/user/controller/LoginController.java
... ... @@ -5,6 +5,8 @@ import java.util.*;
5 5 import javax.servlet.http.HttpServletRequest;
6 6 import javax.servlet.http.HttpServletResponse;
7 7  
  8 +import cn.hutool.http.Header;
  9 +import cn.hutool.http.HttpRequest;
8 10 import com.ruoyi.common.utils.security.ShiroUtils;
9 11 import com.ruoyi.project.system.user.service.IUserService;
10 12 import com.ruoyi.project.system.user.service.UserServiceImpl;
... ... @@ -100,7 +102,7 @@ public class LoginController extends BaseController
100 102  
101 103  
102 104 JSONObject dataJson = jsonObject.getJSONObject("data");
103   -
  105 + System.out.println(dataJson);
104 106 Assert.notNull(dataJson, "获取用户信息异常");
105 107  
106 108  
... ... @@ -127,7 +129,7 @@ public class LoginController extends BaseController
127 129  
128 130  
129 131  
130   - login("bus123","bus123",false);
  132 + login("admin","admin123",false);
131 133 user = getSysUser();
132 134 user.setToken(token);
133 135 // user.setPermissions(permissionService.getMenuPermission());
... ... @@ -270,4 +272,7 @@ public class LoginController extends BaseController
270 272 {
271 273 return "error/unauth";
272 274 }
  275 +
  276 +
  277 +
273 278 }
... ...
bsthLineProfiles/src/main/resources/mybatis/mybatis/system/BsthTLineMapper.xml
... ... @@ -78,32 +78,16 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot;
78 78 </resultMap>
79 79  
80 80  
81   - <!--<resultMap type="LineEditReport" id="LineEditReportResult">
82   - <result property="id" column="id" />
83   - <result property="lineName" column="line_name" />
84   - <result property="company" column="company" />
85   - <result property="lineDistance" column="line_distance" />
86   - <result property="vehiclesNumber" column="vehicles_number" />
87   - <result property="numberPerson" column="number_person" />
88   - <result property="lineDistanceBefore" column="line_distance_before" />
89   - <result property="vehiclesNumberBefore" column="vehicles_number_before" />
90   - <result property="numberPersonBefore" column="number_person_before" />
91   - <result property="createTime" column="create_time" />
92   - <result property="lineUpdateType" column="line_update_type" />
93   - <result property="files" column="files" />
94   - </resultMap>
95   --->
96   -
97 81 <sql id="selectBsthTLineVo">
98   - select * from bsth_t_line
  82 + select * from bsth_t_line b
99 83 </sql>
100 84  
101 85 <sql id="selectBsthTLineExamineVo">
102   - select * from bsth_t_line_examine
  86 + select * from bsth_t_line_examine b
103 87 </sql>
104 88  
105 89 <sql id="selectBsthTLineHistoryVo">
106   - select * from bsth_t_line_history
  90 + select * from bsth_t_line_history b
107 91 </sql>
108 92  
109 93 <select id="selectBsthTLineList" parameterType="BsthTLine" resultMap="BsthTLineResult">
... ... @@ -171,7 +155,7 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot;
171 155 <if test="lineUpdateType != null and lineUpdateType != ''"> and line_update_type= #{lineUpdateType}</if>
172 156 <if test="revenueType != null and revenueType != ''"> and revenue_type= #{revenueType}</if>
173 157 <if test="createTimeEnd != null and createTimeEnd != ''"> and create_time &lt;= #{createTimeEnd}</if>
174   -
  158 + ${params.dataScope}
175 159 </where>
176 160 order by id desc
177 161 </select>
... ... @@ -547,6 +531,7 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot;
547 531 <if test="examineType != null and examineType != ''"> and examine_type = #{examineType}</if>
548 532 <if test="createTimeStr != null and createTimeStr != ''"> and create_time >= #{createTimeStr}</if>
549 533 <if test="createTimeEnd != null and createTimeEnd != ''"> and create_time &lt;= #{createTimeEnd}</if>
  534 + ${params.dataScope}
550 535 </where>
551 536 order by id desc
552 537 </select>
... ... @@ -861,6 +846,7 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot;
861 846 <if test="historyId != null and historyId != ''"> and history_id is not null</if>
862 847 <if test="updateStatus != null and updateStatus != ''"> and update_status #{updateStatus}</if>
863 848 <if test="lineUpdateType != null and lineUpdateType != ''"> and line_update_type =#{lineUpdateType}</if>
  849 + ${params.dataScope}
864 850 </where>
865 851 order by id desc
866 852 </select>
... ... @@ -1312,8 +1298,11 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot;
1312 1298 delete from bsth_t_line_history where id=#{id}
1313 1299 </delete>
1314 1300  
1315   - <select id="selectCompany" resultType="map">
1316   - select * from bsth_company
  1301 + <select id="selectCompany" parameterType="com.ruoyi.project.system.line.domain.Company" resultType="com.ruoyi.project.system.line.domain.Company">
  1302 + select * from bsth_company c
  1303 + <where>
  1304 + ${params.dataScope}
  1305 + </where>
1317 1306 </select>
1318 1307  
1319 1308  
... ...
bsthLineProfiles/src/main/resources/mybatis/system/DeptMapper.xml
... ... @@ -6,6 +6,8 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot;
6 6  
7 7 <resultMap type="Dept" id="DeptResult">
8 8 <id property="deptId" column="dept_id" />
  9 + <result property="code" column="code" />
  10 + <result property="id" column="id" />
9 11 <result property="parentId" column="parent_id" />
10 12 <result property="ancestors" column="ancestors" />
11 13 <result property="deptName" column="dept_name" />
... ... @@ -23,7 +25,7 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot;
23 25 </resultMap>
24 26  
25 27 <sql id="selectDeptVo">
26   - select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.phone, d.email, d.status, d.del_flag, d.create_by, d.create_time
  28 + select d.dept_id,d.code,d.id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.phone, d.email, d.status, d.del_flag, d.create_by, d.create_time
27 29 from sys_dept d
28 30 </sql>
29 31  
... ... @@ -41,6 +43,12 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot;
41 43 <if test="parentId != null and parentId != 0">
42 44 AND parent_id = #{parentId}
43 45 </if>
  46 + <if test="code != null and code != ''">
  47 + AND code = #{code}
  48 + </if>
  49 + <if test="id != null and id != ''">
  50 + AND id = #{id}
  51 + </if>
44 52 <if test="deptName != null and deptName != ''">
45 53 AND dept_name like concat('%', #{deptName}, '%')
46 54 </if>
... ... @@ -69,10 +77,8 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot;
69 77 </select>
70 78  
71 79 <select id="selectDeptById" parameterType="Long" resultMap="DeptResult">
72   - select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.phone, d.email, d.status,
73   - (select dept_name from sys_dept where dept_id = d.parent_id) parent_name
74   - from sys_dept d
75   - where d.dept_id = #{deptId}
  80 + <include refid="selectDeptVo"/>
  81 + where dept_id = #{deptId}
76 82 </select>
77 83  
78 84 <select id="selectChildrenDeptById" parameterType="Long" resultMap="DeptResult">
... ... @@ -83,7 +89,7 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot;
83 89 select count(*) from sys_dept where status = 0 and del_flag = '0' and find_in_set(#{deptId}, ancestors)
84 90 </select>
85 91  
86   - <insert id="insertDept" parameterType="Dept">
  92 + <insert id="insertDept" parameterType="Dept" useGeneratedKeys="true" keyProperty="deptId">
87 93 insert into sys_dept(
88 94 <if test="deptId != null and deptId != 0">dept_id,</if>
89 95 <if test="parentId != null and parentId != 0">parent_id,</if>
... ... @@ -95,6 +101,8 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot;
95 101 <if test="email != null and email != ''">email,</if>
96 102 <if test="status != null">status,</if>
97 103 <if test="createBy != null and createBy != ''">create_by,</if>
  104 + <if test="code != null and code != ''">code,</if>
  105 + <if test="id != null and id != ''">id,</if>
98 106 create_time
99 107 )values(
100 108 <if test="deptId != null and deptId != 0">#{deptId},</if>
... ... @@ -107,6 +115,8 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot;
107 115 <if test="email != null and email != ''">#{email},</if>
108 116 <if test="status != null">#{status},</if>
109 117 <if test="createBy != null and createBy != ''">#{createBy},</if>
  118 + <if test="code != null and code != ''">#{code},</if>
  119 + <if test="id != null and id != ''">#{id},</if>
110 120 sysdate()
111 121 )
112 122 </insert>
... ... @@ -123,6 +133,8 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot;
123 133 <if test="email != null">email = #{email},</if>
124 134 <if test="status != null and status != ''">status = #{status},</if>
125 135 <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
  136 + <if test="code != null and code != ''">code = #{code},</if>
  137 + <if test="id != null and id != ''">id = #{id},</if>
126 138 update_time = sysdate()
127 139 </set>
128 140 where dept_id = #{deptId}
... ... @@ -155,4 +167,9 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot;
155 167 where dept_id in (${ancestors})
156 168 </update>
157 169  
  170 + <select id="selectDeptByCode" parameterType="String" resultMap="DeptResult">
  171 + <include refid="selectDeptVo"/>
  172 + where d.code = #{code}
  173 + </select>
  174 +
158 175 </mapper>
159 176 \ No newline at end of file
... ...