|
@@ -17,6 +17,7 @@ import org.apache.shiro.SecurityUtils;
|
|
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
|
|
import org.apache.shiro.authz.annotation.RequiresRoles;
|
|
|
import org.jeecg.common.api.vo.Result;
|
|
|
+import org.jeecg.common.aspect.annotation.AutoLog;
|
|
|
import org.jeecg.common.constant.CommonConstant;
|
|
|
import org.jeecg.common.system.api.ISysBaseAPI;
|
|
|
import org.jeecg.common.system.query.QueryGenerator;
|
|
@@ -25,16 +26,11 @@ import org.jeecg.common.system.vo.LoginUser;
|
|
|
import org.jeecg.common.util.PasswordUtil;
|
|
|
import org.jeecg.common.util.RedisUtil;
|
|
|
import org.jeecg.common.util.oConvertUtils;
|
|
|
-import org.jeecg.modules.system.entity.SysDepart;
|
|
|
-import org.jeecg.modules.system.entity.SysUser;
|
|
|
-import org.jeecg.modules.system.entity.SysUserDepart;
|
|
|
-import org.jeecg.modules.system.entity.SysUserRole;
|
|
|
+import org.jeecg.modules.system.entity.*;
|
|
|
import org.jeecg.modules.system.model.DepartIdModel;
|
|
|
import org.jeecg.modules.system.model.SysUserSysDepartModel;
|
|
|
-import org.jeecg.modules.system.service.ISysDepartService;
|
|
|
-import org.jeecg.modules.system.service.ISysUserDepartService;
|
|
|
-import org.jeecg.modules.system.service.ISysUserRoleService;
|
|
|
-import org.jeecg.modules.system.service.ISysUserService;
|
|
|
+import org.jeecg.modules.system.service.*;
|
|
|
+import org.jeecg.modules.system.util.MyThread;
|
|
|
import org.jeecg.modules.system.vo.SysDepartUsersVO;
|
|
|
import org.jeecg.modules.system.vo.SysUserRoleVO;
|
|
|
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
|
@@ -51,6 +47,7 @@ import org.springframework.web.servlet.ModelAndView;
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
import java.io.IOException;
|
|
|
+import java.text.ParseException;
|
|
|
import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
@@ -68,8 +65,10 @@ import java.util.stream.Collectors;
|
|
|
public class SysUserController {
|
|
|
@Autowired
|
|
|
private ISysBaseAPI sysBaseAPI;
|
|
|
-
|
|
|
- @Autowired
|
|
|
+ @Autowired
|
|
|
+ private ISysPositionService sysPositionService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
private ISysUserService sysUserService;
|
|
|
|
|
|
@Autowired
|
|
@@ -112,7 +111,9 @@ public class SysUserController {
|
|
|
}
|
|
|
result.setSuccess(true);
|
|
|
result.setResult(pageList);
|
|
|
- log.info(pageList.toString());
|
|
|
+
|
|
|
+
|
|
|
+ log.info(pageList.toString());
|
|
|
return result;
|
|
|
}
|
|
|
|
|
@@ -133,6 +134,10 @@ public class SysUserController {
|
|
|
user.setDelFlag("0");
|
|
|
sysUserService.addUserWithRole(user, selectedRoles);
|
|
|
sysUserService.addUserWithDepart(user, selectedDeparts);
|
|
|
+
|
|
|
+ MyThread mt = new MyThread(user);
|
|
|
+ mt.start();
|
|
|
+
|
|
|
result.success("添加成功!");
|
|
|
} catch (Exception e) {
|
|
|
log.error(e.getMessage(), e);
|
|
@@ -407,6 +412,27 @@ public class SysUserController {
|
|
|
}
|
|
|
//update-end--Author:kangxiaolin Date:20180825 for:[03]用户导出,如果选择数据则只导出相关数据----------------------
|
|
|
List<SysUser> pageList = sysUserService.list(queryWrapper);
|
|
|
+ List<SysPosition> list2 = sysPositionService.list();
|
|
|
+ Map<String,String> map = new HashMap<>();
|
|
|
+ for(SysPosition o:list2){
|
|
|
+ map.put(o.getCode(),o.getName());
|
|
|
+ }
|
|
|
+ for(SysUser o:pageList){
|
|
|
+ if(StringUtils.isNotBlank(o.getIfOa()) && o.getIfOa().equals("1")){
|
|
|
+ o.setIfOa("是");
|
|
|
+ }else{
|
|
|
+ o.setIfOa("否");
|
|
|
+ }
|
|
|
+ if(StringUtils.isNotBlank(o.getNMarriage()) && o.getNMarriage().equals("1")){
|
|
|
+ o.setNMarriage("是");
|
|
|
+ }
|
|
|
+ if(StringUtils.isNotBlank(o.getNMarriage()) && o.getNMarriage().equals("0")){
|
|
|
+ o.setNMarriage("否");
|
|
|
+ }
|
|
|
+ if(StringUtils.isNotBlank(o.getPost()) && map.containsKey(o.getPost())){
|
|
|
+ o.setPost(map.get(o.getPost()));
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
//导出文件名称
|
|
|
mv.addObject(NormalExcelConstants.FILE_NAME, "用户列表");
|
|
@@ -1206,4 +1232,20 @@ public class SysUserController {
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
+ @AutoLog(value = "变更社保/公积金基数")
|
|
|
+ @RequestMapping(value = "/updateUserBatch", method = RequestMethod.PUT)
|
|
|
+ public Result<?> handleInfo(@RequestBody JSONObject jsonObject) throws ParseException {
|
|
|
+ String ids = jsonObject.getString("ids");
|
|
|
+ String gongJiJin = jsonObject.getString("gongJiJin");
|
|
|
+ String sheBao = jsonObject.getString("sheBao");
|
|
|
+
|
|
|
+ String[] idList = ids.split(",");
|
|
|
+ if(idList.length > 0){
|
|
|
+ for(String o:idList){
|
|
|
+ sysUserService.updateUserBatch(o,Double.valueOf(gongJiJin),Double.valueOf(sheBao));
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return Result.ok("OK");
|
|
|
+ }
|
|
|
}
|