commit
This commit is contained in:
@@ -354,7 +354,17 @@ public class SysUnionController {
|
||||
@ApiOperation("分工会组成单位分页")
|
||||
@SaCheckPermission("sys.manager.union")
|
||||
public Result branchUnionPartUnitPageData(PageForm pageForm, String unionId) {
|
||||
List<Sys_unit> list = dao.query(Sys_unit.class, Cnd.where("unionId", "=", unionId).asc("unitcode"));
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("unionId", "=", unionId);
|
||||
if (StrUtil.isNotBlank(pageForm.getSearchKeyword())) {
|
||||
SqlExpressionGroup seg = new SqlExpressionGroup();
|
||||
seg.orLike("`name`", pageForm.getSearchKeyword());
|
||||
seg.orLike("unitcode", pageForm.getSearchKeyword());
|
||||
cnd.and(seg);
|
||||
}
|
||||
cnd.desc("unitcode");
|
||||
|
||||
List<Sys_unit> list = dao.query(Sys_unit.class, cnd);
|
||||
return Result.success(list);
|
||||
}
|
||||
|
||||
|
||||
@@ -46,6 +46,7 @@ import javax.servlet.http.HttpServletRequest;
|
||||
import javax.validation.Valid;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
;
|
||||
|
||||
@@ -75,12 +76,13 @@ public class SysUnitController {
|
||||
@At("/pageData")
|
||||
@Ok("json")
|
||||
@SaCheckLogin
|
||||
public Object pageData(PageForm pageForm, String unitName, Integer unitLevel) {
|
||||
public Object pageData(PageForm pageForm, String unitName, String unitId) {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
// cnd.and("parentId", "is not", null).andEX("unitLevel", "=", unitLevel).asc("unitLevel").asc("unitcode");
|
||||
cnd.and("parentId", "is not", null)
|
||||
.and("unitTypeCode", "=", "1")
|
||||
.asc("unitcode");
|
||||
cnd.and("parentId", "is not", null);
|
||||
cnd.andEX("parentId", "=", unitId);
|
||||
// cnd.and("unitTypeCode", "=", "1");
|
||||
cnd.asc("unitcode");
|
||||
cnd.and(Cnd.likeEX("name", unitName));
|
||||
|
||||
Pagination<Sys_unit> listPage = sysUnitService.listPage(pageForm.getPageNumber(), pageForm.getPageSize(), Sys_unit.class, cnd);
|
||||
@@ -92,14 +94,14 @@ public class SysUnitController {
|
||||
@SaCheckLogin
|
||||
public Object userPageData(PageForm pageForm, String unitId) {
|
||||
Sql sql = Sqls.create("""
|
||||
select username,loginname,sex,mobile,if(member = 1, '是', '否') as member from vw_user $condition
|
||||
select username,loginname,sex,mobile,member from vw_user $condition
|
||||
""").setParam("unitId", unitId);
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("unitid", "=", unitId);
|
||||
if (Strings.isNotBlank(pageForm.getSearchName()) && Strings.isNotBlank(pageForm.getSearchKeyword())) {
|
||||
cnd.and(pageForm.getSearchName(), "like", "%" + pageForm.getSearchKeyword() + "%");
|
||||
}
|
||||
cnd.asc("member");
|
||||
cnd.desc("member");
|
||||
sql.setCondition(cnd);
|
||||
return Result.success(sysUnitService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql));
|
||||
}
|
||||
@@ -290,7 +292,13 @@ public class SysUnitController {
|
||||
|
||||
List<TreeNode<String>> nodeList = CollUtil.newArrayList();
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
nodeList.add(new TreeNode<>(list.get(i).getId(), list.get(i).getParentId(), list.get(i).getName(), i));
|
||||
nodeList.add(new TreeNode<>(list.get(i).getId(), list.get(i).getParentId(), list.get(i).getName(), i)
|
||||
.setExtra(
|
||||
Map.of(
|
||||
"unitType", list.get(i).getUnitType(),
|
||||
"unitTypeCode", list.get(i).getUnitTypeCode()
|
||||
)
|
||||
));
|
||||
}
|
||||
List<Tree<String>> treeList = TreeUtil.build(nodeList, StrUtil.blankToDefault(pid, "0000"));
|
||||
|
||||
|
||||
@@ -43,7 +43,10 @@ public class SysUnionGroupServiceImpl extends BaseServiceImpl<Sys_union_group> i
|
||||
@Override
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
public void insert(Sys_union_group group) {
|
||||
int count = dao().count(Sys_union_group.class, Cnd.where(Sys_union_group::getCode, "=", group.getCode()));
|
||||
int count = dao().count(Sys_union_group.class,
|
||||
Cnd.where(Sys_union_group::getCode, "=", group.getCode())
|
||||
.and(Sys_union_group::getUnionId, "=", group.getUnionId())
|
||||
);
|
||||
if (count > 0) {
|
||||
throw new BaseException("小组编码已存在");
|
||||
}
|
||||
@@ -54,8 +57,11 @@ public class SysUnionGroupServiceImpl extends BaseServiceImpl<Sys_union_group> i
|
||||
@Override
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
public void update(Sys_union_group group) {
|
||||
int count = dao().count(Sys_union_group.class, Cnd.where(Sys_union_group::getCode, "=", group.getCode())
|
||||
.and(Sys_union_group::getId, "!=", group.getId()));
|
||||
int count = dao().count(Sys_union_group.class,
|
||||
Cnd.where(Sys_union_group::getCode, "=", group.getCode())
|
||||
.and(Sys_union_group::getId, "!=", group.getId())
|
||||
.and(Sys_union_group::getUnionId, "=", group.getUnionId())
|
||||
);
|
||||
if (count > 0) {
|
||||
throw new BaseException("小组编码已存在");
|
||||
}
|
||||
|
||||
+1
-1
@@ -149,7 +149,7 @@ public class DifficultHelpApplyController {
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
|
||||
cnd.and("id", "<>", SecurityUtil.getUserId());
|
||||
if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name())) {
|
||||
if (AuthUtil.hasRoleOr(RoleConstant.BRANCH_UNION_CHAIRMAN.name(), RoleConstant.BRANCH_UNION_ADMIN.name(), RoleConstant.BRANCH_UNION_OPERATOR.name())) {
|
||||
cnd.and("unionid", "=", SecurityUtil.getUnionId());
|
||||
|
||||
+1
-1
@@ -88,7 +88,7 @@ public class DifficultHelpReadingController {
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
pageParam.buildSearch(cnd, "info.");
|
||||
cnd.groupBy("t.id");
|
||||
cnd.groupBy("info.id");
|
||||
sql.setCondition(cnd);
|
||||
Pagination<NutMap> pagination = difficultHelpCommonService.listPageMap(pageParam.getPageNumber(), pageParam.getPageSize(), sql);
|
||||
return Result.success().addData(pagination);
|
||||
|
||||
Reference in New Issue
Block a user