This commit is contained in:
server
2026-01-05 14:37:51 +08:00
parent c0fe550f15
commit 7d8b34065f
16 changed files with 105 additions and 32 deletions
@@ -11,7 +11,9 @@ import com.budwk.app.sys.services.SysDataUserPullService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
import org.nutz.aop.interceptor.ioc.TransAop;
import org.nutz.dao.Cnd;
import org.nutz.ioc.aop.Aop;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.mvc.annotation.At;
@@ -60,6 +62,7 @@ public class SysDataUserPullController {
@At
@SaCheckPermission("sys.data.user.pull")
@ApiOperation("拉取用户数据")
@Aop(TransAop.READ_COMMITTED)
public Result pullData() {
sysUserPullService.pull();
return Result.success();
@@ -164,15 +164,27 @@ public class SysDataUserAllUpdateServiceImpl implements SysDataUserUpdateService
List<String> specialStaffUserIds = specialStaffs.stream().map(SpecialStaff::getUserId).toList();
List<String> specialStaffUserLoginNames = dao.query(Sys_user.class, Cnd.where(Sys_user::getId, "in", specialStaffUserIds)).stream().map(Sys_user::getLoginname).toList();
// 排除掉其他人员不更新
cnd.andEX(Sys_user_source::getLoginname, "not in", specialStaffUserLoginNames);
// 找特殊人员在源数据中退休的
List<Sys_user_source> retireList = dao.query(Sys_user_source.class, Cnd.where(Sys_user_source::getPullTime, "=", updateParam.getPullTime()).and("userState", "=", "退休").and(Sys_user_source::getLoginname, "in", specialStaffUserLoginNames));
List<String> retireLoginNames = retireList.stream().map(Sys_user_source::getLoginname).distinct().toList();
List<String> list = specialStaffUserLoginNames.stream().filter(o -> !retireLoginNames.contains(o)).toList();
// 排除掉其他人员不更新
cnd.andEX(Sys_user_source::getLoginname, "not in", list);
log.info(cnd.toString());
List<Sys_user_source> sources = dao.query(Sys_user_source.class, cnd.groupBy("loginname"));
log.info("符合条件的数据源记录数: {}", sources.size());
// 查询系统用户
List<Sys_user> sysUsers = dao.query(Sys_user.class, Cnd.NEW().groupBy("loginname"));
// 不知道SpecialStaff表中的userId等不等于Sys_user_source表中的id
List<String> retireUserIds = sysUsers.stream().filter(o -> retireLoginNames.contains(o.getLoginname())).distinct().map(Sys_user::getId).toList();
dao.clear(SpecialStaff.class, Cnd.where(SpecialStaff::getUserId, "in", retireUserIds));
Map<String, Sys_user> userMap = sysUsers.stream().collect(Collectors.toMap(Sys_user::getLoginname, sysUser -> sysUser));
// 准备数据集合
@@ -185,9 +197,9 @@ public class SysDataUserAllUpdateServiceImpl implements SysDataUserUpdateService
// 处理每条数据
for (Sys_user_source source : sources) {
if (!"在岗".equals(source.getUserState())) {
continue;
}
// if (!"在岗".equals(source.getUserState())) {
// continue;
// }
Sys_user user = userMap.get(source.getLoginname());
@@ -415,6 +427,8 @@ public class SysDataUserAllUpdateServiceImpl implements SysDataUserUpdateService
long endTime = System.currentTimeMillis();
log.info("全量更新用户数据完成,耗时: {} 毫秒", (endTime - startTime));
// 6.清空7天之前的拉取数据
dao.clear(Sys_user_source.class, Cnd.where(Sys_user_source::getPullTime, "<", DateUtil.offsetDay(DateUtil.date(), -7)));
return "更新完成: 新增用户 " + needInitUserList.size() + " 个, 更新用户 " + needDoUpdateList.size()
+ " 个, 待添加会员 " + addMemberUserIds.size() + " 个, 待移除会员 " + removeMemberUserIds.size() + "";
@@ -16,6 +16,7 @@ import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.json.Json;
import org.nutz.lang.util.NutMap;
import org.nutz.mvc.Mvcs;
import org.quartz.Job;
import org.quartz.JobDataMap;
import org.quartz.JobExecutionContext;
@@ -53,11 +54,17 @@ public class SysUserAllRenewJob implements Job {
log.error("SysUserAllRenewJob定时任务执行失败,原因:{}", e.getMessage());
}
Cnd cnd = Cnd.NEW();
cnd.desc(Sys_user_source::getPullTime);
cnd.groupBy("pullTime");
Sys_user_source source = dao.fetch(Sys_user_source.class, cnd);
SysDataUserUpdateParam param = new SysDataUserUpdateParam();
param.setPullTime(DateUtil.formatDateTime(pullTime));
param.setPullTime(DateUtil.formatDateTime(source.getPullTime()));
param.setUpdateMode(SysDataUpdateMode.ALL.name());
param.setConditionGroup(conditionGroup);
log.info("执行全量更新数据前,传入的时间{}", DateUtil.formatDateTime(pullTime));
sysDataUserUpdateService.update(param);
}
}
@@ -135,6 +135,9 @@ public class ActivitySchoolApply extends BaseModel implements Serializable {
@Excel(name = "序号", width = 10)
private int index;
@Excel(name = "分工会", width = 30)
private String unionname;
@@ -189,4 +192,6 @@ public class ActivitySchoolApply extends BaseModel implements Serializable {
private String unitname;
}
@@ -233,12 +233,15 @@ public class ActivitySportsServiceImpl extends BaseServiceImpl<ActivitySchool> i
List<ActivitySchoolApply> excels = new ArrayList<>();
list.forEach(z -> {
for (int i = 0; i < list.size(); i++) {
Record z = list.get(i);
ActivitySchoolApply schoolApply = z.toPojo(ActivitySchoolApply.class);
schoolApply.setIndex(i+1);
String s = schoolApply.getIdentity().stream().map(personType::getName).toList().toString();
schoolApply.setSf(s.replace("[", "").replace("]", ""));
excels.add(schoolApply);
});
}
ExportParams exportParams = new ExportParams();
exportParams.setType(ExcelType.XSSF);
@@ -216,7 +216,7 @@ public class MemberChangeManageController {
*/
private void completeLatestTask(BpmProcessInstance instance, String opinion,
Consumer<Map<String, Object>> postAction,
Map<String, Object> var) {
Map<String, Object> var) {
BpmProcessTask task = getLatestTaskByInstanceId(instance.getId());
if (task == null) {
throw new BaseException("无法获取待处理任务");
@@ -231,8 +231,9 @@ public class MemberChangeManageController {
param.setApprovalOpinion(opinion);
Map<String, Object> variables = BeanUtil.beanToMap(param);
variables.putAll(var);
if (var != null) {
variables.putAll(var);
}
// 执行完成任务
bpmService.completeTask(task.getId(), BpmTaskApprovalTypeEnum.PASS, variables, List.of(SecurityUtil.getUserLoginname()));
@@ -246,8 +247,8 @@ public class MemberChangeManageController {
@At
@SLog(tag = "分工会管理-会员管理", type = "MemberBranchManageList", msg = "修改会员福利手机号")
@SaCheckPermission(value = {"member.change.mange", "staff.member.change.mange"}, mode = SaMode.OR)
public Result changeWelfareMobile(String id,String welfareMobile){
memberCommonService.dao().update(Sys_user.class, Chain.make("welfareMobile", welfareMobile),Cnd.where("id", "=", id));
public Result changeWelfareMobile(String id, String welfareMobile) {
memberCommonService.dao().update(Sys_user.class, Chain.make("welfareMobile", welfareMobile), Cnd.where("id", "=", id));
return Result.success();
}
@@ -255,7 +256,7 @@ public class MemberChangeManageController {
@At
@Ok("void")
@SaCheckPermission(value = {"member.change.mange", "staff.member.change.mange"}, mode = SaMode.OR)
public void doExport(MemberManagePageForm pageForm, HttpServletResponse response){
public void doExport(MemberManagePageForm pageForm, HttpServletResponse response) {
Sql sql = memberCommonService.getSql(pageForm);
List<NutMap> list = memberCommonService.listMap(sql);
@@ -300,7 +301,7 @@ public class MemberChangeManageController {
@At
@Ok("void")
@SaCheckPermission(value = {"member.change.mange", "staff.member.change.mange"}, mode = SaMode.OR)
public void doExportNotEqPhone(MemberManagePageForm pageForm, HttpServletResponse response){
public void doExportNotEqPhone(MemberManagePageForm pageForm, HttpServletResponse response) {
Sql sql = Sqls.create("""
SELECT
u.id,
@@ -339,7 +339,7 @@ public class MemberCommonServiceImpl extends BaseServiceImpl<Sys_user> implement
dao().insert(userRole);
}
// 杭医特有,其他学校请删除
record.setPreparedBy("会员");
// record.setPreparedBy("会员");
} else {
// if (record.getIsExitActivityMemberScope() != null && record.getIsExitActivityMemberScope()) {
// dao().clear(ActivityUserScope.class, Cnd.where("userId", "=", userId).and("groupId", "=", 1));
+2 -2
View File
@@ -24,7 +24,7 @@
</filter>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${LOG_HOME}/info-%d{yyyy-MM-dd}.log</fileNamePattern>
<maxHistory>30</maxHistory>
<maxHistory>180</maxHistory>
</rollingPolicy>
</appender>
@@ -41,7 +41,7 @@
</filter>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${LOG_HOME}/error-%d{yyyy-MM-dd}.log</fileNamePattern>
<maxHistory>30</maxHistory>
<maxHistory>180</maxHistory>
</rollingPolicy>
</appender>
@@ -11,7 +11,7 @@ var ACTIVITY_SPORTS_DELETE_USER = {
@sort-change="pageOrder"ref="multipleTable" class="vi-table" row-key="id" style="width: 100%;"
v-loading="tableLoading">
<el-table-column :reserve-selection="true"
type="selection"
type="selection"align="center" header-align="center"
width="55">
</el-table-column>
<el-table-column :index="indexMethod" align="center" header-align="center" label="序号"
@@ -82,9 +82,9 @@ var ACTIVITY_SPORTS_DELETE_USER = {
},
openDelete(data) {
this.rowData = data
this.applyPageData()
this.pageData()
},
applyPageData() {
pageData() {
this.tableLoading = true
this.pageForm.activityId = this.rowData.activityId
this.pageForm.eventId = this.rowData.eventId
@@ -102,6 +102,11 @@ var ACTIVITY_SPORTS_DELETE_USER = {
},
joinMemberFamily(id) {
const now = moment().valueOf()
if (now < moment(this.rowData.applyStartTime).valueOf() || now > moment(this.rowData.applyEndTime).valueOf()) {
this.notifyWarning("此活动不在报名时间内")
return
}
if (!id && !this.selection.length) {
this.$notify({
title: "警告",
@@ -282,6 +282,8 @@ layout("/layouts/platform.html"){
</el-timeline>
</template>
</el-table-column>
<el-table-column label="序号" width="50" type="index" align="center" header-align="center"></el-table-column>
<el-table-column align="center" header-align="center" label="年度" prop="year">
<template>{{pageForm.year}}</template>
</el-table-column>
@@ -13,8 +13,8 @@ const MEMBER_CHANGE = {
<el-descriptions-item label="性别">
<el-form-item prop="sex">
<el-radio-group :disabled="allowFields('sex')" v-model="formData.sex" size="small">
<el-radio border label="男"></el-radio>
<el-radio border label="女"></el-radio>
<el-radio border label="男"></el-radio>
<el-radio border label="女"></el-radio>
</el-radio-group>
</el-form-item>
</el-descriptions-item>
@@ -101,7 +101,22 @@ const MEMBER_CHANGE = {
:disabled="allowFields('personType')" style="width: 100%"></dict-select>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item></el-descriptions-item>
<el-descriptions-item label="聘用方式">
<el-form-item prop="preparedBy">
<dict-select v-model="formData.preparedBy" code="USER_PREPARED_BY_TYPE"
:disabled="allowFields('preparedBy')" style="width: 100%"></dict-select>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="进站时间" >
<el-form-item prop="postDoctoralJoinDate">
<el-date-picker
v-model="formData.postDoctoralJoinDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择进站时间">
</el-date-picker>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="会员状态">
@@ -249,6 +264,9 @@ const MEMBER_CHANGE = {
} else if (/^[1-9]\d{7}((0[1-9])|(10|11|12))(([0|1|2][0-9])|10|20|30|31)\d{3}$/.test(value)) {
// 外国人身份证号码格式正确(15位)
callback();
} else if (/^[A-Z]\d{6,9}$/.test(value)) {
// 香港身份证号码格式正确(8位)
callback();
} else {
// 格式错误,返回错误信息
callback(new Error("身份证号码格式错误"));
@@ -371,6 +389,7 @@ const MEMBER_CHANGE = {
campus,
userState,
personType,
postDoctoralJoinDate,
preparedBy,
idCard,
mobile,
@@ -395,7 +414,9 @@ const MEMBER_CHANGE = {
this.$set(this.formData, "academicDegree", academicDegree)
this.$set(this.formData, "campus", campus)
this.$set(this.formData, "userState", userState)
this.$set(this.formData, "userState", userState)
this.$set(this.formData, "personType", personType)
this.$set(this.formData, "postDoctoralJoinDate", postDoctoralJoinDate)
this.$set(this.formData, "preparedBy", preparedBy)
this.$set(this.formData, "unitName", unit ? unit.name : null)
this.$set(this.formData, "unitId", unit ? unit.id : null)
@@ -402,6 +402,9 @@ layout("/layouts/platform.html"){
}
},
getChangeTypes(changeTypes){
if (!changeTypes || changeTypes === 'undefined' || changeTypes === 'null') {
return null;
}
const changeTypesList = JSON.parse(changeTypes)
if (changeTypesList) {
if (!changeTypesList || changeTypesList.length === 0 || !this.changeTypeData || this.changeTypeData.length === 0) return null
@@ -58,7 +58,7 @@ layout("/layouts/platform.html"){
label="操作"
width="100px" fixed="right">
<template scope="{row}">
<el-button size="mini" type="primary" @click="openView(row.userId)">查看</el-button>
<el-button size="mini" type="primary" @click="openView(row)">查看</el-button>
</template>
</el-table-column>
</el-table>
@@ -243,23 +243,26 @@ layout("/layouts/platform_h5.html"){
bizType: bizType,
params: JSON.stringify({ userId: userId, handle: false }),
})
} catch (e) {
this.result = {
code: 99,
msg: '请使用智慧工会系统身份二维码'
}
} finally {
this.resultVisible = true
}
},
resultConfirm() {
async resultConfirm() {
try {
const { bizType, userId } = JSON.parse(this.decodedText)
this.$axios.post('/platform/scan/handle', {
const {bizType, userId} = JSON.parse(this.decodedText)
const res = await this.$axios.post('/platform/scan/handle', {
bizType: bizType,
params: JSON.stringify({ userId: userId, handle: true }),
params: JSON.stringify({userId: userId, handle: true}),
})
if(res.code === 0) {
this.$toast.success(res.msg)
}
} catch (e) {
} finally {
@@ -270,7 +273,7 @@ layout("/layouts/platform_h5.html"){
},
async created() {
await this.initCamera()
},
beforeDestroy() {
@@ -6,6 +6,12 @@ layout("/layouts/platform_h5.html"){
<van-sticky>
<van-nav-bar @click-left="back" left-arrow left-text="返回" placeholder title="地址管理"></van-nav-bar>
</van-sticky>
<van-notice-bar
left-icon="volume-o"
:scrollable="false"
wrapable
text="如有两个收货地址,系统将以默认收货地址为准!有两个收货地址的教职工请注意设置。"
></van-notice-bar>
<van-address-list
:list="addressList"
+1 -1
View File
@@ -198,7 +198,7 @@ public class JugTest {
@Test
public void userPwd() {
List<Sys_user> users = dao.query(Sys_user.class, Cnd.NEW());
String pwd = "1";
String pwd = "@dd3s#3618!";
for (Sys_user user : users) {
user.setSalt(R.UU32());
user.setPassword(PwdUtil.getPassword(pwd, user.getSalt()));