会员、福利
This commit is contained in:
@@ -61,7 +61,7 @@ public class SourceUserServiceImpl extends ViServiceImpl<UserSource> implements
|
||||
}
|
||||
|
||||
// 是会员的人员类型
|
||||
private final List<String> MEMBER_PERSON_TYPE = List.of("事业编制(员额)", "事业编制", "校聘编外", "同工同酬", "学校编制", "博士后(统招)", "下属公司人员");
|
||||
private final List<String> MEMBER_PERSON_TYPE = List.of("事业编制(员额)", "事业编制", "校聘编外", "同工同酬", "学校编制", "博士后(统招)");
|
||||
|
||||
@Inject
|
||||
private AsyncService asyncService;
|
||||
@@ -148,18 +148,27 @@ public class SourceUserServiceImpl extends ViServiceImpl<UserSource> implements
|
||||
source.setWelfareMember(null);
|
||||
Sys_user user = userMap.get(source.getLoginname().toLowerCase());
|
||||
|
||||
if (MEMBER_PERSON_TYPE.contains(source.getPersonType()) && "在职".equals(source.getUserState())) {
|
||||
if (StrUtil.isNotBlank(source.getPersonType())
|
||||
&& MEMBER_PERSON_TYPE.contains(source.getPersonType())
|
||||
&& "在职".equals(source.getUserState())) {
|
||||
source.setMember(1);
|
||||
source.setWelfareMember(1);
|
||||
if (Lang.isNotEmpty(user) && user.getMember() == 1) {
|
||||
|
||||
} else {
|
||||
addMemberUserIds.add(Lang.isNotEmpty(user) ? user.getId() : source.getId());
|
||||
// 符合条件的这类人员 人员性质设为会员
|
||||
source.setPreparedBy("会员");
|
||||
if (user != null && user.getMember() != 1) {
|
||||
addMemberUserIds.add(user.getId());
|
||||
}
|
||||
if (user == null) {
|
||||
addMemberUserIds.add(source.getId());
|
||||
}
|
||||
} else {
|
||||
source.setMember(0);
|
||||
source.setWelfareMember(0);
|
||||
deleteMemberUserIds.add(Lang.isNotEmpty(user) ? user.getId() : source.getId());
|
||||
// 不符合条件的这类人员 人员性质设为教职工
|
||||
source.setPreparedBy("教职工");
|
||||
if (user != null && user.getMember() == 1) {
|
||||
deleteMemberUserIds.add(user.getId());
|
||||
}
|
||||
}
|
||||
|
||||
Sys_user u = new Sys_user();
|
||||
|
||||
+3
-1
@@ -109,6 +109,7 @@ public class MemberChangeManageController {
|
||||
@Param(value = "sex", required = false) String sex,
|
||||
@Param(value = "personType", required = false) String personType,
|
||||
@Param(value = "userState", required = false) String userState,
|
||||
@Param(value = "preparedBy", required = false) String preparedBy,
|
||||
@Param(value = "changeDate", required = false) String changeDate,
|
||||
@Param(value = "changeType", required = false) String changeType,
|
||||
@Param(value = "changeTypes", required = false) Integer[] changeTypes,
|
||||
@@ -169,6 +170,7 @@ public class MemberChangeManageController {
|
||||
cnd.andEX("u.sex", "=", sex);
|
||||
cnd.andEX("u.personType", "=", personType);
|
||||
cnd.andEX("u.userState", "=", userState);
|
||||
cnd.andEX("u.preparedBy", "=", preparedBy);
|
||||
|
||||
if (StrUtil.isNotBlank(changeDateBefore) && StrUtil.isNotBlank(changeDateEnd)) {
|
||||
cnd.and(new Static(String.format("Date(his.changeTime) >= '%s' and Date(his.changeTime) <= '%s'", changeDateBefore, changeDateEnd)));
|
||||
@@ -363,7 +365,7 @@ public class MemberChangeManageController {
|
||||
@Param(value = "memberSearchKeyWord", required = false) String memberSearchKeyWord,
|
||||
@Param(value = "isAppendWelfareMember", required = false) Boolean isAppendWelfareMember) {
|
||||
int yyyy = Calendar.getInstance().get(Calendar.YEAR);
|
||||
Cnd cnd = MemberUtils.getCnd(pageForm, startDate, endDate, unionId, unitId, personTypes, userStates, memberTypes, sexTypes, age, null, roleIds, null, null, memberStatus, threeUnitId, unionGroupId, reverseSelection, null, null, campus);
|
||||
Cnd cnd = MemberUtils.getCnd(pageForm, startDate, endDate, unionId, unitId, personTypes, userStates, null, memberTypes, sexTypes, age, null, roleIds, null, null, memberStatus, threeUnitId, unionGroupId, reverseSelection, null, null, campus);
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT u.* from $table
|
||||
LEFT JOIN sys_user_role sur ON sur.userid = u.id
|
||||
|
||||
@@ -71,6 +71,7 @@ public class MemberCheckUnionController {
|
||||
@Param(value = "isMember", required = false) Integer isMember,
|
||||
@Param(value = "unionGroupId", required = false) String unionGroupId,
|
||||
@Param(value = "threeUnitId", required = false) String threeUnitId,
|
||||
@Param(value = "preparedBy", required = false) String preparedBy,
|
||||
@Param(value = "userStates", required = false) String[] userStates,
|
||||
@Param(value = "personTypes", required = false) String[] personTypes,
|
||||
@Param(value = "changeTypes", required = false) Integer[] changeTypes,
|
||||
@@ -85,6 +86,7 @@ public class MemberCheckUnionController {
|
||||
u.birthday,
|
||||
u.personType,
|
||||
u.userState,
|
||||
u.preparedBy,
|
||||
u.unionname,
|
||||
u.unitname,
|
||||
u.threeUnitName,
|
||||
@@ -124,6 +126,7 @@ public class MemberCheckUnionController {
|
||||
cnd.andEX("u.unitid", "=", unitId);
|
||||
cnd.andEX("u.unionGroupId", "=", unionGroupId);
|
||||
cnd.andEX("u.threeUnitId", "=", threeUnitId);
|
||||
cnd.andEX("u.preparedBy", "=", preparedBy);
|
||||
cnd.and(Cnd.likeEX("u." + pageForm.getSearchName(), pageForm.getSearchKeyword()));
|
||||
|
||||
cnd.andEX("u.member", "=", isMember);
|
||||
|
||||
@@ -71,7 +71,8 @@ public class MemberDataManageController {
|
||||
@Param(value = "startLoginNames", required = false) String startLoginNames,
|
||||
@Param(value = "endLoginNames", required = false) String endLoginNames,
|
||||
@Param(value = "personTypes", required = false) String[] personTypes,
|
||||
@Param(value = "userStates", required = false) String[] userStates
|
||||
@Param(value = "userStates", required = false) String[] userStates,
|
||||
@Param(value = "preparedBys", required = false) String[] preparedBys
|
||||
) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
@@ -83,6 +84,7 @@ public class MemberDataManageController {
|
||||
welfareMember,
|
||||
personType,
|
||||
userState,
|
||||
preparedBy,
|
||||
unioncode,
|
||||
unionname,
|
||||
unionid,
|
||||
@@ -123,6 +125,7 @@ public class MemberDataManageController {
|
||||
cnd.andEX("campusName", "=", campus);
|
||||
cnd.andEX("personType", "in", personTypes);
|
||||
cnd.andEX("userState", "in", userStates);
|
||||
cnd.andEX("preparedBy", "in", preparedBys);
|
||||
|
||||
if (StrUtil.isNotBlank(startLoginNames)) {
|
||||
String[] loginNames = startLoginNames.split(",");
|
||||
@@ -315,6 +318,7 @@ public class MemberDataManageController {
|
||||
@Param(value = "endLoginNames", required = false) String endLoginNames,
|
||||
@Param(value = "confirm", required = false) Boolean confirm,
|
||||
@Param(value = "personTypes", required = false) String[] personTypes,
|
||||
@Param(value = "preparedBys", required = false) String[] preparedBys,
|
||||
@Param(value = "userStates", required = false) String[] userStates) {
|
||||
|
||||
|
||||
@@ -343,6 +347,7 @@ public class MemberDataManageController {
|
||||
cnd.andEX("campusName", "=", campus);
|
||||
cnd.andEX("personType", "in", personTypes);
|
||||
cnd.andEX("userState", "in", userStates);
|
||||
cnd.andEX("preparedBy", "in", preparedBys);
|
||||
|
||||
if (StrUtil.isNotBlank(startLoginNames)) {
|
||||
String[] loginNames = startLoginNames.split(",");
|
||||
|
||||
+4
-2
@@ -80,6 +80,7 @@ public class MemberInquireIntegrateController {
|
||||
@Param(value = "unionGroupId", required = false) String[] unionGroupId,
|
||||
@Param(value = "personTypes", required = false) String[] personTypes,
|
||||
@Param(value = "userStates", required = false) String[] userStates,
|
||||
@Param(value = "preparedBys", required = false) String[] preparedBys,
|
||||
@Param(value = "memberStatus", required = false) String[] memberStatus,
|
||||
@Param(value = "campus", required = false) String campus,
|
||||
@Param(value = "memberType", required = false) String memberType,
|
||||
@@ -92,7 +93,7 @@ public class MemberInquireIntegrateController {
|
||||
@Param(value = "memberSearchKeyWord", required = false) String memberSearchKeyWord) {
|
||||
int yyyy = Calendar.getInstance().get(Calendar.YEAR);
|
||||
|
||||
Cnd cnd = MemberUtils.getCnd(pageForm, startDate, endDate, unionId, unitId, personTypes, userStates, memberTypes, sexTypes, age, null, roleIds, null, null, memberStatus, threeUnitId, unionGroupId, reverseSelection, null, null, campus);
|
||||
Cnd cnd = MemberUtils.getCnd(pageForm, startDate, endDate, unionId, unitId, personTypes, userStates, preparedBys, memberTypes, sexTypes, age, null, roleIds, null, null, memberStatus, threeUnitId, unionGroupId, reverseSelection, null, null, campus);
|
||||
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT u.* from $table
|
||||
@@ -443,6 +444,7 @@ public class MemberInquireIntegrateController {
|
||||
@Param(value = "unionGroupId", required = false) String[] unionGroupId,
|
||||
@Param(value = "personTypes", required = false) String[] personTypes,
|
||||
@Param(value = "userStates", required = false) String[] userStates,
|
||||
@Param(value = "preparedBys", required = false) String[] preparedBys,
|
||||
@Param(value = "memberStatus", required = false) String[] memberStatus,
|
||||
@Param(value = "campus", required = false) String campus,
|
||||
@Param(value = "memberType", required = false) String memberType,
|
||||
@@ -457,7 +459,7 @@ public class MemberInquireIntegrateController {
|
||||
try {
|
||||
int yyyy = Calendar.getInstance().get(Calendar.YEAR);
|
||||
|
||||
Cnd cnd = MemberUtils.getCnd(null, startDate, endDate, unionId, unitId, personTypes, userStates, memberTypes, sexTypes, age, null, roleIds, null, null, memberStatus, threeUnitId, unionGroupId, reverseSelection, null, null, campus);
|
||||
Cnd cnd = MemberUtils.getCnd(null, startDate, endDate, unionId, unitId, personTypes, userStates, preparedBys, memberTypes, sexTypes, age, null, roleIds, null, null, memberStatus, threeUnitId, unionGroupId, reverseSelection, null, null, campus);
|
||||
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT u.* from $table
|
||||
|
||||
@@ -67,6 +67,7 @@ public class MemberUtils {
|
||||
String[] unitId,
|
||||
String[] personTypes,
|
||||
String[] userStates,
|
||||
String[] preparedBys,
|
||||
String[] memberTypes,
|
||||
String[] sexTypes,
|
||||
String[] age,
|
||||
@@ -164,6 +165,7 @@ public class MemberUtils {
|
||||
cnd.andEX("u.campus", EQ_OR_NEQ_OP, campus);
|
||||
cnd.andEX("u.personType", IN_OR_NIN_OP, personTypes);
|
||||
cnd.andEX("u.userState", IN_OR_NIN_OP, userStates);
|
||||
cnd.andEX("u.preparedBy", IN_OR_NIN_OP, preparedBys);
|
||||
cnd.andEX("u.sex", IN_OR_NIN_OP, sexTypes);
|
||||
cnd.andEX("sur.jdhid", EQ_OR_NEQ_OP, teacherMeetingId);
|
||||
cnd.andEX("sur.roleid", IN_OR_NIN_OP, roleIds);
|
||||
|
||||
@@ -89,4 +89,7 @@ public class WelfareProjectSubjectOption extends BaseModel {
|
||||
@Comment("简短备注")
|
||||
@ColDefine(type = ColType.VARCHAR,width = 100)
|
||||
private String simpleDesc;
|
||||
|
||||
private Integer rank;
|
||||
private Long selectCount;
|
||||
}
|
||||
|
||||
@@ -7,6 +7,8 @@ import io.v.nutz.base.service.impl.ViServiceImpl;
|
||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||
import io.v.nutz.zhgh.welfare.model.WelfareProject;
|
||||
import io.v.nutz.zhgh.welfare.model.WelfareProjectSubject;
|
||||
import io.v.nutz.zhgh.welfare.model.WelfareProjectSubjectOption;
|
||||
import io.v.nutz.zhgh.welfare.model.WelfareUserSelection;
|
||||
import io.v.nutz.zhgh.welfare.service.WelfareProjectService;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
@@ -19,7 +21,10 @@ import org.nutz.lang.Strings;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
import org.nutz.plugins.wkcache.annotation.CacheDefaults;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
||||
@@ -64,6 +69,44 @@ public class WelfareProjectServiceImpl extends ViServiceImpl<WelfareProject> imp
|
||||
MatchConditionStructure conditionStructure = fetchLinks(dao().fetch(MatchConditionStructure.class, project.getConditionStructureId()), "conditions");
|
||||
project.setConditionStructure(conditionStructure);
|
||||
}
|
||||
|
||||
//获取用户选择数据
|
||||
List<WelfareUserSelection> userSelections = dao().query(WelfareUserSelection.class, Cnd.where("welfareId", "=", projectId));
|
||||
//统计每项选了多少个
|
||||
Map<String, Long> selectCountMap = userSelections.stream().collect(Collectors.groupingBy(WelfareUserSelection::getSelectOptionId, Collectors.counting()))
|
||||
.entrySet().stream()
|
||||
.sorted(Map.Entry.<String, Long>comparingByValue().reversed()) // 根据选择的数量降序排序
|
||||
.collect(Collectors.toMap(
|
||||
Map.Entry::getKey,
|
||||
Map.Entry::getValue,
|
||||
(e1, e2) -> e1, LinkedHashMap::new));// 保持排序;
|
||||
//排名
|
||||
LinkedHashMap<String, Integer> sortMap = new LinkedHashMap<>();
|
||||
int rank = 1;
|
||||
//记录上一个的数量,如果相同,则排名相同
|
||||
Long previousValue = null;
|
||||
for (Map.Entry<String, Long> entry : selectCountMap.entrySet()) {
|
||||
if (previousValue != null && !Objects.equals(previousValue, entry.getValue())) {
|
||||
rank++;
|
||||
}
|
||||
sortMap.put(entry.getKey(), rank);
|
||||
previousValue = entry.getValue();
|
||||
}
|
||||
|
||||
if (Lang.isNotEmpty(welfareProjectSubjects)) {
|
||||
fetchLinks(welfareProjectSubjects, "options", Cnd.NEW().asc("optionSort"));
|
||||
welfareProjectSubjects.forEach(o -> {
|
||||
List<WelfareProjectSubjectOption> options = o.getOptions();
|
||||
options.forEach(op -> {
|
||||
op.setSelectCount(selectCountMap.getOrDefault(op.getId(), 0L));
|
||||
op.setRank(sortMap.getOrDefault(op.getId(), 0));
|
||||
});
|
||||
});
|
||||
}
|
||||
if (Strings.isNotBlank(project.getConditionStructureId())) {
|
||||
MatchConditionStructure conditionStructure = fetchLinks(dao().fetch(MatchConditionStructure.class, project.getConditionStructureId()), "conditions");
|
||||
project.setConditionStructure(conditionStructure);
|
||||
}
|
||||
return project;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user