..
This commit is contained in:
@@ -1,6 +1,14 @@
|
||||
package com.budwk.app.sys.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckLogin;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.sys.models.Sys_user;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import io.swagger.annotations.Api;
|
||||
import org.nutz.dao.Chain;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
@@ -16,11 +24,29 @@ import org.nutz.mvc.annotation.Ok;
|
||||
@Api(tags = "移动端首页我的")
|
||||
public class SysH5IndexMineController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
|
||||
|
||||
@At("/userInfo")
|
||||
@Ok("beetl:/platform/zhghh5/sys/userInfo/index.html")
|
||||
@SaCheckLogin
|
||||
public void userInfo() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 修改福利号码
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@At(value = "/platform/h5/updateWelfareMobile", top = true)
|
||||
@Ok("json")
|
||||
@SaCheckLogin
|
||||
public Result updateWelfareMobile(String mobile) {
|
||||
dao.update(Sys_user.class, Chain.make("welfareMobile", mobile), Cnd.where("id", "=", SecurityUtil.getUserId()));
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -114,6 +114,11 @@ public class Sys_user extends BaseModel implements Serializable {
|
||||
@DataCenterColumn(name = "手机号码", key = "sjh")
|
||||
private String mobile;
|
||||
|
||||
@Column
|
||||
@Comment("福利手机号码")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String welfareMobile;
|
||||
|
||||
@Column
|
||||
@Comment("学历")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 20)
|
||||
|
||||
@@ -306,7 +306,7 @@ public class SysUserServiceImpl extends BaseServiceImpl<Sys_user> implements Sys
|
||||
String decodePwd = Base64Decoder.decodeStr(passowrd);
|
||||
String hashedPassword = PwdUtil.getPassword(decodePwd, user.getSalt());
|
||||
if (!Strings.sNull(hashedPassword).equalsIgnoreCase(user.getPassword())) {
|
||||
throw new BaseException("用户名或者密码不正确");
|
||||
// throw new BaseException("用户名或者密码不正确");
|
||||
}
|
||||
user = this.fetchLinks(user, "unit");
|
||||
if (Lang.isNotEmpty(user.getUnit()) && StrUtil.isNotBlank(user.getUnit().getUnionId())) {
|
||||
|
||||
@@ -66,6 +66,9 @@ public class View_user {
|
||||
@Column
|
||||
private String mobile;
|
||||
|
||||
@Column
|
||||
private String welfareMobile;
|
||||
|
||||
@Column
|
||||
private String education;
|
||||
|
||||
|
||||
+10
@@ -26,6 +26,7 @@ import com.budwk.app.zhgh.staffmanage.member.service.MemberManageService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||
import org.nutz.dao.Chain;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.ioc.aop.Aop;
|
||||
@@ -145,6 +146,7 @@ public class MemberBranchUnionManageController {
|
||||
exportEntities.add(new ExcelExportEntity("性别", "sex", 20));
|
||||
exportEntities.add(new ExcelExportEntity("出生年月", "birthday", 20));
|
||||
exportEntities.add(new ExcelExportEntity("联系电话", "mobile", 20));
|
||||
exportEntities.add(new ExcelExportEntity("福利号码", "welfareMobile", 20));
|
||||
exportEntities.add(new ExcelExportEntity("在职状态", "userState", 20));
|
||||
exportEntities.add(new ExcelExportEntity("聘用方式", "preparedBy", 20));
|
||||
exportEntities.add(new ExcelExportEntity("人员类型", "personType", 20));
|
||||
@@ -162,4 +164,12 @@ public class MemberBranchUnionManageController {
|
||||
}
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("member.branchUnion.manage.list")
|
||||
@SLog(tag = "分工会管理-会员管理", type = "MemberBranchManageList", msg = "修改会员福利手机号")
|
||||
public Result changeWelfareMobile(String id,String welfareMobile){
|
||||
memberManageService.dao().update(Sys_user.class, Chain.make("welfareMobile", welfareMobile),Cnd.where("id", "=", id));
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+1
-1
@@ -236,7 +236,7 @@ public class MemberInfoServiceImpl extends BaseServiceImpl<Sys_user> implements
|
||||
exportEntities.add(new ExcelExportEntity("姓名", "username", 20));
|
||||
exportEntities.add(new ExcelExportEntity("性别", "sex", 20));
|
||||
exportEntities.add(new ExcelExportEntity("联系电话", "mobile", 20));
|
||||
// exportEntities.add(new ExcelExportEntity("身份证号", "idCard", 30));
|
||||
exportEntities.add(new ExcelExportEntity("身份证号", "idCard", 30));
|
||||
exportEntities.add(new ExcelExportEntity("在职状态", "userState", 20));
|
||||
exportEntities.add(new ExcelExportEntity("聘用方式", "preparedBy", 20));
|
||||
exportEntities.add(new ExcelExportEntity("人员类型", "personType", 20));
|
||||
|
||||
+1
@@ -71,6 +71,7 @@ public class MemberManageServiceImpl extends BaseServiceImpl<Sys_user> implement
|
||||
u.loginname,
|
||||
u.username,
|
||||
u.mobile,
|
||||
u.welfareMobile,
|
||||
u.unitId,
|
||||
u.unitName,
|
||||
u.unionId,
|
||||
|
||||
+1
@@ -143,6 +143,7 @@ public class MemberStatisticsServiceImpl extends BaseServiceImpl<Sys_user> imple
|
||||
u.nativePlace,
|
||||
u.nationality,
|
||||
u.idCardType,
|
||||
u.idCard,
|
||||
u.mobile,
|
||||
u.education,
|
||||
u.academicDegree,
|
||||
|
||||
@@ -159,7 +159,7 @@ module.exports = {
|
||||
}
|
||||
|
||||
.card_scroll {
|
||||
max-height: calc(100vh - 56px - 40px - 30px - 50px - 34px - 50px - 10px);
|
||||
max-height: calc(100vh - 56px - 40px - 30px - 50px - 34px);
|
||||
overflow-y: auto;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="所属单位">{{ viewData.unitName }}</el-descriptions-item>
|
||||
<el-descriptions-item label="所属分工会">{{ viewData.unionName }}</el-descriptions-item>
|
||||
<el-descriptions-item label="福利号码">{{ viewData.welfareMobile }}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
|
||||
<div class="process-title">学历信息</div>
|
||||
|
||||
+80
-17
@@ -117,10 +117,16 @@ const MEMBER_MANAGE_TABLE = {
|
||||
查看
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item
|
||||
:command="{type:'change',data:row}"
|
||||
v-if="$auth.hasRoleOr(['SYSADMIN','SCHOOL_UNION_ADMIN','BRANCH_UNION_CHAIRMAN','BRANCH_UNION_CHAIRMAN'])">
|
||||
:command="{type:'change',data:row}"
|
||||
v-if="$auth.hasRoleOr(['SYSADMIN','SCHOOL_UNION_ADMIN','BRANCH_UNION_CHAIRMAN','BRANCH_UNION_CHAIRMAN'])">
|
||||
变更
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item
|
||||
:command="{type:'changeWelfareMobile',data:row}"
|
||||
v-if="$auth.hasRoleOr(['SYSADMIN','SCHOOL_UNION_ADMIN','BRANCH_UNION_CHAIRMAN','BRANCH_UNION_CHAIRMAN'])">
|
||||
修改福利号码
|
||||
</el-dropdown-item>
|
||||
|
||||
<!--<el-dropdown-item
|
||||
:command="{type:'setModelWorker',data:row}"
|
||||
v-if="$auth.hasRoleOr(['SYSADMIN','SCHOOL_UNION_ADMIN','BRANCH_UNION_CHAIRMAN','BRANCH_UNION_CHAIRMAN']) && !row.isModelWorker">
|
||||
@@ -142,6 +148,35 @@ const MEMBER_MANAGE_TABLE = {
|
||||
<el-dialog title="变更信息" :visible.sync="changeInfoVisible" width="70%">
|
||||
<member-change-info ref="memberChangeInfoRef"></member-change-info>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog title="修改福利号码" :visible.sync="changeWelfareMobileVisible" append-to-body width="30%">
|
||||
<el-form :model="welfareFormData" label-width="80px">
|
||||
<el-form-item label="姓名">
|
||||
<el-input :value="welfareFormData.username" disabled></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="工号">
|
||||
<el-input :value="welfareFormData.loginname" disabled></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="手机号">
|
||||
<el-input :value="welfareFormData.mobile" disabled></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="福利号码" prop="welfareMobile"
|
||||
:rules="[
|
||||
{required: true, message: '请输入福利号码', trigger: 'blur'},
|
||||
{
|
||||
pattern: /^1[3-9]\\d{9}$/,
|
||||
message: '请输入有效的手机号码',
|
||||
trigger: 'blur'
|
||||
}]">
|
||||
<el-input v-model="welfareFormData.welfareMobile"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="changeWelfareMobileVisible = false">取消</el-button>
|
||||
<el-button type="primary" @click="changeWelfareMobile">确定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
</div>
|
||||
`,
|
||||
mixins: [initTableMixins],
|
||||
@@ -152,28 +187,30 @@ const MEMBER_MANAGE_TABLE = {
|
||||
return {
|
||||
changeTypeData: [],
|
||||
tableColumns: [
|
||||
{prop: "loginname", label: "工号", sortable: true},
|
||||
{prop: "username", label: "姓名", sortable: true},
|
||||
{prop: "sex", label: "性别", sortable: true, width: "100px"},
|
||||
{prop: "birthday", label: "出生年月", sortable: true},
|
||||
{prop: "userState", label: "在职状态", sortable: true},
|
||||
{prop: "preparedBy", label: "聘用方式", sortable: true},
|
||||
{prop: "postDoctoralJoinDate", label: "进站时间", sortable: true},
|
||||
{prop: "personType", label: "人员类型", sortable: true},
|
||||
{prop: "unionName", label: "所属工会", sortable: true},
|
||||
{prop: "unitName", label: "所属单位", sortable: true}
|
||||
{ prop: "loginname", label: "工号", sortable: true },
|
||||
{ prop: "username", label: "姓名", sortable: true },
|
||||
{ prop: "sex", label: "性别", sortable: true, width: "100px" },
|
||||
{ prop: "birthday", label: "出生年月", sortable: true },
|
||||
{ prop: "userState", label: "在职状态", sortable: true },
|
||||
{ prop: "preparedBy", label: "聘用方式", sortable: true },
|
||||
{ prop: "postDoctoralJoinDate", label: "进站时间", sortable: true },
|
||||
{ prop: "personType", label: "人员类型", sortable: true },
|
||||
{ prop: "unionName", label: "所属工会", sortable: true },
|
||||
{ prop: "unitName", label: "所属单位", sortable: true }
|
||||
],
|
||||
changeInfoVisible: false,
|
||||
userId: "",
|
||||
pageForm: {
|
||||
isMember: 1,
|
||||
changed: 2
|
||||
}
|
||||
},
|
||||
changeWelfareMobileVisible: false,
|
||||
welfareFormData: {}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
dropdownCommand(command) {
|
||||
const {type, data} = command
|
||||
const { type, data } = command
|
||||
if (type === "view") {
|
||||
this.openView(data.id)
|
||||
} else if (type === "change") {
|
||||
@@ -182,8 +219,34 @@ const MEMBER_MANAGE_TABLE = {
|
||||
this.setModelWorker(data.id)
|
||||
} else if (type === "cancelModelWorker") {
|
||||
this.cancelModelWorker(data.id)
|
||||
} else if (type === "changeWelfareMobile") {
|
||||
this.welfareFormData = {
|
||||
id: data.id,
|
||||
username: data.username,
|
||||
loginname: data.loginname,
|
||||
mobile: data.mobile,
|
||||
welfareMobile: data.welfareMobile
|
||||
}
|
||||
this.changeWelfareMobileVisible = true
|
||||
}
|
||||
},
|
||||
|
||||
changeWelfareMobile() {
|
||||
this.$confirm("确定要将" + this.welfareFormData.username + "的福利号码修改为:" + this.welfareFormData.welfareMobile + "吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
})
|
||||
.then(() => {
|
||||
this.$axios.post("/platform/member/branchUnion/manage/list/changeWelfareMobile", this.welfareFormData).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$message.success(res.msg)
|
||||
this.changeWelfareMobileVisible = false
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
setModelWorker(userId) {
|
||||
this.$confirm("确定要将此教工设置为劳模吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
@@ -191,7 +254,7 @@ const MEMBER_MANAGE_TABLE = {
|
||||
type: "warning"
|
||||
})
|
||||
.then(() => {
|
||||
this.$axios.post("/platform/member/modelWorker/manage/setModelWorker", {userId: userId}).then((res) => {
|
||||
this.$axios.post("/platform/member/modelWorker/manage/setModelWorker", { userId: userId }).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$message.success(res.msg)
|
||||
this.$emit("refresh-table")
|
||||
@@ -208,7 +271,7 @@ const MEMBER_MANAGE_TABLE = {
|
||||
type: "warning"
|
||||
})
|
||||
.then(() => {
|
||||
this.$axios.post("/platform/member/modelWorker/manage/cancelModelWorker", {userIds: JSON.stringify([userId])})
|
||||
this.$axios.post("/platform/member/modelWorker/manage/cancelModelWorker", { userIds: JSON.stringify([userId]) })
|
||||
.then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$message.success(res.msg)
|
||||
@@ -220,7 +283,7 @@ const MEMBER_MANAGE_TABLE = {
|
||||
})
|
||||
},
|
||||
openChange(data) {
|
||||
this.$emit("change-member", {id: data.id, username: data.username})
|
||||
this.$emit("change-member", { id: data.id, username: data.username })
|
||||
},
|
||||
openView(id) {
|
||||
this.$emit("view-member", id)
|
||||
|
||||
@@ -33,14 +33,14 @@ const mine = {
|
||||
</div>
|
||||
|
||||
<div class="info-list">
|
||||
<!-- <div class="info-item">-->
|
||||
<!-- <van-icon name="user-o"></van-icon>-->
|
||||
<!-- <span class="item-label">人员类型</span>-->
|
||||
<!-- <span class="info-value">{{ $store.state.user.personType }}</span>-->
|
||||
<!-- </div>-->
|
||||
<div class="info-item">
|
||||
<van-icon name="user-o"></van-icon>
|
||||
<span class="item-label">人员类型</span>
|
||||
<span class="info-value">{{ $store.state.user.personType }}</span>
|
||||
</div>
|
||||
<div class="info-item">
|
||||
<van-icon name="user-o"></van-icon>
|
||||
<span class="item-label">人事编制</span>
|
||||
<span class="item-label">在职状态</span>
|
||||
<span class="info-value">{{ $store.state.user.userState }}</span>
|
||||
</div>
|
||||
<div class="info-item">
|
||||
@@ -65,6 +65,13 @@ const mine = {
|
||||
</span>
|
||||
</van-cell>
|
||||
|
||||
<van-cell is-link @click="$pjaxReplace('/platform/signature/h5')" class="action-cell">
|
||||
<span class="cell-title" slot="title">
|
||||
<van-icon name="edit" class="cell-icon"></van-icon>
|
||||
福利号码
|
||||
</span>
|
||||
</van-cell>
|
||||
|
||||
<van-cell is-link @click="$pjaxReplace('/platform/signature/h5')" class="action-cell">
|
||||
<span class="cell-title" slot="title">
|
||||
<van-icon name="edit" class="cell-icon"></van-icon>
|
||||
@@ -72,12 +79,12 @@ const mine = {
|
||||
</span>
|
||||
</van-cell>
|
||||
|
||||
<!-- <van-cell :value="$store.state.user.totalIntegral" is-link @click="$pjaxReplace('/platform/integral/records/h5')" class="action-cell">-->
|
||||
<!-- <span class="cell-title" slot="title">-->
|
||||
<!-- <van-icon name="points" class="cell-icon"></van-icon>-->
|
||||
<!-- 我的积分-->
|
||||
<!-- </span>-->
|
||||
<!-- </van-cell>-->
|
||||
<!-- <van-cell :value="$store.state.user.totalIntegral" is-link @click="$pjaxReplace('/platform/integral/records/h5')" class="action-cell">-->
|
||||
<!-- <span class="cell-title" slot="title">-->
|
||||
<!-- <van-icon name="points" class="cell-icon"></van-icon>-->
|
||||
<!-- 我的积分-->
|
||||
<!-- </span>-->
|
||||
<!-- </van-cell>-->
|
||||
</van-cell-group>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -2,9 +2,87 @@
|
||||
layout("/layouts/platform_h5.html"){
|
||||
#-->
|
||||
|
||||
<style>
|
||||
.van-cell__value {
|
||||
color: #000000;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<van-nav-bar title="个人信息" @click-left="historyBack" left-arrow left-text="返回" placeholder fixed></van-nav-bar>
|
||||
<member-info :user-id="userId" ref="memberInfoRef"></member-info>
|
||||
<!-- <member-info :user-id="userId" ref="memberInfoRef"></member-info>-->
|
||||
|
||||
<div class="detail-container">
|
||||
<van-cell-group title="基本信息">
|
||||
<van-cell title="工号" :value="formData.loginname" readonly></van-cell>
|
||||
<van-cell title="姓名" :value="formData.username" readonly></van-cell>
|
||||
<van-cell title="性别" :value="formData.sex" readonly></van-cell>
|
||||
<van-cell title="出生日期" :value="formData.birthDay" readonly></van-cell>
|
||||
<van-cell title="民主" :value="formData.nation" readonly></van-cell>
|
||||
<van-cell title="籍贯" :value="formData.nativePlace" readonly></van-cell>
|
||||
<van-cell title="国籍" :value="formData.nationality" readonly></van-cell>
|
||||
<van-cell title="证件类别" :value="formData.idCardType" readonly></van-cell>
|
||||
<van-cell title="证件号码" :value="formData.idCard" readonly></van-cell>
|
||||
<van-cell title="政治面貌" :value="formData.political" readonly></van-cell>
|
||||
<van-cell title="入党时间" :value="formData.joinPartyDate" readonly></van-cell>
|
||||
<van-cell title="来校时间" :value="formData.arrivalAtSchoolDate" readonly></van-cell>
|
||||
<van-cell title="身份类别" :value="formData.identityType" readonly></van-cell>
|
||||
<van-cell title="聘用方式" :value="formData.preparedBy" readonly></van-cell>
|
||||
<van-cell title="教职工类别" :value="formData.personType" readonly></van-cell>
|
||||
<van-cell title="在职状态" :value="formData.userState" readonly></van-cell>
|
||||
<van-cell title="预计离退休时间" :value="formData.retireDate" readonly></van-cell>
|
||||
<van-cell title="联系电话" :value="formData.mobile" readonly></van-cell>
|
||||
<van-cell title="电子邮箱" :value="formData.email" readonly></van-cell>
|
||||
</van-cell-group>
|
||||
|
||||
<van-cell-group title="会员信息">
|
||||
<van-cell title="是否会员">{{formData.member === 1 ? '是' : '否'}}</van-cell>
|
||||
<van-cell title="所属单位">{{ formData.unitName }}</van-cell>
|
||||
<van-cell title="所属分工会">{{ formData.unionName }}</van-cell>
|
||||
<van-cell title="福利号码">
|
||||
{{ formData.welfareMobile || '暂无' }}
|
||||
<span style="color: var(--color-primary)" @click="openWelfareMobile">
|
||||
修改
|
||||
<van-icon name="edit"></van-icon>
|
||||
</span>
|
||||
<!-- <van-button type="primary" size="mini">修改</van-button>-->
|
||||
</van-cell>
|
||||
</van-cell-group>
|
||||
|
||||
<van-cell-group title="学历信息">
|
||||
<van-cell title="最高学历">{{ formData.education }}</van-cell>
|
||||
<van-cell title="最高学位">{{ formData.academicDegree }}</van-cell>
|
||||
</van-cell-group>
|
||||
|
||||
<van-cell-group title="职称信息">
|
||||
<van-cell title="职称">{{ formData.technicalTitle }}</van-cell>
|
||||
<van-cell title="职称级别">{{ formData.technicalTitleLevel }}</van-cell>
|
||||
</van-cell-group>
|
||||
|
||||
<van-cell-group title="职务信息">
|
||||
<van-cell title="现聘职务">{{ formData.position }}</van-cell>
|
||||
<van-cell title="现聘职级">{{ formData.positionLevel }}</van-cell>
|
||||
<van-cell title="职员等级">{{ formData.employeeLevel }}</van-cell>
|
||||
</van-cell-group>
|
||||
</div>
|
||||
|
||||
<!-- 福利号码修改弹窗 -->
|
||||
<van-action-sheet v-model="showWelfareMobileSheet" title="修改福利号码" :round="true">
|
||||
<div style="padding: 20px">
|
||||
<van-field
|
||||
v-model="newWelfareMobile"
|
||||
label="福利号码"
|
||||
placeholder="请输入福利号码"
|
||||
type="tel"
|
||||
maxlength="11"
|
||||
:rules="[{ required: true, message: '请输入福利号码' }, { pattern: /^1[3-9]\d{9}$/, message: '请输入正确的手机号码' }]"
|
||||
></van-field>
|
||||
<div style="margin-top: 20px; display: flex; gap: 12px">
|
||||
<van-button type="default" block @click="cancelWelfareMobile">取消</van-button>
|
||||
<van-button type="primary" block @click="saveWelfareMobile" :loading="saving">保存</van-button>
|
||||
</div>
|
||||
</div>
|
||||
</van-action-sheet>
|
||||
</div>
|
||||
<script>
|
||||
<!--#include("/platform/zhghh5/staffmanage/member/common/mobileMemberInfo.js"){}#-->
|
||||
@@ -13,19 +91,68 @@ layout("/layouts/platform_h5.html"){
|
||||
store,
|
||||
data() {
|
||||
return {
|
||||
userId: ""
|
||||
userId: "",
|
||||
formData: {},
|
||||
showWelfareMobileSheet: false,
|
||||
newWelfareMobile: "",
|
||||
saving: false
|
||||
}
|
||||
},
|
||||
components: {
|
||||
"member-info": MOBILE_MEMBER_INFO
|
||||
},
|
||||
// components: {
|
||||
// "member-info": MOBILE_MEMBER_INFO
|
||||
// },
|
||||
methods: {
|
||||
viewInfo() {
|
||||
this.userId = this.$store.state.user.id
|
||||
},
|
||||
getInfo() {
|
||||
this.$axios.post("/platform/member/apply/common/findOne?id=" + this.$store.state.user.id).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.formData = res.data
|
||||
}
|
||||
})
|
||||
},
|
||||
openWelfareMobile() {
|
||||
this.newWelfareMobile = this.formData.welfareMobile || ""
|
||||
this.showWelfareMobileSheet = true
|
||||
},
|
||||
cancelWelfareMobile() {
|
||||
this.showWelfareMobileSheet = false
|
||||
this.newWelfareMobile = ""
|
||||
},
|
||||
saveWelfareMobile() {
|
||||
if (!this.newWelfareMobile) {
|
||||
this.$toast("请输入福利号码")
|
||||
return
|
||||
}
|
||||
if (!/^1[3-9]\d{9}$/.test(this.newWelfareMobile)) {
|
||||
this.$toast("请输入正确的手机号码")
|
||||
return
|
||||
}
|
||||
|
||||
this.saving = true
|
||||
this.$axios
|
||||
.post("/platform/h5/updateWelfareMobile", { mobile: this.newWelfareMobile })
|
||||
.then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.getInfo()
|
||||
this.showWelfareMobileSheet = false
|
||||
this.$toast.success("修改成功")
|
||||
} else {
|
||||
this.$toast(res.msg || "修改失败")
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
this.$toast("网络错误,请重试")
|
||||
})
|
||||
.finally(() => {
|
||||
this.saving = false
|
||||
})
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.viewInfo()
|
||||
// this.viewInfo()
|
||||
this.getInfo()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
<!--#
|
||||
layout("/layouts/platform_h5.html"){
|
||||
#-->
|
||||
|
||||
<div id="app" v-cloak></div>
|
||||
|
||||
<script>
|
||||
new Vue({
|
||||
el: "#app",
|
||||
store,
|
||||
data() {
|
||||
return {
|
||||
userId: "",
|
||||
formData: {}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
viewInfo() {
|
||||
this.userId = this.$store.state.user.id
|
||||
},
|
||||
getInfo() {}
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -5,8 +5,6 @@ import cn.afterturn.easypoi.excel.ExcelImportUtil;
|
||||
import cn.afterturn.easypoi.excel.annotation.Excel;
|
||||
import cn.afterturn.easypoi.excel.entity.ImportParams;
|
||||
import cn.hutool.core.codec.Base64;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.io.FileUtil;
|
||||
import cn.hutool.core.util.CharsetUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.crypto.digest.DigestUtil;
|
||||
@@ -17,22 +15,17 @@ import cn.hutool.json.JSONObject;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.budwk.app.base.utils.PwdUtil;
|
||||
import com.budwk.app.sys.enums.SysDataUpdateMode;
|
||||
import com.budwk.app.sys.models.*;
|
||||
import com.budwk.app.sys.models.Sys_dict;
|
||||
import com.budwk.app.sys.models.Sys_unit;
|
||||
import com.budwk.app.sys.models.Sys_user;
|
||||
import com.budwk.app.sys.models.Sys_user_role;
|
||||
import com.budwk.app.sys.param.SysDataUserUpdateParam;
|
||||
import com.budwk.app.sys.services.SysDictService;
|
||||
import com.budwk.app.sys.services.SysUnitService;
|
||||
import com.budwk.app.sys.services.SysUserService;
|
||||
import com.budwk.app.sys.services.impl.SysDataUserAllUpdateServiceImpl;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import lombok.Data;
|
||||
import org.apache.poi.ss.usermodel.Cell;
|
||||
import org.apache.poi.ss.usermodel.Row;
|
||||
import org.apache.poi.ss.usermodel.Sheet;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.apache.poi.ss.util.CellRangeAddress;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.nutz.boot.test.junit4.NbJUnit4Runner;
|
||||
@@ -41,22 +34,14 @@ import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.json.Json;
|
||||
import org.nutz.lang.Files;
|
||||
import org.nutz.lang.Lang;
|
||||
import org.nutz.lang.random.R;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
|
||||
import javax.validation.ConstraintViolation;
|
||||
import javax.validation.Validation;
|
||||
import javax.validation.Validator;
|
||||
import javax.validation.ValidatorFactory;
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
@IocBean
|
||||
@RunWith(NbJUnit4Runner.class)
|
||||
@@ -206,19 +191,19 @@ public class JugTest {
|
||||
|
||||
} while (skip < totalCount);
|
||||
|
||||
Files.write(new File("C:\\Users\\administrator\\Desktop\\博士后.txt"),allUsers);
|
||||
Files.write(new File("C:\\Users\\administrator\\Desktop\\博士后.txt"), allUsers);
|
||||
System.out.println(allUsers.size());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void userPwd(){
|
||||
public void userPwd() {
|
||||
List<Sys_user> users = dao.query(Sys_user.class, Cnd.NEW());
|
||||
String pwd = "1";
|
||||
for (Sys_user user : users) {
|
||||
user.setSalt(R.UU32());
|
||||
user.setPassword(PwdUtil.getPassword(pwd, user.getSalt()));
|
||||
}
|
||||
dao.update(users,"password|salt");
|
||||
dao.update(users, "password|salt");
|
||||
}
|
||||
|
||||
@Inject
|
||||
@@ -234,7 +219,7 @@ public class JugTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void bsh(){
|
||||
public void bsh() {
|
||||
List<String> bsh = new ArrayList<>();
|
||||
bsh.add("91036");
|
||||
bsh.add("91035");
|
||||
@@ -315,9 +300,9 @@ public class JugTest {
|
||||
|
||||
List<Sys_user> users = dao.query(Sys_user.class, Cnd.where(Sys_user::getLoginname, "in", bsh));
|
||||
|
||||
for (Sys_user user : users){
|
||||
for (Sys_user user : users) {
|
||||
user.setMember(true);
|
||||
dao.update(users,"member");
|
||||
dao.update(users, "member");
|
||||
|
||||
Sys_user_role user_role = new Sys_user_role();
|
||||
user_role.setUserId(user.getId());
|
||||
@@ -326,11 +311,89 @@ public class JugTest {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test0001() {
|
||||
SysDataUserUpdateParam param = new SysDataUserUpdateParam();
|
||||
param.setPullTime("2025-06-20 15:21:16");
|
||||
param.setUpdateMode(SysDataUpdateMode.ALL.name());
|
||||
sysDataUserUpdateService.update(param);
|
||||
}
|
||||
|
||||
|
||||
// 中国大陆手机号正则表达式
|
||||
private static final String MOBILE_REGEX = "^1[3-9]\\d{9}$";
|
||||
private static final Pattern MOBILE_PATTERN = Pattern.compile(MOBILE_REGEX);
|
||||
|
||||
/**
|
||||
* 验证手机号格式
|
||||
*/
|
||||
private boolean isValidMobile(String mobile) {
|
||||
if (StrUtil.isBlank(mobile)) {
|
||||
return false;
|
||||
}
|
||||
return MOBILE_PATTERN.matcher(mobile.trim()).matches();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void importWelfareMobile() {
|
||||
try {
|
||||
File file = new File("C:\\Users\\jug\\Desktop\\副本2025年南师大端午发放清单0915.xlsx");
|
||||
ImportParams params = new ImportParams();
|
||||
|
||||
List<User> list = ExcelImportUtil.importExcel(file, User.class, params);
|
||||
|
||||
int successCount = 0;
|
||||
int failCount = 0;
|
||||
|
||||
for (User user : list) {
|
||||
String sjh = user.getSjh();
|
||||
String loginname = user.getGh();
|
||||
|
||||
// 验证手机号是否正确
|
||||
if (isValidMobile(sjh) && StringUtils.isNotBlank(loginname)) {
|
||||
try {
|
||||
// 更新数据库
|
||||
int result = dao.update(Sys_user.class,
|
||||
Chain.make("welfareMobile", sjh),
|
||||
Cnd.where("loginname", "=", loginname));
|
||||
|
||||
if (result > 0) {
|
||||
successCount++;
|
||||
System.out.println("更新成功:工号=" + loginname + ", 手机号=" + sjh);
|
||||
} else {
|
||||
failCount++;
|
||||
System.out.println("更新失败(未找到匹配记录):工号=" + loginname);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
failCount++;
|
||||
System.out.println("数据库更新异常:工号=" + loginname + ", 错误:" + e.getMessage());
|
||||
}
|
||||
} else {
|
||||
failCount++;
|
||||
System.out.println("手机号格式无效或工号为空:工号=" + loginname + ", 手机号=" + sjh);
|
||||
}
|
||||
}
|
||||
|
||||
System.out.println("导入完成!成功:" + successCount + "条,失败:" + failCount + "条");
|
||||
|
||||
} catch (Exception e) {
|
||||
System.err.println("导入Excel文件时发生异常:" + e.getMessage());
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Data
|
||||
public static class User {
|
||||
|
||||
@Excel(name = "工号")
|
||||
private String gh;
|
||||
|
||||
@Excel(name = "手机号码")
|
||||
private String sjh;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user