1550076451 лет назад: 2
Родитель
Сommit
335bf659aa

+ 8 - 3
zxkf-api/src/main/java/api/controller/IndexController.java

@@ -7,6 +7,7 @@ import api.entity.database.order.HourReport;
7 7
 import api.entity.database.order.Report;
8 8
 import api.entity.database.order.WorkOrderBase;
9 9
 
10
+import api.entity.database.system.User;
10 11
 import api.service.call.IRecordService;
11 12
 import api.service.online.IMessageService;
12 13
 import api.service.order.IReportBaseService;
@@ -14,18 +15,21 @@ import api.service.order.IWorkOrderBaseService;
14 15
 import api.service.system.*;
15 16
 import api.util.annotation.Anonymous;
16 17
 
18
+import api.util.annotation.Log;
19
+import api.util.enums.BusinessType;
20
+import api.util.helper.SecretHelper;
21
+import api.util.helper.StringHelper;
17 22
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
18 23
 import api.entity.database.system.Dept;
19 24
 import api.entity.database.system.Menu;
20 25
 import api.entity.view.system.UserView;
21 26
 import api.model.AjaxResult;
22 27
 
28
+import io.swagger.annotations.ApiOperation;
23 29
 import lombok.var;
24 30
 import org.springframework.beans.factory.annotation.Autowired;
25 31
 import org.springframework.format.annotation.DateTimeFormat;
26
-import org.springframework.web.bind.annotation.GetMapping;
27
-import org.springframework.web.bind.annotation.RequestMapping;
28
-import org.springframework.web.bind.annotation.RestController;
32
+import org.springframework.web.bind.annotation.*;
29 33
 
30 34
 
31 35
 import java.text.SimpleDateFormat;
@@ -349,4 +353,5 @@ public class IndexController extends BaseController {
349 353
 
350 354
     }
351 355
 
356
+
352 357
 }

+ 2 - 0
zxkf-api/src/main/java/api/controller/system/CustomerController.java

@@ -49,6 +49,7 @@ public class CustomerController extends BaseController {
49 49
         qw.eq(input.getCustomerId() != null && input.getCustomerId() > 0, Customer::getCustomerId, input.getCustomerId());
50 50
         qw.like(!StringHelper.isEmpty(input.getCustomerName()), Customer::getCustomerName, input.getCustomerName());
51 51
         qw.eq(!StringHelper.isEmpty(input.getCustomerSex()), Customer::getCustomerSex, input.getCustomerSex());
52
+        qw.eq(!StringHelper.isEmpty(input.getLabel()), Customer::getLabel, input.getLabel());
52 53
         qw.like(!StringHelper.isEmpty(input.getCustomerPhone()), Customer::getCustomerPhone, input.getCustomerPhone());
53 54
         qw.like(!StringHelper.isEmpty(input.getCustomerMobile()), Customer::getCustomerMobile, input.getCustomerMobile());
54 55
         qw.like(!StringHelper.isEmpty(input.getCustomerNumber()), Customer::getCustomerNumber, input.getCustomerNumber());
@@ -93,6 +94,7 @@ public class CustomerController extends BaseController {
93 94
         qw.like(!StringHelper.isEmpty(input.getCustomerPhone()), Customer::getCustomerPhone, input.getCustomerPhone());
94 95
         qw.like(!StringHelper.isEmpty(input.getCustomerMobile()), Customer::getCustomerMobile, input.getCustomerMobile());
95 96
         qw.like(!StringHelper.isEmpty(input.getCustomerNumber()), Customer::getCustomerNumber, input.getCustomerNumber());
97
+        qw.eq(!StringHelper.isEmpty(input.getLabel()), Customer::getLabel, input.getLabel());
96 98
         qw.like(!StringHelper.isEmpty(input.getRemarks()), Customer::getRemarks, input.getRemarks());
97 99
         qw.eq(Customer::getFIsdelete, 0);
98 100
         qw.eq(input.getFCreatetime() != null , Customer::getFCreatetime, input.getFCreatetime());

+ 13 - 0
zxkf-api/src/main/java/api/controller/system/UserController.java

@@ -1,5 +1,6 @@
1 1
 package api.controller.system;
2 2
 
3
+import api.util.annotation.Anonymous;
3 4
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
4 5
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
5 6
 import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -86,6 +87,14 @@ public class UserController extends BaseController {
86 87
         } else if (StringHelper.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(user)) {
87 88
             return Error("新增用户'" + user.getUserName() + "'失败,邮箱账号已存在");
88 89
         }
90
+        if (StringHelper.isEmpty(user.getPassword()))
91
+            return Error("请输入密码");
92
+        if (StringHelper.isEmpty(user.getUserName()))
93
+            return Error("请输入姓名");
94
+        if (StringHelper.isEmpty(user.getNickName()))
95
+            return Error("请输入工号");
96
+        if (StringHelper.isEmpty(user.getStatus()))
97
+            return Error("请选择状态");
89 98
         user.setPassword(SecretHelper.MD5(user.getPassword()));
90 99
         user.setCreateBy(CurrentUser().getUserName());
91 100
         user.setCreateTime(new Date());
@@ -110,6 +119,10 @@ public class UserController extends BaseController {
110 119
         } else if (StringHelper.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(user)) {
111 120
             return Error("修改用户'" + user.getUserName() + "'失败,邮箱账号已存在");
112 121
         }
122
+        User use = userService.selectUserById(user.getUserId());
123
+        if (use==null)
124
+            return Error("用户不存在");
125
+        user.setPassword(use.getPassword());
113 126
         user.setCreateBy(CurrentUser().getUserName());
114 127
         user.setCreateTime(new Date());
115 128
         boolean result = userService.update(user);

+ 4 - 0
zxkf-entity/src/main/java/api/entity/database/system/Customer.java

@@ -129,4 +129,8 @@ public class Customer {
129 129
     @ApiModelProperty("项目id")
130 130
     private Long project;
131 131
 
132
+    @ApiModelProperty("标签")
133
+    private String  label;
134
+
135
+
132 136
 }

+ 13 - 0
zxkf-service/src/main/java/api/service/system/impl/RoleServiceImpl.java

@@ -1,5 +1,7 @@
1 1
 package api.service.system.impl;
2 2
 
3
+import api.util.helper.RedisHelper;
4
+import api.util.helper.SpringHelper;
3 5
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
4 6
 import api.entity.database.system.Role;
5 7
 import api.entity.database.system.RoleDept;
@@ -12,6 +14,8 @@ import api.mapper.system.UserRoleMapper;
12 14
 import api.service.BaseServiceImpl;
13 15
 import api.service.system.IRoleService;
14 16
 import api.util.helper.StringHelper;
17
+import net.bytebuddy.asm.Advice;
18
+import org.apache.poi.ss.formula.functions.T;
15 19
 import org.springframework.beans.factory.annotation.Autowired;
16 20
 import org.springframework.stereotype.Service;
17 21
 import org.springframework.transaction.annotation.Transactional;
@@ -85,6 +89,7 @@ public class RoleServiceImpl extends BaseServiceImpl<RoleMapper, Role> implement
85 89
         this.update(role);
86 90
         // 删除角色与菜单关联
87 91
         roleMenuMapper.deleteRoleMenuByRoleId(role.getRoleId());
92
+        removeCache("RoleMenu");
88 93
         return insertRoleMenu(role)>0;
89 94
     }
90 95
     /**
@@ -285,4 +290,12 @@ public class RoleServiceImpl extends BaseServiceImpl<RoleMapper, Role> implement
285 290
         }
286 291
         return roles;
287 292
     }
293
+
294
+    private boolean removeCache( String clsName) {
295
+        RedisHelper redisHelper = SpringHelper.getBean(RedisHelper.class);
296
+        if (redisHelper.hasKey("database:"+clsName)) {
297
+            return redisHelper.deleteCache("database:"+clsName);
298
+        }
299
+        return true;
300
+    }
288 301
 }