From f0420251442ac6f7bfb6beafa37ad045b4f6478a Mon Sep 17 00:00:00 2001
From: 廖井涛 <2265517004@qq.com>
Date: 星期三, 31 十二月 2025 15:49:05 +0800
Subject: [PATCH] 报工多工序,用户多工序修改
---
north-glass-erp/src/main/java/com/example/erp/service/userInfo/UserService.java | 36 ++++++++++++++++++++++++++++++++++--
1 files changed, 34 insertions(+), 2 deletions(-)
diff --git a/north-glass-erp/src/main/java/com/example/erp/service/userInfo/UserService.java b/north-glass-erp/src/main/java/com/example/erp/service/userInfo/UserService.java
index 1127965..ebcb818 100644
--- a/north-glass-erp/src/main/java/com/example/erp/service/userInfo/UserService.java
+++ b/north-glass-erp/src/main/java/com/example/erp/service/userInfo/UserService.java
@@ -5,11 +5,13 @@
import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.example.erp.controller.dto.UserDTO;
+import com.example.erp.entity.userInfo.Log;
import com.example.erp.entity.userInfo.Role;
import com.example.erp.entity.userInfo.User;
import com.example.erp.mapper.pp.ProductionSchedulingMapper;
import com.example.erp.mapper.userInfo.*;
import com.example.erp.tools.TokenTools;
+import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
@@ -27,6 +29,9 @@
private final PermissionRoleMapper permissionRoleMapper;
private final ProductionSchedulingMapper productionSchedulingMapper;
+
+ @Autowired
+ LogService logService;
public UserService(UserMapper userMapper, RoleMapper roleMapper, PermissionRoleMapper permissionRoleMapper, UserRoleMapper userRoleMapper, ProductionSchedulingMapper productionSchedulingMapper) {
this.userMapper = userMapper;
@@ -142,6 +147,13 @@
userDTO.setToken(StpUtil.getTokenValue());
Boolean userIsAdmin= userRoleMapper.getUserIsAdmin(user.getId());
userDTO.setPermissions(permissionRoleMapper.getUserEditPermission(user.getId(),userIsAdmin));
+
+ Log log = new Log();
+ log.setOperator(user.getUserName());
+ log.setOperatorId(userDTO.getUserId());
+ log.setContent(userDTO.toString());
+ log.setFunction("鐢ㄦ埛鐧诲綍");
+ logService.saveLog(log);
return userDTO;
}else{
return null;
@@ -186,8 +198,12 @@
return map;
}
- public Boolean updateProcessSv(Integer id, String process) {
- return userMapper.updateProcessMp(id,process);
+ public Boolean updateProcessSv(Integer id, Map<String, String> process) {
+ String processList=null;
+ if(!Objects.equals(process.get("processList"), "")){
+ processList=process.get("processList");
+ }
+ return userMapper.updateProcessMp(id, processList);
}
public Object findByAddress(Map<String,String> userName) {
@@ -207,5 +223,21 @@
map.put("users", Collections.singletonList(userList));
return map;
}
+
+ public Object getUserLog() {
+ Map<String, Object> map = new HashMap<>();
+ map.put("data", userMapper.getUserLog());
+ return map;
+ }
+
+
+//鏌ヨ鐢ㄦ埛浼樺寲鍙傛暟
+public String getOptimizeParms(String username) {
+ // 鑾峰彇褰撳墠鐧诲綍鐢ㄦ埛
+
+ return userMapper.selectOptimizeParmsById(username);
+ }
+
}
+
--
Gitblit v1.8.0