福利、签字
This commit is contained in:
+17
@@ -16,6 +16,8 @@ import io.v.nutz.base.utils.ViTool;
|
||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||
import org.apache.commons.lang.ArrayUtils;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.apache.shiro.authz.annotation.RequiresAuthentication;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.dao.Sqls;
|
||||
@@ -75,6 +77,7 @@ public class UserPartUpdateController {
|
||||
@At
|
||||
@ViReturn
|
||||
@POST
|
||||
@RequiresPermissions("data.user.update")
|
||||
public Object userPartData(PageForm pageForm,
|
||||
@Param(value = "unionId", required = false) String unionId,
|
||||
@Param(value = "unitId", required = false) String unitId,
|
||||
@@ -125,6 +128,7 @@ public class UserPartUpdateController {
|
||||
@At
|
||||
@ViReturn
|
||||
@POST
|
||||
@RequiresPermissions("data.user.update")
|
||||
public Object pageData(PageForm pageForm,
|
||||
@Param(value = "unionId", required = false) String unionId,
|
||||
@Param(value = "unitId", required = false) String unitId,
|
||||
@@ -252,6 +256,7 @@ public class UserPartUpdateController {
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("data.user.update")
|
||||
public Object cleanPart(@Param(value = "id", required = false) String id,
|
||||
@Param(value = "groupId", required = false) Integer groupId,
|
||||
@Param(value = "searchKeyword", required = false) String searchKeyword,
|
||||
@@ -302,6 +307,7 @@ public class UserPartUpdateController {
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("data.user.update")
|
||||
public Object getPartCount() {
|
||||
return dao.count(UserPartUp.class);
|
||||
}
|
||||
@@ -319,6 +325,7 @@ public class UserPartUpdateController {
|
||||
@At
|
||||
@ViReturn
|
||||
@POST
|
||||
@RequiresPermissions("data.user.update")
|
||||
public Object doSetUpUser(PageForm pageForm,
|
||||
@Param(value = "unionId", required = false) String unionId,
|
||||
@Param(value = "unitId", required = false) String unitId,
|
||||
@@ -393,6 +400,7 @@ public class UserPartUpdateController {
|
||||
*/
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("data.user.update")
|
||||
public Object getUserPart() {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
@@ -418,6 +426,7 @@ public class UserPartUpdateController {
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("data.user.update")
|
||||
public void doExportUser(PageForm pageForm,
|
||||
@Param(value = "props", required = false) String props,
|
||||
@Param(value = "unionId", required = false) String unionId,
|
||||
@@ -478,4 +487,12 @@ public class UserPartUpdateController {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("data.user.update")
|
||||
public Object deleteNotInSourceUser() {
|
||||
userPartUpService.deleteNotInSourceUser(false);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -14,5 +14,5 @@ public interface UserPatUpService extends ViService<UserPartUp> {
|
||||
|
||||
void renewUserState();
|
||||
|
||||
void deleteNotInSourceUser();
|
||||
void deleteNotInSourceUser(Boolean isAuto);
|
||||
}
|
||||
|
||||
+28
-9
@@ -118,14 +118,14 @@ public class UserPartUpServiceImpl extends ViServiceImpl<UserPartUp> implements
|
||||
|
||||
//人员类型
|
||||
Sql personTypeSql = Sqls.create("select personType from `user` where personType is not null and personType !='' group by personType");
|
||||
List<String> personTypes = sysDictService.listMap(personTypeSql).stream().map(v->v.getString("personType")).collect(Collectors.toList());
|
||||
List<String> personTypes = sysDictService.listMap(personTypeSql).stream().map(v -> v.getString("personType")).collect(Collectors.toList());
|
||||
List<Sys_dict> personTypeList = sysDictService.getSubListByCode("UserType");
|
||||
|
||||
//dict中的personType,在user表中没有,这一部分删除
|
||||
List<Sys_dict> deletePersonType = personTypeList.stream().filter(v -> !personTypes.contains(v.getName())).collect(Collectors.toList());
|
||||
List<String> deletePersonTypes = deletePersonType.stream().map(Sys_dict::getId).collect(Collectors.toList());
|
||||
|
||||
if (Lang.isNotEmpty(deletePersonTypes)){
|
||||
if (Lang.isNotEmpty(deletePersonTypes)) {
|
||||
sysDictService.delete(deletePersonTypes);
|
||||
}
|
||||
|
||||
@@ -152,9 +152,18 @@ public class UserPartUpServiceImpl extends ViServiceImpl<UserPartUp> implements
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 删除不在人事库的人员状态
|
||||
*
|
||||
* @param isAuto 是否自动更新,true为自动更新,false为手动更新
|
||||
*/
|
||||
@Override
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
public void deleteNotInSourceUser() {
|
||||
public void deleteNotInSourceUser(Boolean isAuto) {
|
||||
dao().update(Sys_user.class, Chain.make("preparedBy", "会员"), Cnd.where("member", "=", true));
|
||||
dao().update(Sys_user.class, Chain.make("preparedBy", "教职工"), Cnd.where("member", "=", false));
|
||||
|
||||
|
||||
Sql maxPullTimeSql = Sqls.create("select pullTime from user_source GROUP BY pullTime ORDER BY pullTime desc LIMIT 1");
|
||||
maxPullTimeSql.setCallback(Sqls.callback.map());
|
||||
dao().execute(maxPullTimeSql);
|
||||
@@ -174,12 +183,22 @@ public class UserPartUpServiceImpl extends ViServiceImpl<UserPartUp> implements
|
||||
List<String> userIdList = list.stream().map(v -> v.getString("id")).toList();
|
||||
List<String> userLoginNameList = list.stream().map(v -> v.getString("loginname")).toList();
|
||||
|
||||
// 修改不在人事库人员的状态
|
||||
dao().update(Sys_user.class, Chain.make("userState", "非人事库人员").add("personType", "非人事库人员")
|
||||
.add("member", 0).add("welfareMember", 0),
|
||||
Cnd.where("loginname", "in", userLoginNameList));
|
||||
if (isAuto == null) {
|
||||
return;
|
||||
}
|
||||
if (isAuto) {
|
||||
// 修改不在人事库人员的状态
|
||||
dao().update(Sys_user.class, Chain.make("userState", "非人事库人员").add("personType", "非人事库人员")
|
||||
.add("member", 0).add("welfareMember", 0),
|
||||
Cnd.where("loginname", "in", userLoginNameList));
|
||||
|
||||
// 去除不在人事库的人员角色,只保留公共角色
|
||||
dao().clear(Sys_user_role.class, Cnd.where("userId", "in", userIdList).and("roleId", "!=", Roles.PUBLIC));
|
||||
} else {
|
||||
// 删除不在人事库的人员,并清除角色
|
||||
dao().clear(Sys_user.class, Cnd.where("loginname", "in", userLoginNameList));
|
||||
dao().clear(Sys_user_role.class, Cnd.where("userId", "in", userIdList));
|
||||
}
|
||||
|
||||
// 去除不在人事库的人员角色,只保留公共角色
|
||||
dao().clear(Sys_user_role.class, Cnd.where("userId", "in", userIdList).and("roleId", "!=", Roles.PUBLIC));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user