This commit is contained in:
Paidax
2025-09-23 09:53:41 +08:00
parent af146d6c9b
commit 0ab932e213
54 changed files with 1754 additions and 1138 deletions
@@ -18,4 +18,6 @@ public @interface DataCenterColumn {
*/
String key();
// 字典码表名称
String dict() default "";
}
@@ -353,7 +353,8 @@ public class SysUnionController {
@ApiOperation("分工会组成单位穿梭框数据")
@SaCheckPermission("sys.manager.union.partUnit")
public Result branchUnionPartUnitTransferData(String unionId) {
List<Sys_unit> units = dao.query(Sys_unit.class, Cnd.where("unitLevel", "=", 2).asc("unitcode"));
// List<Sys_unit> units = dao.query(Sys_unit.class, Cnd.where("unitLevel", "=", 2).asc("unitcode"));
List<Sys_unit> units = dao.query(Sys_unit.class, Cnd.where("unitTypeCode", "=", "1").asc("unitcode"));
List<String> selectUnitIds = units.stream().filter(unit -> StrUtil.isNotBlank(unit.getUnionId()) && unit.getUnionId().equals(unionId)).map(Sys_unit::getId).toList();
List<Sys_unit> matchUnits = units.stream().filter(unit -> StrUtil.isBlank(unit.getUnionId()) || (StrUtil.isNotBlank(unit.getUnionId()) && unit.getUnionId().equals(unionId))).toList();
NutMap transferData = NutMap.NEW().addv("selectUnitIds", selectUnitIds).addv("allUnits", matchUnits);
@@ -77,7 +77,10 @@ public class SysUnitController {
@SaCheckLogin
public Object pageData(PageForm pageForm, String unitName, Integer unitLevel) {
Cnd cnd = Cnd.NEW();
cnd.and("parentId", "is not", null).andEX("unitLevel", "=", unitLevel).asc("unitLevel").asc("unitcode");
// 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(Cnd.likeEX("name", unitName));
Pagination<Sys_unit> listPage = sysUnitService.listPage(pageForm.getPageNumber(), pageForm.getPageSize(), Sys_unit.class, cnd);
@@ -0,0 +1,31 @@
package com.budwk.app.sys.enums;
import lombok.Getter;
/**
* @version 1.0
* @Author zzr
* @nameApi2FinanceFiledMap
* @Date 2025/9/16 9:51
* @注释 财务会费字段映射
*/
@Getter
public enum Api2FinanceFiledMap {
// 工号
RYDM("rydm", "loginname"),
// 人员名称
RYMC("rymc", "username"),
// 编制会费
HF("hf", "name"),
// 合同制会费
HF2("hf2", "unitType");
public final String apiField;
public final String dbColumn;
Api2FinanceFiledMap(String apiField, String dbColumn) {
this.apiField = apiField;
this.dbColumn = dbColumn;
}
}
@@ -0,0 +1,32 @@
package com.budwk.app.sys.enums;
import lombok.Getter;
/**
* @version 1.0
* @Author zzr
* @nameApi2UnitFiledMap
* @Date 2025/9/16 8:52
* @注释 单位接口转单位字段映射
*/
@Getter
public enum Api2UnitFiledMap {
ZZJGDM("zzjgdm", "id"),
ZZJGMC("zzjgmc", "name"),
FJZZJGDM("fjzzjgdm", "parentId"),
JDCJDM("jdcjdm", "unitLevel"),
CJ_XYDWH("cj_xydwh", "divisionCollegeCode"),
JGLX("jglx", "institutionType"),
BMLB("bmlb", "unitType");
// SFQY("sfqy", "delFlag");
public final String apiField;
public final String dbColumn;
Api2UnitFiledMap(String apiField, String dbColumn) {
this.apiField = apiField;
this.dbColumn = dbColumn;
}
}
@@ -85,22 +85,27 @@ public class SysRoleEventListener implements RoleEventListener {
* @param message 订阅消息
*/
private void removeRole(RoleEventMsg message) {
Sys_role role = dao.fetch(Sys_role.class, Cnd.where("code", "=", message.getRoleCode()));
if (ObjectUtil.isEmpty(role)) {
return;
}
// 判断传过来的东西
if (ObjectUtil.isAllNotEmpty(message.getUserIds(), message.getUnitId(), message.getRoleCode())) {
dao.clear(Sys_user_role.class,
Cnd.where("userId", "in", message.getUserIds())
.and("unitId", "=", message.getUnitId())
.and("roleCode", "=", message.getRoleCode())
.and("roleId", "=", role.getId())
);
} else if (ObjectUtil.isAllNotEmpty(message.getUserIds(), message.getRoleCode())) {
dao.clear(Sys_user_role.class,
Cnd.where("userId", "in", message.getUserIds())
.and("roleCode", "=", message.getRoleCode())
.and("roleId", "=", role.getId())
);
} else if (ObjectUtil.isAllNotEmpty(message.getUnitId(), message.getUnitId())) {
dao.clear(Sys_user_role.class,
Cnd.where("unitId", "in", message.getUnitId())
.and("roleCode", "=", message.getRoleCode())
.and("roleId", "=", role.getId())
);
}
}
@@ -0,0 +1,34 @@
package com.budwk.app.sys.models;
import com.budwk.app.base.model.BaseModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.nutz.dao.entity.annotation.*;
/**
* @version 1.0
* @Author zzr
* @nameSys_data_dict
* @Date 2025/9/22 16:43
* @注释
*/
@Data
@Table
@EqualsAndHashCode(callSuper = true)
public class Sys_data_dict extends BaseModel {
@Column
@Comment("父级编码")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String parentCode;
@Column
@Comment("名称")
@ColDefine(type = ColType.VARCHAR, width = 100)
private String name;
@Column
@Comment("编码")
@ColDefine(type = ColType.VARCHAR, width = 100)
private String code;
}
@@ -11,6 +11,7 @@ import org.nutz.dao.interceptor.annotation.PrevInsert;
import org.nutz.json.JsonField;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;
@@ -35,7 +36,7 @@ public class Sys_user extends BaseModel implements Serializable {
@Column
@Comment("工号")
@ColDefine(type = ColType.VARCHAR, width = 120)
@DataCenterColumn(name = "工号", key = "zgh")
@DataCenterColumn(name = "工号", key = "gh")
private String loginname;
@Column
@@ -47,7 +48,6 @@ public class Sys_user extends BaseModel implements Serializable {
@Column
@Comment("性别")
@ColDefine(type = ColType.VARCHAR, width = 10)
@DataCenterColumn(name = "性别", key = "xbmc")
private String sex;
@Column
@@ -69,37 +69,36 @@ public class Sys_user extends BaseModel implements Serializable {
@Column
@Comment("政治面貌")
@ColDefine(type = ColType.VARCHAR, width = 100)
@DataCenterColumn(name = "政治面貌", key = "zzmmmc")
@DataCenterColumn(name = "政治面貌", key = "zzmmm", dict = "USER_POLITICAL")
private String political;
@Column
@ColDefine(type = ColType.DATE)
@Comment("入党时间")
@DataCenterColumn(name = "入党时间", key = "rdsj")
private Date joinPartyDate;
@Column
@Comment("民族")
@ColDefine(type = ColType.VARCHAR, width = 20)
@DataCenterColumn(name = "民族", key = "mzmc")
@DataCenterColumn(name = "民族", key = "mzm", dict = "USER_NATION")
private String nation;
@Column
@Comment("籍贯")
@ColDefine(type = ColType.VARCHAR, width = 100)
@DataCenterColumn(name = "籍贯", key = "jgmc")
@DataCenterColumn(name = "籍贯", key = "dqm")
private String nativePlace;
@Column
@Comment("国籍")
@ColDefine(type = ColType.VARCHAR, width = 20)
@DataCenterColumn(name = "国籍", key = "gjdqmc")
@DataCenterColumn(name = "国籍", key = "gjdqm", dict = "USER_NATIONALITY")
private String nationality;
@Column
@Comment("证件类型")
@ColDefine(type = ColType.VARCHAR, width = 30)
@DataCenterColumn(name = "证件类型", key = "sfzjlxmc")
@DataCenterColumn(name = "证件类型", key = "sfzjlxm", dict = "USER_IDENTITY_TYPE")
private String idCardType;
@Column
@@ -111,60 +110,79 @@ public class Sys_user extends BaseModel implements Serializable {
@Column
@Comment("手机号码")
@ColDefine(type = ColType.VARCHAR, width = 32)
@DataCenterColumn(name = "手机号码", key = "sjh")
// @DataCenterColumn(name = "手机号码", key = "sjh")
private String mobile;
@Column
@Comment("学历")
@ColDefine(type = ColType.VARCHAR, width = 20)
@DataCenterColumn(name = "学历", key = "zgxlmc")
// @DataCenterColumn(name = "学历", key = "zgxlmc")
private String education;
@Column
@Comment("婚姻状况")
@ColDefine(type = ColType.VARCHAR, width = 20)
@DataCenterColumn(name = "婚姻状况", key = "hyztm", dict = "USER_MARRIAGE")
private String marriage;
@Column
@Comment("学位")
@ColDefine(type = ColType.VARCHAR, width = 50)
@DataCenterColumn(name = "学位", key = "zgxwmc")
// @DataCenterColumn(name = "学位", key = "zgxwmc")
private String academicDegree;
@Column
@Comment("技术职称")
@Comment("岗位类别")
@ColDefine(type = ColType.VARCHAR, width = 50)
@DataCenterColumn(name = "技术职称", key = "zyjszwmc")
private String technicalTitle;
@DataCenterColumn(name = "岗位类别", key = "prgw")
private String jobCategory;
@Column
@Comment("技术职称级别")
@Comment("职称")
@ColDefine(type = ColType.VARCHAR, width = 50)
@DataCenterColumn(name = "技术职称级别", key = "zyjszwjbmc")
private String technicalTitleLevel;
@DataCenterColumn(name = "职称", key = "zc")
private String professionalTitle;
@Column
@Comment("")
@Comment("")
@ColDefine(type = ColType.VARCHAR, width = 50)
@DataCenterColumn(name = "", key = "gbzw")
private String position;
@DataCenterColumn(name = "", key = "zj")
private String professionalLevel;
@Column
@Comment("务级别")
@Comment("工来源")
@ColDefine(type = ColType.VARCHAR, width = 50)
@DataCenterColumn(name = "务级别", key = "gbzwjbmc")
@DataCenterColumn(name = "工来源", key = "zgly")
private String employeeSource;
@Column
@Comment("行政级别(用于管理岗位)")
@ColDefine(type = ColType.VARCHAR, width = 50)
@DataCenterColumn(name = "行政级别(用于管理岗位)", key = "xzjb")
private String administrativeLevel;
@Column
@Comment("岗位系列")
@ColDefine(type = ColType.VARCHAR, width = 50)
@DataCenterColumn(name = "岗位系列", key = "gwxl")
private String positionSeries;
@Column
@Comment("岗级")
@ColDefine(type = ColType.VARCHAR, width = 50)
@DataCenterColumn(name = "岗级", key = "gj")
private String positionLevel;
@Column
@Comment("职员级别")
@Comment("行政岗级")
@ColDefine(type = ColType.VARCHAR, width = 50)
@DataCenterColumn(name = "职员级别", key = "zydjmc")
private String employeeLevel;
@DataCenterColumn(name = "行政岗级", key = "xzgj")
private String administrativePositionLevel;
@Column
@Comment("来校时间")
@ColDefine(type = ColType.VARCHAR, width = 10)
@DataCenterColumn(name = "来校时间", key = "lxny")
@DataCenterColumn(name = "来校时间", key = "lxrq")
private String arrivalAtSchoolDate;
@Column
@@ -176,21 +194,33 @@ public class Sys_user extends BaseModel implements Serializable {
@Column
@Comment("在职状态")
@ColDefine(type = ColType.VARCHAR, width = 30)
@DataCenterColumn(name = "状态", key = "jzgdqztmc")
@DataCenterColumn(name = "状态", key = "zgzt")
private String userState;
@Column
@Comment("人员类别")
@Comment("教职工类别")
@ColDefine(type = ColType.VARCHAR, width = 30)
@DataCenterColumn(name = "人员类别", key = "jzglbmc")
@DataCenterColumn(name = "教职工类别", key = "jzglbm", dict = "USER_PERSON_TYPE")
private String personType;
@Column
@Comment("聘用方式")
@Comment("编制类别码")
@ColDefine(type = ColType.VARCHAR, width = 30)
@DataCenterColumn(name = "聘用方式", key = "yrfsmc")
@DataCenterColumn(name = "编制类别码", key = "bzlxm", dict = "USER_PREPARED_BY_TYPE")
private String preparedBy;
@Column
@Comment("从教年月")
@ColDefine(type = ColType.DATE)
@DataCenterColumn(name = "从教年月", key = "cjny")
private Date teachingTime;
@Column
@Comment("预计离校时间/最后离校时间")
@ColDefine(type = ColType.DATE)
@DataCenterColumn(name = "预计离校时间/最后离校时间", key = "yjlxsj")
private Date expectedLeaveSchoolDate;
@Column
@Comment("退休时间")
@ColDefine(type = ColType.DATE)
@@ -199,7 +229,7 @@ public class Sys_user extends BaseModel implements Serializable {
@Column
@Comment("博士后进站时间")
@ColDefine(type = ColType.DATE)
@DataCenterColumn(name = "博士后进站时间", key = "bhzjzsj")
// @DataCenterColumn(name = "博士后进站时间", key = "bhzjzsj")
private Date postDoctoralJoinDate;
@Column
@@ -252,6 +282,16 @@ public class Sys_user extends BaseModel implements Serializable {
@ColDefine(type = ColType.DATETIME)
private Date memberTime;
@Column
@Comment("编制会费")
@ColDefine(customType = "decimal(10,2)")
private BigDecimal preparationMemberFee;
@Column
@Comment("合同制会费")
@ColDefine(customType = "decimal(10,2)")
private BigDecimal contractMemberFee;
@Column
@Comment("是否福利会员")
@ColDefine(type = ColType.BOOLEAN)
@@ -280,16 +320,6 @@ public class Sys_user extends BaseModel implements Serializable {
@ColDefine(type = ColType.VARCHAR, customType = "text")
private String personalData;
@Column
@Comment("是否是劳模")
@ColDefine(type = ColType.BOOLEAN)
@Default(value = "0")
private Boolean isModelWorker;
@Column
@Comment("劳模资料")
@ColDefine(type = ColType.MYSQL_JSON)
private List<JSONObject> modelWorkerFiles;
@Column
@Comment("常用审批意见")
@@ -0,0 +1,106 @@
package com.budwk.app.sys.services.impl;
import cn.hutool.http.HttpRequest;
import cn.hutool.http.HttpUtil;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import com.budwk.app.base.config.DataCenterProperties;
import com.budwk.app.base.service.impl.BaseServiceImpl;
import com.budwk.app.sys.models.Sys_data_dict;
import com.budwk.app.sys.models.Sys_dict;
import com.budwk.app.sys.services.SysDataDictPullService;
import com.budwk.app.sys.services.SysDictService;
import lombok.extern.slf4j.Slf4j;
import org.nutz.aop.interceptor.ioc.TransAop;
import org.nutz.dao.Cnd;
import org.nutz.dao.Dao;
import org.nutz.ioc.aop.Aop;
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 java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
* @version 1.0
* @Author zzr
* @nameSysDataDictPullServiceImpl
* @Date 2025/9/22 11:37
* @注释
*/
@Slf4j
@IocBean(args = {"refer:dao"})
public class SysDataDictPullServiceImpl extends BaseServiceImpl<Sys_dict> implements SysDataDictPullService {
@Inject
private DataCenterProperties dcPro;
@Inject
private SysDictService dictService;
// code
private final static String KEY_PREFIX = "user_";
public SysDataDictPullServiceImpl(Dao dao) {
super(dao);
}
@Override
@Aop(TransAop.READ_COMMITTED)
public void pullDataDict() {
Map<String, String> urls = dcPro.getUrls();
List<String> list = urls.keySet().stream().filter(o -> o.startsWith(KEY_PREFIX.toUpperCase())).toList();
List<Sys_data_dict> dataDictList = new ArrayList<>();
for (String key : list) {
// 获取配置
DataCenterProperties.Credential credential = dcPro.credential(key);
String url = credential.getUrl();
String token = credential.getToken();
// 请求数据
HttpRequest httpRequest = HttpUtil.createPost(url);
httpRequest.header("Content-Type", "application/json");
httpRequest.header("X-H3C-TOKEN", token);
httpRequest.body(JSONUtil.toJsonStr(Map.of()));
String resBody = httpRequest.execute().body();
JSONObject jsonBody = JSONUtil.parseObj(resBody);
if (jsonBody.getInt("code") != 200) {
log.error("获取{}字典数据失败,错误码: {};错误原因:{}", key, jsonBody.getInt("code"), jsonBody.getStr("msg"));
}
List<NutMap> data = Json.fromJsonAsList(NutMap.class, jsonBody.getStr("data"));
// 先删除
Sys_dict sysDict = dao().fetch(Sys_dict.class, Cnd.where(Sys_dict::getCode, "=", key));
dao().clear(Sys_dict.class, Cnd.where(Sys_dict::getParentId, "=", sysDict.getId()));
// 组合数据
data.forEach(o -> {
Sys_dict dict = new Sys_dict();
dict.setParentId(sysDict.getId());
dict.setPath(dictService.getSubPath("sys_dict", "path", sysDict.getPath()));
dict.setName(o.getString("xbname"));
dict.setCode(o.getString("xbname"));
dict.setDisabled(false);
dict.setHasChildren(false);
dao().insert(dict);
Sys_data_dict sysDataDict = new Sys_data_dict();
sysDataDict.setParentCode(key);
sysDataDict.setCode(o.getString("xbcode"));
sysDataDict.setName(o.getString("xbname"));
dataDictList.add(sysDataDict);
});
dao().insert(dataDictList);
}
}
}
@@ -0,0 +1,113 @@
package com.budwk.app.sys.services.impl;
import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HttpRequest;
import cn.hutool.http.HttpUtil;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import com.budwk.app.base.config.DataCenterProperties;
import com.budwk.app.base.exception.BaseException;
import com.budwk.app.base.service.impl.BaseServiceImpl;
import com.budwk.app.sys.enums.Api2UnitFiledMap;
import com.budwk.app.sys.models.Sys_unit;
import com.budwk.app.sys.services.SysDataUnitPullService;
import com.budwk.app.sys.utils.DataCenterUtil;
import lombok.extern.slf4j.Slf4j;
import org.nutz.aop.interceptor.ioc.TransAop;
import org.nutz.dao.Dao;
import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql;
import org.nutz.ioc.aop.Aop;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* @version 1.0
* @Author zzr
* @nameSysDataUnitPullServiceImpl
* @Date 2025/9/15 17:52
* @注释
*/
@Slf4j
@IocBean(args = {"refer:dao"})
public class SysDataUnitPullServiceImpl extends BaseServiceImpl<Sys_unit> implements SysDataUnitPullService {
@Inject
private DataCenterProperties dcPro;
public SysDataUnitPullServiceImpl(Dao dao) {
super(dao);
}
@Override
@Aop(TransAop.READ_COMMITTED)
public void updateUnits() {
Sql sql = Sqls.create("select id from sys_unit group by id");
sql.setCallback(Sqls.callback.strList());
dao().execute(sql);
List<String> unitIds = sql.getList(String.class);
updateUnits(unitIds);
}
/**
* 拉取单位数据
*/
@Override
@Aop(TransAop.READ_COMMITTED)
public void updateUnits(List<String> unitIds) {
// 获取配置
DataCenterProperties.Credential credential = dcPro.credential("unit");
String url = credential.getUrl();
String token = credential.getToken();
// 请求数据
HttpRequest httpRequest = HttpUtil.createPost(url);
httpRequest.header("Content-Type", "application/json");
httpRequest.header("X-H3C-TOKEN", token);
httpRequest.body(JSONUtil.toJsonStr(Map.of()));
String resBody = httpRequest.execute().body();
JSONObject jsonBody = JSONUtil.parseObj(resBody);
if (jsonBody.getInt("code") != 200) {
throw new BaseException("获取单位数据失败,错误码: " + jsonBody.getInt("code") + ";错误原因:" + jsonBody.getStr("msg"));
}
// 需要新增的单位
List<Sys_unit> insertList = new ArrayList<>();
// 需要更新的单位
List<Sys_unit> updateList = new ArrayList<>();
// 拉取过来的数据,全部的单位,一万四千多条,这里只保留 “部门类”
List<JSONObject> data = jsonBody.getJSONArray("data").stream()
.map(o -> (JSONObject) o)
.filter(row -> StrUtil.isNotBlank(row.getStr("bmlb")))
.toList();
Map<String, String> api2db = Arrays.stream(Api2UnitFiledMap.values())
.collect(Collectors.toMap(e -> e.apiField, e -> e.dbColumn));
for (JSONObject row : data) {
Sys_unit unit = DataCenterUtil.mapJsonToBean(row, Sys_unit.class, api2db);
unit.setUnitcode(unit.getId());
unit.setUnitTypeCode(unit.getUnitType().contains("部门") ? 1 : 0);
if (unitIds.contains(unit.getId())) {
// 存在则更新
updateList.add(unit);
} else {
// 不存在则新增
insertList.add(unit);
}
}
log.info("本次拉取单位数据,新增{}条,更新{}条", insertList.size(), updateList.size());
dao().insert(insertList);
dao().update(updateList);
}
}
@@ -9,7 +9,6 @@ import cn.hutool.http.HtmlUtil;
import com.budwk.app.base.constant.RoleConstant;
import com.budwk.app.base.event.role.RoleEventMsg;
import com.budwk.app.base.event.role.RoleEventPublisher;
import com.budwk.app.base.utils.ConditionGroupUtil;
import com.budwk.app.base.utils.PwdUtil;
import com.budwk.app.sys.annotation.DataCenterColumn;
import com.budwk.app.sys.models.*;
@@ -37,7 +36,10 @@ import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import java.lang.reflect.Field;
import java.util.*;
import java.util.concurrent.*;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import java.util.stream.Collectors;
/**
@@ -153,7 +155,7 @@ public class SysDataUserAllUpdateServiceImpl implements SysDataUserUpdateService
// 处理复杂条件
if (updateParam.getConditionGroup() != null) {
cnd = ConditionGroupUtil.applyConditionGroup(cnd, updateParam.getConditionGroup());
// cnd = ConditionGroupUtil.applyConditionGroup(cnd, updateParam.getConditionGroup());
}
List<Sys_user_source> sources = dao.query(Sys_user_source.class, cnd.groupBy("loginname"));
@@ -184,42 +186,20 @@ public class SysDataUserAllUpdateServiceImpl implements SysDataUserUpdateService
u.setSalt(salt);
u.setPassword(PwdUtil.getPassword(PwdUtil.generate(12), salt));
// 检查是否符合会员条件
boolean shouldBeMember = checkMembershipEligibility(
source.getUserState(),
source.getPreparedBy(),
source.getPostDoctoralJoinDate()
);
if (shouldBeMember) {
u.setMember(true);
if (u.getMember()) {
addMemberUserIds.add(u.getId());
} else {
u.setMember(false);
}
needInitUserList.add(u);
} else {
// 修改现有用户
u.setId(user.getId());
// 检查会员资格
boolean shouldBeMember = checkMembershipEligibility(
source.getUserState(),
source.getPreparedBy(),
source.getPostDoctoralJoinDate()
);
// 更新会员状态
boolean currentIsMember = user.getMember() != null && user.getMember();
if (shouldBeMember && !currentIsMember) {
// 添加会员
u.setMember(true);
if (!currentIsMember) {
addMemberUserIds.add(user.getId());
} else if (!shouldBeMember && currentIsMember) {
// 移除会员
u.setMember(false);
} else{
removeMemberUserIds.add(user.getId());
}
@@ -431,9 +411,9 @@ public class SysDataUserAllUpdateServiceImpl implements SysDataUserUpdateService
// 如果值不相等,记录变更
if (!ObjectUtil.equals(sourceValue, userValue)) {
NutMap change = NutMap.NEW();
change.put("name", mapping.name);
change.put("fieldName", mapping.name);
change.put("field", mapping.field.getName());
change.put("value", userValue == null ? "" : userValue.toString());
change.put("sourceValue", userValue == null ? "" : userValue.toString());
change.put("newValue", sourceValue == null ? "" : sourceValue.toString());
changeList.add(change);
}
@@ -461,9 +441,9 @@ public class SysDataUserAllUpdateServiceImpl implements SysDataUserUpdateService
if (!ObjectUtil.equals(user.getUnitId(), source.getUnitId())) {
changeTypes.add(MemberChangeType.UNIT_CHANGE.name());
NutMap change = NutMap.NEW();
change.put("name", "单位");
change.put("fieldName", "单位");
change.put("field", "unitId");
change.put("value", user.getUnitId());
change.put("sourceValue", user.getUnitId());
change.put("newValue", source.getUnitId());
changeList.add(change);
}
@@ -475,8 +455,8 @@ public class SysDataUserAllUpdateServiceImpl implements SysDataUserUpdateService
// 生成变更信息描述
String changeInfos = changeList.stream()
.map(v -> v.getString("name") + "" +
HtmlUtil.cleanHtmlTag(v.getString("value")) + "" +
.map(v -> v.getString("fieldName") + "" +
HtmlUtil.cleanHtmlTag(v.getString("sourceValue")) + "" +
HtmlUtil.cleanHtmlTag(v.getString("newValue")))
.collect(Collectors.joining(""));
@@ -1,35 +1,46 @@
package com.budwk.app.sys.services.impl;
import cn.hutool.core.codec.Base64;
import cn.hutool.core.collection.ListUtil;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.CharsetUtil;
import cn.hutool.core.util.IdcardUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.crypto.digest.DigestUtil;
import cn.hutool.http.Header;
import cn.hutool.http.HttpRequest;
import cn.hutool.http.HttpUtil;
import cn.hutool.json.JSONArray;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import com.budwk.app.base.config.DataCenterProperties;
import com.budwk.app.base.exception.BaseException;
import com.budwk.app.base.service.impl.BaseServiceImpl;
import com.budwk.app.sys.annotation.DataCenterColumn;
import com.budwk.app.sys.enums.Api2FinanceFiledMap;
import com.budwk.app.sys.models.Sys_data_dict;
import com.budwk.app.sys.models.Sys_dict;
import com.budwk.app.sys.models.Sys_user;
import com.budwk.app.sys.models.Sys_user_source;
import com.budwk.app.sys.services.SysDataUnitPullService;
import com.budwk.app.sys.services.SysDataUserPullService;
import com.budwk.app.sys.services.SysDictService;
import com.budwk.app.sys.utils.DataCenterUtil;
import lombok.extern.slf4j.Slf4j;
import org.nutz.aop.interceptor.async.Async;
import org.nutz.aop.interceptor.ioc.TransAop;
import org.nutz.dao.Cnd;
import org.nutz.dao.Dao;
import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql;
import org.nutz.ioc.aop.Aop;
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.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import java.lang.reflect.Field;
import java.math.BigDecimal;
import java.util.*;
import java.util.stream.Collectors;
@@ -40,6 +51,10 @@ public class SysDataUserPullServiceImpl extends BaseServiceImpl<Sys_user_source>
@Inject
private SysDictService sysDictService;
@Inject
private DataCenterProperties dataCenterProperties;
@Inject
private SysDataUnitPullService sysDataUnitPullService;
@Inject
private ThreadPoolTaskExecutor threadPoolTaskExecutor;
public SysDataUserPullServiceImpl(Dao dao) {
@@ -52,10 +67,12 @@ public class SysDataUserPullServiceImpl extends BaseServiceImpl<Sys_user_source>
private static class FieldMapping {
final Field field;
final String key;
final String dict;
FieldMapping(Field field, String key) {
FieldMapping(Field field, String key, String dict) {
this.field = field;
this.key = key;
this.dict = dict;
field.setAccessible(true);
}
}
@@ -77,7 +94,7 @@ public class SysDataUserPullServiceImpl extends BaseServiceImpl<Sys_user_source>
for (Field field : fields) {
DataCenterColumn annotation = field.getAnnotation(DataCenterColumn.class);
if (annotation != null) {
mappings.add(new FieldMapping(field, annotation.key()));
mappings.add(new FieldMapping(field, annotation.key(), annotation.dict()));
}
}
fieldMappings = mappings;
@@ -88,58 +105,48 @@ public class SysDataUserPullServiceImpl extends BaseServiceImpl<Sys_user_source>
}
@Override
@Aop(TransAop.READ_COMMITTED)
public Date pull() {
try {
// 博士后进站日期数据
Map<String, Date> doctoralData = pullPostDoctoral();
// 获取数据中心的字典
List<Sys_data_dict> dataDictList = dao().query(Sys_data_dict.class, Cnd.NEW());
// 字典码表Map,key为父级编码,value为子级字典列表
Map<String, List<Sys_data_dict>> dataDictMap = dataDictList.stream().collect(Collectors.groupingBy(Sys_data_dict::getParentCode));
Date nowDate = new Date();
String appId = "1926887238437818370";
String secret = "32df31fcf4fc43f9a647ee1f47134f36";
Map<String, NutMap> financeUserMap = pullFinance();
// // 博士后进站日期数据
// Map<String, Date> doctoralData = pullPostDoctoral();
// 获取配置文件 接口地址 和 token
DataCenterProperties.Credential credential = dataCenterProperties.credential("teacher");
String url = credential.getUrl();
String token = credential.getToken();
// 请求数据
HttpRequest httpRequest = HttpUtil.createPost(url);
httpRequest.header("Content-Type", "application/json");
httpRequest.header("X-H3C-TOKEN", token);
httpRequest.body(JSONUtil.toJsonStr(Map.of()));
String resBody = httpRequest.execute().body();
JSONObject jsonBody = JSONUtil.parseObj(resBody);
if (jsonBody.getInt("code") != 200) {
throw new BaseException("获取人员数据失败,错误码: " + jsonBody.getInt("code") + ";错误原因:" + jsonBody.getStr("msg"));
}
List<JSONObject> rawDataList = new ArrayList<>();
int skip = 0;
int totalCount = 0;
boolean firstRequest = true;
do {
long ts = System.currentTimeMillis();
String sign = Base64.encode(DigestUtil.md5Hex(appId + secret + ts, CharsetUtil.CHARSET_UTF_8));
JSONArray data = jsonBody.getJSONArray("data");
HttpRequest httpRequest = HttpUtil.createPost("https://sjzcpt.nnu.edu.cn/cdsp/data-api/v2/DS0026");
httpRequest.header("Content-Type", "application/json");
httpRequest.header("appId", appId);
httpRequest.header("timestamp", String.valueOf(ts));
httpRequest.header("sign", sign);
if (!data.isEmpty()) {
// 先收集所有原始数据
rawDataList = data.stream().map(v -> (JSONObject) v).toList();
log.info("数据拉取进度: {}/{}", rawDataList.size(), jsonBody.getInt("total"));
} else {
log.warn("当前未获取到数据");
}
HashMap<String, Object> reqBody = new HashMap<>();
reqBody.put("$count", true);
reqBody.put("$skip", skip);
reqBody.put("$top", 1000);
// reqBody.put("$filter", "yrfsmc eq '事业编制' or yrfsmc eq '校聘合同制' or yrfsmc eq '新人事代理' or yrfsmc eq '博士后' or yrfsmc eq '劳动合同'");
httpRequest.body(JSONUtil.toJsonStr(reqBody));
String resBody = httpRequest.execute().body();
JSONObject entries = JSONUtil.parseObj(resBody);
if (firstRequest) {
totalCount = entries.getInt("@odata.count", 0);
firstRequest = false;
}
JSONArray value = entries.getJSONArray("value");
if (!value.isEmpty()) {
// 先收集所有原始数据
List<JSONObject> currentBatch = value.stream().map(v -> (JSONObject) v).toList();
rawDataList.addAll(currentBatch);
skip += currentBatch.size();
log.info("数据拉取进度: {}/{}", rawDataList.size(), totalCount);
} else {
log.warn("当前批次未获取到数据,skip={}", skip);
break;
}
} while (skip < totalCount);
Date nowDate = new Date();
// 赋值
List<Sys_user_source> latestSourceList = rawDataList.stream().map(raw -> {
@@ -150,12 +157,25 @@ public class SysDataUserPullServiceImpl extends BaseServiceImpl<Sys_user_source>
try {
// 根据字段类型设置值
if (mapping.field.getType() == String.class) {
// 特殊处理性别字段
if (mapping.field.getName().equals("sex")) {
String xbmc = raw.getStr(mapping.key);
mapping.field.set(sysUser, StrUtil.equals("男性", xbmc) ? "" : StrUtil.equals("女性", xbmc) ? "" : null);
if (StrUtil.isNotBlank(mapping.dict)) {
Sys_data_dict sysDataDict = dataDictMap.get(mapping.dict).stream()
.filter(v -> raw.getStr(mapping.key)
.equals(v.getCode())).findFirst().orElse(new Sys_data_dict());
mapping.field.set(sysUser, sysDataDict.getName());
} else {
mapping.field.set(sysUser, raw.getStr(mapping.key));
// 特殊处理 根据身份证号获取性别和出生年月
if ("sfzjh".equals(mapping.field.getName())) {
String idCard = raw.getStr(mapping.key);
if (StrUtil.isNotBlank(idCard)) {
int gender = IdcardUtil.getGenderByIdCard(idCard);
// 性别(1 : 男 0 : 女)
sysUser.setSex(gender == 1 ? "" : "");
mapping.field.set(sysUser, raw.getStr(mapping.key));
}
} else {
mapping.field.set(sysUser, raw.getStr(mapping.key));
}
}
} else if (mapping.field.getType() == Date.class) {
mapping.field.set(sysUser, raw.getDate(mapping.key));
@@ -165,22 +185,40 @@ public class SysDataUserPullServiceImpl extends BaseServiceImpl<Sys_user_source>
}
}
// 设置博士后的进站日期
if (doctoralData.containsKey(sysUser.getLoginname())) {
sysUser.setPostDoctoralJoinDate(doctoralData.get(sysUser.getLoginname()));
// 设置单位相关信息
sysUser.setUnitId(raw.getStr("dwh"));
sysUser.setPullTime(nowDate);
// 判断财务信息有没有值,
if (financeUserMap.containsKey(sysUser.getLoginname())) {
NutMap nutMap = financeUserMap.get(sysUser.getLoginname());
sysUser.setMember(true);
sysUser.setWelfareMember(true);
sysUser.setPreparationMemberFee(BigDecimal.valueOf(nutMap.getDouble("preparationMemberFee")));
sysUser.setContractMemberFee(BigDecimal.valueOf(nutMap.getDouble("contractMemberFee")));
} else {
sysUser.setMember(false);
sysUser.setWelfareMember(false);
}
// 设置单位相关信息
sysUser.setUnitName(raw.getStr("dwmc"));
sysUser.setUnitId(raw.getStr("dwdm"));
sysUser.setPullTime(nowDate);
return sysUser;
}).toList();
log.info("--------------------");
log.info("用户数据初始化完成,等待插入,当前数据条数{}", latestSourceList.size());
// 插入到数据库
dao().insert(latestSourceList);
// 人员的单位数据和数据库的单位数据比较,如果人员里面有单位不存在,去更新单位数据
List<String> sourceUnitIds = latestSourceList.stream().map(Sys_user_source::getUnitId).distinct().toList();
Sql sql = Sqls.create("select id from sys_unit group by id");
sql.setCallback(Sqls.callback.strList());
dao().execute(sql);
List<String> unitIds = sql.getList(String.class);
if (!new HashSet<>(unitIds).containsAll(sourceUnitIds)) {
log.info("单位需要更新,正在同步更新");
sysDataUnitPullService.updateUnits(unitIds);
}
return nowDate;
} catch (Exception e) {
throw new BaseException("数据拉取失败,{}", e.getMessage());
@@ -346,4 +384,74 @@ public class SysDataUserPullServiceImpl extends BaseServiceImpl<Sys_user_source>
""");
return listMap(sql);
}
@Override
public Map<String, NutMap> pullFinance() {
// 获取配置文件 接口地址 和 token
DataCenterProperties.Credential credential = dataCenterProperties.credential("finance");
String url = credential.getUrl();
String token = credential.getToken();
List<JSONObject> rawDataList = new ArrayList<>();
String year = String.valueOf(DateUtil.thisYear());
String month = String.valueOf(DateUtil.thisMonth() + 1);
int pageNum = 1;
int pageSize = 1000;
int totalPages = 1;
int totalCount = 0;
do {
HttpRequest httpRequest = HttpUtil.createPost(url);
httpRequest.header(Header.CONTENT_TYPE, "application/json");
httpRequest.header("Accept-Encoding", "gzip, deflate, br");
httpRequest.header("X-H3C-TOKEN", token);
Map<String, Object> reqBody = Map.of(
"nf", year,
"yf", month,
"pageNum", pageNum,
"pageSize", pageSize
);
httpRequest.body(JSONUtil.toJsonStr(reqBody));
JSONObject resp = JSONUtil.parseObj(httpRequest.execute().body());
if (resp.getInt("code") != 0) {
throw new BaseException("获取财务数据失败,错误码: " + resp.getInt("code") + ";错误原因:" + resp.getStr("msg"));
}
JSONObject data = resp.getJSONObject("data");
if (pageNum == 1) {
totalCount = data.getInt("total", 0);
// totalPages = data.getInt("pages", 0);
totalPages = (int) Math.ceil((double) totalCount / pageSize);
}
JSONArray records = data.getJSONArray("records");
if (CollUtil.isNotEmpty(records)) {
rawDataList.addAll(records.stream().map(v -> (JSONObject) v).toList());
log.info("数据拉取进度: {}/{}", rawDataList.size(), totalCount);
}
pageNum++; // 只加页码
} while (pageNum <= totalPages);
// 接口数据输出
log.info("数据拉取结果: {}", rawDataList);
// 最后结果数据
Map<String, NutMap> result = new HashMap<>();
Map<String, String> api2db = Arrays.stream(Api2FinanceFiledMap.values())
.collect(Collectors.toMap(e -> e.apiField, e -> e.dbColumn));
for (JSONObject row : rawDataList) {
NutMap nutMap = DataCenterUtil.mapJsonToBean(row, NutMap.class, api2db);
result.put(nutMap.getString("loginname"), nutMap);
}
// 输出结果
log.info("财务数据拉取转换结果: {}", result);
log.info("数据拉取完成,共拉取 {} 条数据", result.size());
return result;
}
}
@@ -244,7 +244,8 @@ public class ActivityBasicUnionController {
@At
public Result branchUnionPartUnitTransferData(String unionId) {
List<ActivityBasicUnit> units = dao.query(ActivityBasicUnit.class, Cnd.where("unitLevel", "=", 2).asc("unitcode"));
// List<ActivityBasicUnit> units = dao.query(ActivityBasicUnit.class, Cnd.where("unitLevel", "=", 2).asc("unitcode"));
List<ActivityBasicUnit> units = dao.query(ActivityBasicUnit.class, Cnd.where("unitTypeCode", "=", "1").asc("unitcode"));
List<String> selectUnitIds = units.stream().filter(unit -> StrUtil.isNotBlank(unit.getUnionId()) && unit.getUnionId().equals(unionId)).map(ActivityBasicUnit::getId).toList();
NutMap transferData = NutMap.NEW().addv("selectUnitIds", selectUnitIds).addv("allUnits", units);
return Result.success(transferData);
@@ -169,7 +169,8 @@ public class TeacherCongressDelegationController {
seg.orEX("id", "not in", unitIds);
seg.orEX("id", "in", selectUnitIds);
Cnd cnd = Cnd.where("unitLevel", "=", 2);
// Cnd cnd = Cnd.where("unitLevel", "=", 2);
Cnd cnd = Cnd.where("unitTypeCode", "=", "1");
if (!seg.isEmpty()) {
cnd.and(seg);
}
@@ -174,7 +174,8 @@ public class WorkerCongressDelegationController {
seg.orEX("id", "not in", unitIds);
seg.orEX("id", "in", selectUnitIds);
Cnd cnd = Cnd.where("unitLevel", "=", 2);
// Cnd cnd = Cnd.where("unitLevel", "=", 2);
Cnd cnd = Cnd.where("unitTypeCode", "=", "1");
if (!seg.isEmpty()) {
cnd.and(seg);
}
@@ -17,20 +17,42 @@ import lombok.Getter;
public enum MemberChangeType {
//变更类型
NEW("新入职"),
RESTORE("入会"),
WITHDRAWAL("退会"),
WORK("在职"),
LEAVE_SCHOOL("离校"),
RETIRE("退休"),
RESIGN(""),
OUT("调出"),
LEAVE_OFFICE("离职"),
OTHER("其他减员"),
UNIT_CHANGE("单位异动"),
UNION_CHANGE("工会关系异动"),
BASIC_CHANGE("基本信息异动");
NEW("NEW", "新入职"),
RESTORE("RESTORE", "入会"),
WITHDRAWAL("WITHDRAWAL", "退会"),
ONLINE("ONLINE", "在岗"),
FLEX("FLEX", "柔性"),
SECONDED("SECONDED", "借调挂"),
REMOTE_POST("REMOTE_POST", "异地任职"),
REHIRE_INNER("REHIRE_INNER", "内退返岗"),
SHORT_TRIP("SHORT_TRIP", "短期公差"),
DOMESTIC_MEET("DOMESTIC_MEET", "境内会务"),
QUARANTINE("QUARANTINE", "疫期隔离"),
SICK_LEAVE("SICK_LEAVE", "病假"),
PERSONAL_LEAVE("PERSONAL_LEAVE", "事假"),
NURSING_LEAVE("NURSING_LEAVE", "哺乳假"),
MATERNITY("MATERNITY", "产假"),
LONG_SICK("LONG_SICK", "长病假"),
ABROAD_PUB("ABROAD_PUB", "公派出国"),
STUDY_DOMESTIC("STUDY_DOMESTIC", "国内进修"),
STUDY_ABROAD("STUDY_ABROAD", "境外留学"),
OFF_JOB_START("OFF_JOB_START", "离岗创业"),
INNER_RETIRE("INNER_RETIRE", "内部退养"),
EXTEND("EXTEND", "延聘"),
REHIRE_SCH("REHIRE_SCH", "学校返聘"),
REHIRE_DEPT("REHIRE_DEPT", "部门返聘"),
OFFLINE("OFFLINE", "不在岗"),
UNIT_CHANGE("UNIT_CHANGE", "单位异动"),
UNION_CHANGE("UNION_CHANGE", "工会关系异动"),
BASIC_CHANGE("BASIC_CHANGE", "基本信息异动");
private final String code;
private final String changeTypeName;
}
@@ -92,6 +92,7 @@ public class MemberChangeApplyController {
// 开启流程实例
Dict args = Dict.create();
args.set("origin", "personType");
args.set(FlowConst.SUBMIT_TYPE, ProcessSubmitTypeEnum.APPLY.getCode());
args.set(FlowConst.FORM_DATA, memberChangeRecord);
ProcessInstance instance = flowEngine.startProcessInstanceByKey("HYBG", memberChangeRecord.getId(), SecurityUtil.getUserId(), args);
@@ -116,6 +117,7 @@ public class MemberChangeApplyController {
dao.insertOrUpdate(memberChangeRecord);
Dict dict = Dict.create();
dict.set("origin", "personType");
dict.set(FlowConst.PROCESS_TASK_ID_KEY, taskId);
dict.set(FlowConst.SUBMIT_TYPE, ProcessSubmitTypeEnum.RE_APPLY.getCode());
flowCommonService.executeTask(dict);
@@ -4,10 +4,12 @@ import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.dev33.satoken.annotation.SaMode;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.lang.Dict;
import com.budwk.app.base.annotation.RepeatSubmit;
import com.budwk.app.base.annotation.SLog;
import com.budwk.app.base.constant.BpmProcessConstant;
import com.budwk.app.base.constant.RoleConstant;
import com.budwk.app.base.exception.BaseException;
import com.budwk.app.base.page.Pagination;
import com.budwk.app.base.result.Result;
import com.budwk.app.bpm.enums.BpmTaskApprovalTypeEnum;
@@ -15,6 +17,11 @@ import com.budwk.app.bpm.models.BpmProcessInstance;
import com.budwk.app.bpm.models.BpmProcessTask;
import com.budwk.app.bpm.param.BpmTaskApprovalParam;
import com.budwk.app.bpm.service.BpmService;
import com.budwk.app.flow.constant.FlowConst;
import com.budwk.app.flow.engine.FlowEngine;
import com.budwk.app.flow.entity.ProcessInstance;
import com.budwk.app.flow.entity.ProcessTask;
import com.budwk.app.flow.enums.ProcessSubmitTypeEnum;
import com.budwk.app.sys.views.View_user;
import com.budwk.app.web.commons.auth.utils.AuthUtil;
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
@@ -59,7 +66,7 @@ public class MemberChangeManageController {
@Inject
private Dao dao;
@Inject
private BpmService bpmService;
private FlowEngine flowEngine;
@Inject
private CommonService commonService;
@Inject
@@ -87,65 +94,44 @@ public class MemberChangeManageController {
@Aop(TransAop.READ_COMMITTED)
@SLog(tag = "会员高级管理-会员变更", msg = "分工会/校工会会员管理员提交变更")
@SaCheckPermission(value = {"member.change.mange", "staff.member.change.mange"}, mode = SaMode.OR)
public Result doSubmitChange(@Param("record") MemberChangeRecord record, @Param("approvalRemark") String approvalRemark){
public Result doSubmitChange(MemberChangeRecord record){
// 检验是否有变更
if (Lang.isEmpty(record)) {
return Result.error("未获取到异动数据");
}
List<NutMap> changeInfos = memberCommonService.getChangeInfos(record);
if (Lang.isEmpty(changeInfos)) {
return Result.error("未校验到变更数据,请确认数据是否存在变更");
}
if (Lang.isEmpty(record.getChangeTypes())) {
record.setChangeTypes(List.of(MemberChangeType.BASIC_CHANGE.name()));
} else {
List<String> changeTypes = record.getChangeTypes();
changeTypes.add(MemberChangeType.BASIC_CHANGE.name());
record.setChangeTypes(changeTypes);
}
boolean schoolRoleBool = AuthUtil.hasRoleOr(RoleConstant.SCHOOL_UNION_CHAIRMAN.name(), RoleConstant.SCHOOL_UNION_MEMBER_ADMIN.name(), RoleConstant.SYSADMIN.name());
boolean branchRoleBool = AuthUtil.hasRoleOr(RoleConstant.BRANCH_UNION_CHAIRMAN.name(), RoleConstant.BRANCH_UNION_OPERATOR.name());
record.setApplyDateTime(DateUtil.date());
record.setChangeOrigin(schoolRoleBool ? MemberChangeOrigin.SCHOOL_UNION.name() : MemberChangeOrigin.BRANCH_UNION.name());
// 变更类型
MemberChangeOrigin changeOrigin = schoolRoleBool ? MemberChangeOrigin.SCHOOL_UNION : branchRoleBool ? MemberChangeOrigin.BRANCH_UNION : null;
if (changeOrigin == null) {
throw new BaseException("没有权限,或未设置工会小组");
}
memberCommonService.validateChangeAndSetBasicData(record);
dao.insertOrUpdate(record);
bpmService.startSubmitProcessInstance(BpmProcessConstant.MEMBER_CHANGE.name(),
"【会员变更】" + record.getUsername(), record.getId(), List.of(SecurityUtil.getUserLoginname()), null);
// 有这个菜单权限的,那就是默认分工会审核通过了
BpmProcessInstance instance = dao.fetch(BpmProcessInstance.class, Cnd.where("processInstanceBusinessId", "=", record.getId()));
BpmProcessTask task = dao.fetch(BpmProcessTask.class, Cnd.where(BpmProcessTask::getProcessInstanceId, "=", instance.getId())
.desc(BpmProcessTask::getCreatedAt));
BpmTaskApprovalParam param = new BpmTaskApprovalParam();
param.setProcessInstanceId(instance.getId());
param.setProcessInstanceBusinessId(record.getId());
param.setProcessInstanceTaskId(task.getId());
param.setBpmTaskApprovalType(BpmTaskApprovalTypeEnum.PASS.name());
param.setBpmTaskApprovalTypeEnum(BpmTaskApprovalTypeEnum.PASS);
param.setApprovalOpinion("分工会审核通过");
// 表示分工会审核通过
param.getBpmTaskApprovalTypeEnum();
Map<String, Object> variables = BeanUtil.beanToMap(param);
bpmService.completeTask(param.getProcessInstanceTaskId(), param.getBpmTaskApprovalTypeEnum(), variables, List.of(SecurityUtil.getUserLoginname()));
// 如果有校工会或者超管的角色,直接审核通过了
// 开启流程实例
Dict args = Dict.create();
if (schoolRoleBool) {
BpmProcessInstance committeeInstance = dao.fetch(BpmProcessInstance.class, Cnd.where("processInstanceBusinessId", "=", record.getId()));
BpmProcessTask committeeTask = dao.fetch(BpmProcessTask.class, Cnd.where(BpmProcessTask::getProcessInstanceId, "=", committeeInstance.getId())
.desc(BpmProcessTask::getCreatedAt));
args.set("origin", "schoolUnion");
} else {
args.set("origin", "branchUnion");
}
args.set(FlowConst.SUBMIT_TYPE, ProcessSubmitTypeEnum.APPLY.getCode());
args.set(FlowConst.FORM_DATA, record);
ProcessInstance instance = flowEngine.startProcessInstanceByKey("HYBG", record.getId(), SecurityUtil.getUserId(), args);
BpmTaskApprovalParam committeeParam = new BpmTaskApprovalParam();
committeeParam.setProcessInstanceId(committeeInstance.getId());
committeeParam.setProcessInstanceBusinessId(record.getId());
committeeParam.setProcessInstanceTaskId(committeeTask.getId());
committeeParam.setBpmTaskApprovalType(BpmTaskApprovalTypeEnum.PASS.name());
committeeParam.setBpmTaskApprovalTypeEnum(BpmTaskApprovalTypeEnum.PASS);
committeeParam.setApprovalOpinion("校工会审核通过");
// 自动完成第一个申请任务
List<ProcessTask> doingTaskList = flowEngine.processTaskService().getDoingTaskList(instance.getId(), null);
for (ProcessTask task : doingTaskList) {
flowEngine.executeProcessTask(task.getId(), SecurityUtil.getUserId(), args);
}
memberCommonService.compareChangeInfoAndUpdateMember(committeeParam.getProcessInstanceBusinessId());
bpmService.completeTask(committeeParam.getProcessInstanceTaskId(), committeeParam.getBpmTaskApprovalTypeEnum(), null, null);
// 如果是管理员的话,直接完成变更,修改变更记录
if (schoolRoleBool) {
memberCommonService.compareChangeInfoAndUpdateMember(record);
}
return Result.success();
}
@@ -86,7 +86,7 @@ public class MemberInfoBoardController {
@At
@SaCheckPermission(value = {"member.info.board", "h5.member.info.board"}, mode = SaMode.OR)
public Result memberPercentage() {
List<Sys_dict> memberApplyPersonTypeDictList = sysDictService.getSubListByCode("PERSON_TYPE");
List<Sys_dict> memberApplyPersonTypeDictList = sysDictService.getSubListByCode("USER_PERSON_TYPE");
List<String> personTypes = memberApplyPersonTypeDictList.stream().map(Sys_dict::getCode).collect(Collectors.toList());
int member = memberInfoService.count(Sqls.create("select count(1) from sys_user where member = 1"));
int user = memberInfoService.count(Sqls.create("select count(1) from sys_user").setParam("personTypes", personTypes));
@@ -4,6 +4,7 @@ import com.budwk.app.base.page.Pagination;
import com.budwk.app.base.service.BaseService;
import com.budwk.app.sys.models.Sys_user;
import com.budwk.app.sys.views.View_user;
import com.budwk.app.zhgh.staffmanage.member.constant.MemberChangeOrigin;
import com.budwk.app.zhgh.staffmanage.member.models.MemberChangeRecord;
import com.budwk.app.zhgh.staffmanage.member.param.pageform.MemberManagePageForm;
import org.nutz.dao.sql.Sql;
@@ -100,4 +101,10 @@ public interface MemberCommonService extends BaseService<Sys_user> {
* @param record
*/
void validateChangeAndSetBasicData(MemberChangeRecord record);
/**
* 验证变更信息
* @param record
*/
void validateChangeAndSetBasicData(MemberChangeRecord record, MemberChangeOrigin origin);
}
@@ -484,6 +484,13 @@ public class MemberManageServiceImpl extends BaseServiceImpl<Sys_user> implement
@Override
public void validateChangeAndSetBasicData(MemberChangeRecord record) {
// 不传递 MemberChangeOrigin 默认个人变更
validateChangeAndSetBasicData(record, MemberChangeOrigin.PERSONAL);
}
@Override
public void validateChangeAndSetBasicData(MemberChangeRecord record, MemberChangeOrigin origin) {
// 校验有没有发生变更
List<NutMap> changeInfos = getChangeInfos(record);
if (Lang.isEmpty(changeInfos)) {
@@ -495,9 +502,10 @@ public class MemberManageServiceImpl extends BaseServiceImpl<Sys_user> implement
List<String> changeTypes = compareChangeType(record, user);
record.setChangeTypes(changeTypes);
record.setUserId(SecurityUtil.getUserId());
// 变更来源 个人
record.setChangeOrigin(MemberChangeOrigin.PERSONAL.name());
record.setUserId(user.getId());
// 变更来源
record.setChangeOrigin(origin != null ? origin.name() : MemberChangeOrigin.PERSONAL.name());
record.setApplyDateTime(DateUtil.date());
}
private String booleanVerification(Object value) {
@@ -102,7 +102,7 @@
<div class="search-item">
<div class="search-item-label">人员类型</div>
<div class="search-item-option">
<dict-select v-model="pageForm.personType" code="PERSON_TYPE" @change="doSearch"
<dict-select v-model="pageForm.personType" code="USER_PERSON_TYPE" @change="doSearch"
style="width: 100%"></dict-select>
</div>
</div>
@@ -675,7 +675,7 @@ module.exports = {
}
await this.flushUnits()
await this.getActivityGroup()
this.personTypeOptions = await this.$businessTool.getDictOptions("PERSON_TYPE")
this.personTypeOptions = await this.$businessTool.getDictOptions("USER_PERSON_TYPE")
this.userStateOptions = await this.$businessTool.getDictOptions("USER_STATE")
await this.getRoleListByMenuId()
await this.pageData()
@@ -3,266 +3,302 @@ layout("/layouts/platform.html"){
#-->
<style>
.pullTimeRadioGroup .el-radio {
width: 100%;
margin-bottom: 10px;
}
.pullTimeRadioGroup .el-radio.is-bordered + .el-radio.is-bordered {
margin-left: 0;
}
.condition-builder {
border: 1px solid #dcdfe6;
border-radius: 4px;
padding: 10px;
margin-bottom: 10px;
}
.pullTimeRadioGroup .el-radio {
width: 100%;
margin-bottom: 10px;
}
.pullTimeRadioGroup .el-radio.is-bordered + .el-radio.is-bordered {
margin-left: 0;
}
.condition-builder {
border: 1px solid #dcdfe6;
border-radius: 4px;
padding: 10px;
margin-bottom: 10px;
}
</style>
<div id="app" v-cloak>
<guava ref="guava">
<template>
<el-card shadow="never">
<search @search="doSearch">
<search-item label="姓名">
<el-input placeholder="请输入内容" clearable v-model="pageForm.userName" style="width: 100%"></el-input>
</search-item>
<search-item label="工号">
<el-input placeholder="请输入内容" clearable v-model="pageForm.loginName" style="width: 100%"></el-input>
</search-item>
<search-item label="所属单位">
<el-select v-model="pageForm.unitId" clearable style="width: 100%">
<el-option v-for="i in unitOptions" :label="i.name" :key="i.id" :value="i.id"></el-option>
</el-select>
</search-item>
<search-item label="在职状态">
<dict-select v-model="pageForm.userState" code="USER_STATE" style="width: 100%"></dict-select>
</search-item>
<search-item label="人事编制">
<dict-select v-model="pageForm.preparedBy" code="USER_PREPARED_BY_TYPE" style="width: 100%"></dict-select>
</search-item>
<search-item label="人员类型">
<dict-select v-model="pageForm.personType" code="USER_PERSON_TYPE" style="width: 100%"></dict-select>
</search-item>
</search>
</el-card>
<el-card shadow="never">
<table-tool label="系统当前用户数据">
<el-button type="primary" size="mini" @click="openUpdate" icon="el-icon-refresh">更新</el-button>
</table-tool>
<el-table :key="tableKey" :data="tableData" @sort-change="pageOrder" header-align="center">
<el-table-column type="index" width="70" label="序号" fixed="left"></el-table-column>
<el-table-column prop="loginname" label="工号" width="100" fixed="left"></el-table-column>
<el-table-column prop="username" label="姓名" fixed="left" width="120" show-overflow-tooltip></el-table-column>
<el-table-column prop="changeTypes" label="变更类型" width="140">
<template slot-scope="{row}">
<guava ref="guava">
<template>
<el-card shadow="never">
<search @search="doSearch">
<search-item label="姓名">
<el-input placeholder="请输入内容" clearable v-model="pageForm.userName" style="width: 100%"></el-input>
</search-item>
<search-item label="工号">
<el-input placeholder="请输入内容" clearable v-model="pageForm.loginName" style="width: 100%"></el-input>
</search-item>
<search-item label="所属单位">
<el-select v-model="pageForm.unitId" clearable style="width: 100%">
<el-option v-for="i in unitOptions" :label="i.name" :key="i.id" :value="i.id"></el-option>
</el-select>
</search-item>
<search-item label="在职状态">
<dict-select v-model="pageForm.userState" code="USER_STATE" style="width: 100%"></dict-select>
</search-item>
<search-item label="人事编制">
<dict-select v-model="pageForm.preparedBy" code="USER_PREPARED_BY_TYPE" style="width: 100%"></dict-select>
</search-item>
<search-item label="人员类型">
<dict-select v-model="pageForm.personType" code="USER_PERSON_TYPE" style="width: 100%"></dict-select>
</search-item>
</search>
</el-card>
<el-card shadow="never">
<table-tool label="系统当前用户数据">
<el-button type="primary" size="mini" @click="updateDataDict" icon="el-icon-refresh">更新【码表】数据</el-button>
<el-button type="primary" size="mini" @click="updateUnits" icon="el-icon-refresh">更新【单位】数据</el-button>
<el-button type="primary" size="mini" @click="openUpdate" icon="el-icon-refresh">更新【人员】数据</el-button>
</table-tool>
<el-table :key="tableKey" :data="tableData" @sort-change="pageOrder" header-align="center">
<el-table-column type="index" width="70" label="序号" fixed="left"></el-table-column>
<el-table-column prop="loginname" label="工号" width="100" fixed="left"></el-table-column>
<el-table-column prop="username" label="姓名" fixed="left" width="120" show-overflow-tooltip></el-table-column>
<el-table-column prop="changeTypes" label="变更类型" width="140">
<template slot-scope="{row}">
<span style="color: #0e78c5; cursor: pointer" @click="openCurrentUserChangeInfo(row)">
{{getChangeTypes(row.changeTypes)}}
</span>
</template>
</el-table-column>
<el-table-column prop="changeTime" label="变更时间" sortable width="150"></el-table-column>
<el-table-column prop="sex" label="性别" sortable></el-table-column>
<!-- <el-table-column prop="mobile" label="手机号" width="120"></el-table-column>-->
<el-table-column prop="birthday" label="生日" sortable width="120">
<template slot-scope="{row}">{{$moment(row.birthday).format('YYYY-MM-DD')}}</template>
</el-table-column>
<el-table-column prop="userState" label="在职状态" sortable width="120"></el-table-column>
<el-table-column prop="preparedBy" label="人事编制" sortable width="120"></el-table-column>
<el-table-column prop="personType" label="人员类型" sortable width="120"></el-table-column>
<el-table-column prop="arrivalAtSchoolDate" label="来校年月" sortable width="120"></el-table-column>
<el-table-column prop="technicalTitle" label="技术职称" sortable width="120"></el-table-column>
<el-table-column prop="position" label="职务" sortable width="120" show-overflow-tooltip></el-table-column>
<el-table-column prop="education" label="学历" show-overflow-tooltip sortable width="120"></el-table-column>
<el-table-column prop="academicDegree" label="学位" show-overflow-tooltip sortable width="120"></el-table-column>
<el-table-column prop="unitName" label="单位" show-overflow-tooltip sortable width="120"></el-table-column>
<el-table-column prop="unitId" label="单位编码" sortable width="120"></el-table-column>
<el-table-column prop="nationality" label="国籍" sortable></el-table-column>
<el-table-column prop="nation" label="民族" sortable></el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
</template>
</guava>
<el-dialog title="选择数据源" :visible.sync="updateDialog" width="70%">
<el-timeline>
<el-timeline-item timestamp="数据源" placement="top">
<el-radio-group v-model="updateFromData.pullTime" style="width: 100%" class="pullTimeRadioGroup">
<el-radio :label="item.pullTime" border v-for="item in pullTimeOptions" :key="item.pullTime">
</template>
</el-table-column>
<el-table-column prop="changeTime" label="变更时间" sortable width="150"></el-table-column>
<el-table-column prop="sex" label="性别" sortable></el-table-column>
<!-- <el-table-column prop="mobile" label="手机号" width="120"></el-table-column>-->
<el-table-column prop="birthday" label="生日" sortable width="120">
<template slot-scope="{row}">{{$moment(row.birthday).format('YYYY-MM-DD')}}</template>
</el-table-column>
<el-table-column prop="userState" label="在职状态" sortable width="120"></el-table-column>
<el-table-column prop="preparedBy" label="人事编制" sortable width="120"></el-table-column>
<el-table-column prop="personType" label="人员类型" sortable width="120"></el-table-column>
<el-table-column prop="arrivalAtSchoolDate" label="来校年月" sortable width="120"></el-table-column>
<el-table-column prop="technicalTitle" label="技术职称" sortable width="120"></el-table-column>
<el-table-column prop="position" label="职务" sortable width="120" show-overflow-tooltip></el-table-column>
<el-table-column prop="education" label="学历" show-overflow-tooltip sortable width="120"></el-table-column>
<el-table-column prop="academicDegree" label="学位" show-overflow-tooltip sortable width="120"></el-table-column>
<el-table-column prop="unitName" label="单位" show-overflow-tooltip sortable width="120"></el-table-column>
<el-table-column prop="unitId" label="单位编码" sortable width="120"></el-table-column>
<el-table-column prop="nationality" label="国籍" sortable></el-table-column>
<el-table-column prop="nation" label="民族" sortable></el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
</template>
</guava>
<el-dialog title="选择数据源" :visible.sync="updateDialog" width="70%">
<el-timeline>
<el-timeline-item timestamp="数据源" placement="top">
<el-radio-group v-model="updateFromData.pullTime" style="width: 100%" class="pullTimeRadioGroup">
<el-radio :label="item.pullTime" border v-for="item in pullTimeOptions" :key="item.pullTime">
<span>
{{item.pullTime}}
<span style="float: right; color: red">rows:{{item.num}}</span>
</span>
</el-radio>
</el-radio-group>
</el-timeline-item>
<el-timeline-item timestamp="更新方式" placement="top">
<el-radio-group class="checkGroup" style="width: 100%" v-model="updateFromData.updateMode" size="small">
<el-row>
<el-radio border label="ALL">全部更新</el-radio>
<el-radio border label="INCR">仅更新新增人员</el-radio>
</el-row>
</el-radio-group>
</el-timeline-item>
<el-timeline-item timestamp="高级条件筛选" placement="top">
<el-switch v-model="enableAdvancedConditions" active-text="启用高级条件"></el-switch>
<div v-if="enableAdvancedConditions" class="condition-builder">
<!-- 条件构建器组件 -->
<condition-group :group="updateFromData.conditionGroup" :field_options="fieldOptions" @remove="removeRootGroup"></condition-group>
</div>
</el-timeline-item>
</el-timeline>
<span slot="footer" class="dialog-footer" v-loading="updateLoading">
</el-radio>
</el-radio-group>
</el-timeline-item>
<el-timeline-item timestamp="更新方式" placement="top">
<el-radio-group class="checkGroup" style="width: 100%" v-model="updateFromData.updateMode" size="small">
<el-row>
<el-radio border label="ALL">全部更新</el-radio>
<el-radio border label="INCR">仅更新新增人员</el-radio>
</el-row>
</el-radio-group>
</el-timeline-item>
<el-timeline-item timestamp="高级条件筛选" placement="top">
<el-switch v-model="enableAdvancedConditions" active-text="启用高级条件"></el-switch>
<div v-if="enableAdvancedConditions" class="condition-builder">
<!-- 条件构建器组件 -->
<condition-group :group="updateFromData.conditionGroup" :field_options="fieldOptions" @remove="removeRootGroup"></condition-group>
</div>
</el-timeline-item>
</el-timeline>
<span slot="footer" class="dialog-footer" v-loading="updateLoading">
<el-button @click="updateDialog = false" :disabled="updateLoading">取 消</el-button>
<el-button type="primary" @click="execUpdate" :disabled="updateLoading">确 定</el-button>
</span>
</el-dialog>
</el-dialog>
</div>
<script>
new Vue({
el: "#app",
dicts: ["MEMBER_CHANGE_TYPE"],
mixins: [initTableMixins],
data() {
return {
updateDialog: false,
pullTimeOptions: false,
updateFromData: {
pullTime: null,
updateMode: "ALL",
conditionGroup: {
logic: "AND",
conditions: [],
groups: []
}
},
updateLoading: false,
unitOptions: [],
changeTypeData: [],
enableAdvancedConditions: false,
// 可选字段列表
fieldOptions: [
{ label: "姓名", value: "username" },
{ label: "工号", value: "loginname" },
{ label: "性别", value: "sex" },
{ label: "生日", value: "birthday" },
{ label: "手机号", value: "mobile" },
{ label: "在职状态", value: "userState" },
{ label: "人事编制", value: "preparedBy" },
{ label: "进站时间", value: "postDoctoralJoinDate" },
{ label: "人员类型", value: "personType" },
{ label: "来校年月", value: "arrivalAtSchoolDate" },
{ label: "单位", value: "unitName" },
{ label: "单位编码", value: "unitId" },
{ label: "学", value: "education" },
{ label: "学位", value: "academicDegree" }
]
}
},
methods: {
openCurrentUserChangeInfo(row) {
this.$refs.guava.view(() => {
this.$refs.memberAuditChangeInfoRef.onOpen({ userId: row.id, recordId: row.userHistoryId })
})
},
getChangeTypes(changeTypes) {
if (changeTypes) {
const c = JSON.parse(changeTypes)
return c
.map((v) => {
return this.changeTypeData.find((item) => item.code === v).name
})
.join(",")
}
return null
},
openUpdate() {
this.updateDialog = true
this.updateLoading = false
this.$nextTick(() => {
this.updateFromData = {
updateMode: "ALL",
pullTime: null,
conditionGroup: {
logic: "AND",
conditions: [],
groups: []
}
}
this.enableAdvancedConditions = false
})
},
getPullTimeOptions() {
this.$axios.post("/platform/sys/data/user/update/pullTimeOptions").then((resp) => {
if (resp.code === 0) {
this.pullTimeOptions = resp.data
}
})
},
execUpdate() {
if (!this.updateFromData.pullTime) {
this.$message.warning("请选择数据源时间")
return
}
if (!this.updateFromData.updateMode) {
this.$message.warning("请选择更新方式")
return
}
// 如果未启用高级条件,则移除条件组
if (!this.enableAdvancedConditions) {
this.updateFromData.conditionGroup = null
}
this.$confirm("确定要更新数据吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
this.updateLoading = true
this.$axios
.post("/platform/sys/data/user/update/updateUserFormSource", { param: JSON.stringify(this.updateFromData) })
.then((resp) => {
if (resp.code === 0) {
this.$message.success(resp.msg)
this.updateDialog = false
}
})
})
.finally(() => {
this.updateLoading = false
})
},
listUnit() {
this.$businessTool.listUnit(this.pageForm.unionId).then((res) => {
this.unitOptions = res
})
},
removeRootGroup() {
// 重置根条件组
this.updateFromData.conditionGroup = {
logic: "AND",
conditions: [],
groups: []
}
}
},
created() {
this.listUnit()
this.getPullTimeOptions()
this.pageData()
this.$businessTool.getAllDictOptions("MEMBER_CHANGE_TYPE").then((data) => {
this.changeTypeData = data
})
}
})
new Vue({
el: "#app",
mixins: [initTableMixins],
data() {
return {
updateDialog: false,
pullTimeOptions: false,
updateFromData: {
pullTime: null,
updateMode: "ALL",
conditionGroup: {
logic: "AND",
conditions: [],
groups: []
}
},
updateLoading: false,
unitOptions: [],
changeTypeData: [],
enableAdvancedConditions: false,
// 可选字段列表
fieldOptions: [
{ label: "姓名", value: "username" },
{ label: "工号", value: "loginname" },
{ label: "性别", value: "sex" },
{ label: "生日", value: "birthday" },
{ label: "手机号", value: "mobile" },
{ label: "在职状态", value: "userState" },
{ label: "人事编制", value: "preparedBy" },
{ label: "进站时间", value: "postDoctoralJoinDate" },
{ label: "人员类型", value: "personType" },
{ label: "来校年月", value: "arrivalAtSchoolDate" },
{ label: "单位", value: "unitName" },
{ label: "单位编码", value: "unitId" },
{ label: "学历", value: "education" },
{ label: "学", value: "academicDegree" }
]
}
},
methods: {
// 更新单位数据
updateUnits() {
this.$confirm("确定要更新单位数据吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
this.$axios.post("/platform/sys/data/user/update/updateUnits")
.then((resp) => {
if (resp.code === 0) {
this.$message.success("更新成功")
} else {
this.$message.error(resp.msg)
}
})
})
},
// 更新码表数据
updateDataDict() {
this.$confirm("确定要更新码表数据吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
this.$axios.post("/platform/sys/data/user/update/updateDataDict")
.then((resp) => {
if (resp.code === 0) {
this.$message.success("更新成功")
} else {
this.$message.error(resp.msg)
}
})
})
},
openCurrentUserChangeInfo(row) {
this.$refs.guava.view(() => {
this.$refs.memberAuditChangeInfoRef.onOpen({ userId: row.id, recordId: row.userHistoryId })
})
},
getChangeTypes(changeTypes) {
if (!changeTypes) return null
const changeTypesList = JSON.parse(changeTypes)
if (changeTypesList) {
if (!changeTypesList || changeTypesList.length === 0 || !this.changeTypeData || this.changeTypeData.length === 0) return null
return changeTypesList
.map((v) => {
return this.changeTypeData.find((item) => item.code === v).changeTypeName
})
.join(",")
}
return null
},
openUpdate() {
this.updateDialog = true
this.updateLoading = false
this.$nextTick(() => {
this.updateFromData = {
updateMode: "ALL",
pullTime: null,
conditionGroup: {
logic: "AND",
conditions: [],
groups: []
}
}
this.enableAdvancedConditions = false
})
},
getPullTimeOptions() {
this.$axios.post("/platform/sys/data/user/update/pullTimeOptions").then((resp) => {
if (resp.code === 0) {
this.pullTimeOptions = resp.data
}
})
},
execUpdate() {
if (!this.updateFromData.pullTime) {
this.$message.warning("请选择数据源时间")
return
}
if (!this.updateFromData.updateMode) {
this.$message.warning("请选择更新方式")
return
}
// 如果未启用高级条件,则移除条件组
if (!this.enableAdvancedConditions) {
this.updateFromData.conditionGroup = null
}
this.$confirm("确定要更新数据吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
this.updateLoading = true
this.$axios
.post("/platform/sys/data/user/update/updateUserFormSource", { param: JSON.stringify(this.updateFromData) })
.then((resp) => {
if (resp.code === 0) {
this.$message.success(resp.msg)
this.updateDialog = false
}
})
})
.finally(() => {
this.updateLoading = false
})
},
listUnit() {
this.$businessTool.listUnit(this.pageForm.unionId).then((res) => {
this.unitOptions = res
})
},
removeRootGroup() {
// 重置根条件组
this.updateFromData.conditionGroup = {
logic: "AND",
conditions: [],
groups: []
}
}
},
async created() {
this.listUnit()
this.getPullTimeOptions()
this.pageData()
this.changeTypeData = await this.$businessTool.getEnumOptions("MemberChangeType")
}
})
</script>
<!--#
@@ -53,7 +53,7 @@ layout("/layouts/platform.html"){
</search-item>
<search-item label="人员类型:">
<dict-select clearable code="PERSON_TYPE" multiple placeholder="请选择人员类型" v-model="pageForm.personTypes"></dict-select>
<dict-select clearable code="USER_PERSON_TYPE" multiple placeholder="请选择人员类型" v-model="pageForm.personTypes"></dict-select>
</search-item>
<search-item label="在职状态:">
<dict-select clearable code="USER_STATE" multiple placeholder="请选择人员状态" v-model="pageForm.userStates"></dict-select>
@@ -60,7 +60,7 @@ layout("/layouts/platform.html"){
</search-item>
<search-item label="人员类型:">
<dict-select clearable code="PERSON_TYPE" multiple placeholder="请选择人员类型" v-model="pageForm.personTypes"></dict-select>
<dict-select clearable code="USER_PERSON_TYPE" multiple placeholder="请选择人员类型" v-model="pageForm.personTypes"></dict-select>
</search-item>
<search-item label="在职状态:">
<dict-select clearable code="USER_STATE" multiple placeholder="请选择人员状态" v-model="pageForm.userStates"></dict-select>
@@ -7,7 +7,7 @@ const CLUB_INFO_MANAGE_TEMPLATE = {
<el-input placeholder="请输入内容" clearable v-model="pageForm.searchKeyword"></el-input>
</search-item>
<search-item label="人员类型:">
<dict-select code="PERSON_TYPE" placeholder="请选择人员类型" clearable v-model="pageForm.personType"></dict-select>
<dict-select code="USER_PERSON_TYPE" placeholder="请选择人员类型" clearable v-model="pageForm.personType"></dict-select>
</search-item>
<search-item label="在职状态:">
<dict-select clearable code="USER_STATE" placeholder="请选择人员状态" v-model="pageForm.userState"></dict-select>
@@ -45,7 +45,7 @@ layout("/layouts/platform.html"){
</search-item>
<search-item label="人员类型">
<dict-select v-model="pageForm.personType" placeholder="人员类型" @change="doSearch"
code="PERSON_TYPE"></dict-select>
code="USER_PERSON_TYPE"></dict-select>
</search-item>
</search>
</el-card>
@@ -30,7 +30,7 @@ const COMMON_QUERY = {
<dict-select v-model="pageForm.preparedBy" placeholder="聘用方式" @change="doSearch" code="PREPARED_BY"></dict-select>
</search-item>
<search-item label="人员类型">
<dict-select v-model="pageForm.personType" placeholder="人员类型" @change="doSearch" code="PERSON_TYPE"></dict-select>
<dict-select v-model="pageForm.personType" placeholder="人员类型" @change="doSearch" code="USER_PERSON_TYPE"></dict-select>
</search-item>
</template>
</search>
@@ -97,7 +97,7 @@ layout("/layouts/platform.html"){
</el-descriptions-item>
<el-descriptions-item label="人员类型">
<el-form-item prop="personType">
<dict-select v-model="formData.personType" code="PERSON_TYPE"
<dict-select v-model="formData.personType" code="USER_PERSON_TYPE"
disabled style="width: 100%"></dict-select>
</el-form-item>
</el-descriptions-item>
@@ -46,7 +46,7 @@ layout("/layouts/platform.html"){
<dict-select v-model="pageForm.preparedBy" placeholder="聘用方式" @change="doSearch" code="PREPARED_BY"></dict-select>
</search-item>
<search-item label="人员类型">
<dict-select v-model="pageForm.personType" placeholder="人员类型" @change="doSearch" code="PERSON_TYPE"></dict-select>
<dict-select v-model="pageForm.personType" placeholder="人员类型" @change="doSearch" code="USER_PERSON_TYPE"></dict-select>
</search-item>
</search>
</el-card>
@@ -28,7 +28,7 @@ const COMMON_QUERY = {
</search-item>
<search-item label="人员类型">
<dict-select v-model="pageForm.personType" placeholder="人员类型" @change="doSearch"
code="PERSON_TYPE"></dict-select>
code="USER_PERSON_TYPE"></dict-select>
</search-item>
<search-item label="变更类型">
<dict-select v-model="pageForm.changeType" placeholder="人员类型" @change="doSearch"
@@ -37,27 +37,29 @@ const MEMBER_ALL_CHANGE_INFO = {
<el-descriptions-item label="福利会员状态">{{ viewData.welfareMember ? '福利会员' : '非福利会员' }}</el-descriptions-item>
<el-descriptions-item></el-descriptions-item>
<el-descriptions-item label="家庭主要成员" :span="3">
<el-table v-if="viewData.families&&viewData.families.length"
:data="viewData.families" size="mini" border
:header-cell-style="{background:'#eff3f6'}"
style="width: 100%">
<el-table-column prop="relation" label="与本人关系" align="center" header-align="center">
</el-table-column>
<el-table-column prop="name" label="姓名" align="center" header-align="center">
</el-table-column>
<el-table-column prop="unit" label="单位" align="center" header-align="center">
</el-table-column>
<el-table-column prop="remark" label="备注" align="center" header-align="center">
</el-table-column>
</el-table>
<el-empty v-else :image-size="50" description="暂无家庭成员信息"></el-empty>
</el-descriptions-item>
<el-descriptions-item label="个人简况" :span="3">
<template slot="label">个人简况</template>
<div v-if="viewData.vita" class="text-left" v-html="viewData.vita"></div>
<span v-else>无数据</span>
</el-descriptions-item>
<template v-if="viewData.loginname == $store.state.user.loginname">
<el-descriptions-item label="家庭主要成员" :span="3">
<el-table v-if="viewData.families&&viewData.families.length"
:data="viewData.families" size="mini" border
:header-cell-style="{background:'#eff3f6'}"
style="width: 100%">
<el-table-column prop="relation" label="与本人关系" align="center" header-align="center">
</el-table-column>
<el-table-column prop="name" label="姓名" align="center" header-align="center">
</el-table-column>
<el-table-column prop="unit" label="单位" align="center" header-align="center">
</el-table-column>
<el-table-column prop="remark" label="备注" align="center" header-align="center">
</el-table-column>
</el-table>
<el-empty v-else :image-size="50" description="暂无家庭成员信息"></el-empty>
</el-descriptions-item>
<el-descriptions-item label="个人简况" :span="3">
<template slot="label">个人简况</template>
<div v-if="viewData.vita" class="text-left" v-html="viewData.vita"></div>
<span v-else>无数据</span>
</el-descriptions-item>
</template>
</el-descriptions>
</el-tab-pane>
<el-tab-pane label="历史变更记录" name="changeInfo" v-if="viewData.allChangeInfo">
@@ -67,7 +69,7 @@ const MEMBER_ALL_CHANGE_INFO = {
<el-card>
<h4>{{ changeData.changeOriginName }}</h4>
<el-table :data="changeData.changeInfos" size="mini" ref="table" row-key="id" style="width: 100%">
<el-table-column :index="indexMethod" align="center" header-align="center"
<el-table-column align="center" header-align="center"
label="序号" type="index" width="80px"></el-table-column>
<el-table-column prop="fieldName" label="变更字段" header-align="center"></el-table-column>
<el-table-column prop="sourceValue" label="原数据" header-align="center">
@@ -87,7 +89,7 @@ const MEMBER_ALL_CHANGE_INFO = {
</el-tab-pane>
</el-tabs>
`,
mixins: [initTableMixins],
store,
data(){
return{
viewData: {},
@@ -1,306 +1,262 @@
const MEMBER_CHANGE = {
template: /*language=HTML*/ `
<el-card shadow="never">
<div class="process-title">会员变更</div>
<el-form :model="formData" ref="formRef" label-width="0" :rules="formRules" size="small" class="flow-task-form">
<el-descriptions :column="3" border>
<el-descriptions-item label="工号">
<el-form-item prop="loginname">
<el-input v-model="formData.loginname" readonly size="small"></el-input>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="姓名">
<el-form-item prop="username">
<el-input v-model="formData.username" readonly size="small"></el-input>
</el-form-item>
</el-descriptions-item>
<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-group>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="民族">
<el-form-item prop="nation">
<dict-select style="width: 100%" placeholder="请选择民族" v-model="formData.nation"
:disabled="allowFields('nation')" code="USER_NATION"></dict-select>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="出生日期">
<el-form-item prop="birthday">
<el-date-picker v-model="formData.birthday"
type="date"
:disabled="allowFields('birthday')"
placeholder="请选择出生日期"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"
style="width: 100%"></el-date-picker>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="政治面貌">
<el-form-item prop="political">
<dict-select style="width: 100%" placeholder="请选择政治面貌" v-model="formData.political"
:disabled="allowFields('political')" code="USER_POLITICAL"></dict-select>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="学历">
<el-form-item prop="education">
<dict-select style="width: 100%" placeholder="请选择学历" v-model="formData.education"
:disabled="allowFields('education')" code="USER_EDUCATION"></dict-select>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="学位">
<el-form-item prop="academicDegree">
<dict-select style="width: 100%" placeholder="请选择学位" v-model="formData.academicDegree"
:disabled="allowFields('academicDegree')" code="USER_ACADEMIC_DEGREE"></dict-select>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="党政职务">
<el-form-item prop="position">
<el-input v-model="formData.position" placeholder="请输入党政职务"
:disabled="allowFields('position')" maxlength="50"></el-input>
</el-form-item>
</el-descriptions-item>
<template v-if="$auth.hasRoleOr('SYSADMIN, SCHOOL_UNION_ADMIN, SCHOOL_UNION_MEMBER_ADMIN')">
<el-descriptions-item label="工作单位">
<el-form-item prop="unitId">
<el-select clearable filterable placeholder="请选择工作单位" style="width: 100%"
v-model="formData.unitId">
<el-option :key="item.id" :label="item.name" :value="item.id"
v-for="item in units"></el-option>
</el-select>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="所属工会">
<el-form-item prop="unionId">
<el-select clearable filterable placeholder="请选择所属工会" style="width: 100%"
v-model="formData.unionId">
<el-option :key="item.id" :label="item.name" :value="item.id"
v-for="item in unions"></el-option>
</el-select>
</el-form-item>
</el-descriptions-item>
</template>
<template v-else>
<el-descriptions-item label="工作单位">
<el-form-item prop="unitId">
<el-select clearable filterable placeholder="请选择工作单位" style="width: 100%"
:disabled="allowFields('unitId')" @change="getUnionName"
v-model="formData.unitId">
<el-option :key="item.id" :label="item.name" :value="item.id"
v-for="item in units"></el-option>
</el-select>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="所属工会">
<el-form-item prop="unionName">
<el-input v-model="formData.unionName" disabled placeholder="请输入所属工会"></el-input>
</el-form-item>
</el-descriptions-item>
</template>
<el-descriptions-item label="所属校区">
<el-form-item prop="campus">
<dict-select style="width: 100%" placeholder="请选择所属校区" v-model="formData.campus"
:disabled="allowFields('campus')" code="USER_CAMPUS"></dict-select>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="身份证号码">
<el-form-item prop="idCard">
<el-input v-model="formData.idCard" :disabled="allowFields('idCard')" placeholder="请输入身份证号码" maxlength="18"></el-input>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="联系电话">
<el-form-item prop="mobile">
<el-input v-model="formData.mobile" :disabled="allowFields('mobile')" placeholder="请输入联系电话" maxlength="15"></el-input>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="电子邮箱">
<el-form-item prop="email">
<el-input v-model="formData.email" :disabled="allowFields('email')" placeholder="请输入电子邮箱" maxlength="50"></el-input>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="在职状态">
<el-form-item prop="userState">
<dict-select v-model="formData.userState" code="USER_STATE"
:disabled="allowFields('userState')" style="width: 100%"></dict-select>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="人员类型">
<el-form-item prop="personType">
<dict-select v-model="formData.personType" code="PERSON_TYPE"
:disabled="allowFields('personType')" style="width: 100%"></dict-select>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item></el-descriptions-item>
<template v-if="formData.userState == '退休'">
<el-descriptions-item label="退休日期">
<el-form-item prop="retireDate">
<el-date-picker v-model="formData.retireDate"
type="date"
placeholder="请选择出生日期"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"
style="width: 100%"></el-date-picker>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="福利享受截止日期">
<el-form-item prop="welfareStopDate">
<el-date-picker v-model="formData.welfareStopDate"
type="date"
:disabled="isView"
placeholder="请选择福利享受截止日期"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"
style="width: 100%"></el-date-picker>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item></el-descriptions-item>
</template>
<el-descriptions-item label="会员状态">
<el-form-item prop="member">
<el-radio-group v-model="formData.member" size="small">
<el-radio border :label="true">会员</el-radio>
<el-radio border :label="false">非会员</el-radio>
</el-radio-group>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="福利会员状态">
<el-form-item prop="welfareMember">
<el-radio-group v-model="formData.welfareMember" size="small">
<el-radio border :label="true">福利会员</el-radio>
<el-radio border :label="false">非福利会员</el-radio>
</el-radio-group>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item></el-descriptions-item>
<!--<template v-if="formData.member == 1">
<el-descriptions-item label="是否加入会员组别">
<el-form-item prop="member">
<el-radio-group v-model="formData.isJoinActivityMemberScope" size="small">
<el-radio border :label="true">是</el-radio>
<el-radio border :label="false">否</el-radio>
</el-radio-group>
</el-form-item>
</el-descriptions-item>
</template>
<template v-if="formData.member == 0">
<el-descriptions-item label="是否退出会员组别">
<el-form-item prop="member">
<el-radio-group v-model="formData.isExitActivityMemberScope" size="small">
<el-radio border :label="true">是</el-radio>
<el-radio border :label="false"></el-radio>
</el-radio-group>
</el-form-item>
</el-descriptions-item>
</template>
<template v-if="formData.member != null && !formData.welfareMember">
<el-descriptions-item></el-descriptions-item>
<el-descriptions-item></el-descriptions-item>
</template>
<template v-if="formData.welfareMember == true">
<el-descriptions-item label="是否加入福利项目">
<el-form-item prop="isJoinWelfareProject">
<el-radio-group v-model="formData.isJoinWelfareProject" size="small">
<el-radio border :label="true">是</el-radio>
<el-radio border :label="false">否</el-radio>
</el-radio-group>
</el-form-item>
</el-descriptions-item>
<template v-if="formData.isJoinWelfareProject">
<el-descriptions-item label="选择福利项目">
<el-form-item prop="welfareProjectId">
<el-select clearable filterable placeholder="请选择福利项目" style="width: 100%"
v-model="formData.welfareProjectId">
<el-option v-for="item in welfareProjectList"
:key="id" :label="item.name" :value="item.id"></el-option>
</el-select>
</el-form-item>
</el-descriptions-item>
</template>
<template v-else>
<el-descriptions-item></el-descriptions-item>
</template>
</template>-->
<template v-if="formData.loginname == $store.state.user.loginname">
<el-descriptions-item label="家庭主要成员" :span="3">
<el-form-item prop="families">
<el-table :data="formData.families" border size="small">
<el-table-column label="关系" prop="relation">
<template slot-scope="{row}">
<el-input v-model="row.relation" maxlength="50"
placeholder="请输入与本人关系"></el-input>
</template>
</el-table-column>
<el-table-column label="姓名" prop="name">
<template slot-scope="{row}">
<el-input v-model="row.name" maxlength="50" placeholder="请输入姓名"></el-input>
</template>
</el-table-column>
<el-table-column label="工作单位" prop="unit">
<template slot-scope="{row}">
<el-input v-model="row.unit" maxlength="100"
placeholder="请输入工作单位"></el-input>
</template>
</el-table-column>
<el-table-column label="备注" prop="remark">
<template slot-scope="{row}">
<el-input v-model="row.remark" maxlength="100" placeholder="请输入备注"></el-input>
</template>
</el-table-column>
<el-table-column width="100px">
<template slot="header" slot-scope="scope">
<el-button type="primary" size="mini" :disabled="allowFields('families')"
@click="formData.families.push({})">添加
</el-button>
</template>
<template slot-scope="scope">
<el-button
type="danger"
icon="el-icon-delete"
size="mini"
:disabled="formData.families.length===0 || allowFields('families')"
@click="formData.families.splice(scope.$index,1)"
></el-button>
</template>
</el-table-column>
</el-table>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="个人简历" :span="3">
<el-form-item prop="personalData">
<text-editor v-model="formData.personalData"></text-editor>
</el-form-item>
</el-descriptions-item>
</template>
</el-descriptions>
</el-form>
<el-row justify="end" type="flex" class="mt10">
<el-button @click="$emit('do-back')" v-if="formData.id || !isShow" type="primary">返 回</el-button>
<template v-if="isShow">
<el-button @click="doSave" type="primary">保存变更</el-button>
</template>
<el-button @click="doSubmit" type="primary">提交变更</el-button>
</el-row>
<snaker-start slot="header" label="会员变更" define_key="HYBG"></snaker-start>
<el-form :model="formData" ref="formRef" :rules="formRules" label-width="0" label-suffix=""
class="flow-task-form">
<el-descriptions :column="3" border>
<el-descriptions-item label="工号">
<el-form-item prop="loginname">
<el-input v-model="formData.loginname" readonly size="small"></el-input>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="姓名">
<el-form-item prop="username">
<el-input v-model="formData.username" readonly size="small"></el-input>
</el-form-item>
</el-descriptions-item>
<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-group>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="民族">
<el-form-item prop="nation">
<dict-select style="width: 100%" placeholder="请选择民族" v-model="formData.nation"
:disabled="allowFields('nation')" code="USER_NATION"></dict-select>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="出生日期">
<el-form-item prop="birthday">
<el-date-picker v-model="formData.birthday"
type="date"
:disabled="allowFields('birthday')"
placeholder="请选择出生日期"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"
style="width: 100%"></el-date-picker>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="政治面貌">
<el-form-item prop="political">
<dict-select style="width: 100%" placeholder="请选择政治面貌" v-model="formData.political"
:disabled="allowFields('political')" code="USER_POLITICAL"></dict-select>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="学历">
<el-form-item prop="education">
<dict-select style="width: 100%" placeholder="请选择学历" v-model="formData.education"
:disabled="allowFields('education')" code="USER_EDUCATION"></dict-select>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="学位">
<el-form-item prop="academicDegree">
<dict-select style="width: 100%" placeholder="请选择学位" v-model="formData.academicDegree"
:disabled="allowFields('academicDegree')"
code="USER_ACADEMIC_DEGREE"></dict-select>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="党政职务">
<el-form-item prop="position">
<el-input v-model="formData.position" placeholder="请输入党政职务"
:disabled="allowFields('position')" maxlength="50"></el-input>
</el-form-item>
</el-descriptions-item>
<!--<template v-if="$auth.hasRoleOr('SYSADMIN, SCHOOL_UNION_ADMIN, SCHOOL_UNION_MEMBER_ADMIN')">
<el-descriptions-item label="工作单位">
<el-form-item prop="unitId">
<el-select clearable filterable placeholder="请选择工作单位" style="width: 100%"
v-model="formData.unitId">
<el-option :key="item.id" :label="item.name" :value="item.id"
v-for="item in units"></el-option>
</el-select>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="所属工会">
<el-form-item prop="unionId">
<el-select clearable filterable placeholder="请选择所属工会" style="width: 100%"
v-model="formData.unionId">
<el-option :key="item.id" :label="item.name" :value="item.id"
v-for="item in unions"></el-option>
</el-select>
</el-form-item>
</el-descriptions-item>
</template>-->
<template>
<el-descriptions-item label="工作单位">
<el-form-item prop="unitId">
<el-select clearable filterable placeholder="请选择工作单位" style="width: 100%"
:disabled="allowFields('unitId')" @change="getUnionName"
v-model="formData.unitId">
<el-option :key="item.id" :label="item.name" :value="item.id"
v-for="item in units"></el-option>
</el-select>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="所属工会">
<el-form-item prop="unionName">
<el-input v-model="formData.unionName" disabled placeholder="请输入所属工会"></el-input>
</el-form-item>
</el-descriptions-item>
</template>
<el-descriptions-item label="所属校区">
<el-form-item prop="campus">
<dict-select style="width: 100%" placeholder="请选择所属校区" v-model="formData.campus"
:disabled="allowFields('campus')" code="USER_CAMPUS"></dict-select>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="身份证号码">
<el-form-item prop="idCard">
<el-input v-model="formData.idCard" :disabled="allowFields('idCard')"
placeholder="请输入身份证号码" maxlength="18"></el-input>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="联系电话">
<el-form-item prop="mobile">
<el-input v-model="formData.mobile" :disabled="allowFields('mobile')"
placeholder="请输入联系电话" maxlength="15"></el-input>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="电子邮箱">
<el-form-item prop="email">
<el-input v-model="formData.email" :disabled="allowFields('email')"
placeholder="请输入电子邮箱" maxlength="50"></el-input>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="在职状态">
<el-form-item prop="userState">
<dict-select v-model="formData.userState" code="USER_STATE"
:disabled="allowFields('userState')" style="width: 100%"></dict-select>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="人员类型">
<el-form-item prop="personType">
<dict-select v-model="formData.personType" code="USER_PERSON_TYPE"
:disabled="allowFields('personType')" style="width: 100%"></dict-select>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item></el-descriptions-item>
<template v-if="formData.userState == '退休'">
<el-descriptions-item label="退休日期">
<el-form-item prop="retireDate">
<el-date-picker v-model="formData.retireDate"
type="date"
placeholder="请选择出生日期"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"
style="width: 100%"></el-date-picker>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="福利享受截止日期">
<el-form-item prop="welfareStopDate">
<el-date-picker v-model="formData.welfareStopDate"
type="date"
:disabled="isView"
placeholder="请选择福利享受截止日期"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"
style="width: 100%"></el-date-picker>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item></el-descriptions-item>
</template>
<el-descriptions-item label="会员状态" :span="1.5">
<el-form-item prop="member">
<el-radio-group v-model="formData.member" size="small">
<el-radio border :label="true">会员</el-radio>
<el-radio border :label="false">非会员</el-radio>
</el-radio-group>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="福利会员状态" :span="1.5">
<el-form-item prop="welfareMember">
<el-radio-group v-model="formData.welfareMember" size="small">
<el-radio border :label="true">福利会员</el-radio>
<el-radio border :label="false">非福利会员</el-radio>
</el-radio-group>
</el-form-item>
</el-descriptions-item>
<template v-if="formData.loginname == $store.state.user.loginname">
<el-descriptions-item label="家庭主要成员" :span="3">
<el-form-item prop="families">
<el-table :data="formData.families" border size="small">
<el-table-column label="关系" prop="relation">
<template slot-scope="{row}">
<el-input v-model="row.relation" maxlength="50"
placeholder="请输入与本人关系"></el-input>
</template>
</el-table-column>
<el-table-column label="姓名" prop="name">
<template slot-scope="{row}">
<el-input v-model="row.name" maxlength="50"
placeholder="请输入姓名"></el-input>
</template>
</el-table-column>
<el-table-column label="工作单位" prop="unit">
<template slot-scope="{row}">
<el-input v-model="row.unit" maxlength="100"
placeholder="请输入工作单位"></el-input>
</template>
</el-table-column>
<el-table-column label="备注" prop="remark">
<template slot-scope="{row}">
<el-input v-model="row.remark" maxlength="100"
placeholder="请输入备注"></el-input>
</template>
</el-table-column>
<el-table-column width="100px">
<template slot="header" slot-scope="scope">
<el-button type="primary" size="mini" :disabled="allowFields('families')"
@click="formData.families.push({})">添加
</el-button>
</template>
<template slot-scope="scope">
<el-button
type="danger"
icon="el-icon-delete"
size="mini"
:disabled="formData.families.length===0 || allowFields('families')"
@click="formData.families.splice(scope.$index,1)"
></el-button>
</template>
</el-table-column>
</el-table>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="个人简历" :span="3">
<el-form-item prop="personalData">
<text-editor v-model="formData.personalData"></text-editor>
</el-form-item>
</el-descriptions-item>
</template>
</el-descriptions>
</el-form>
<el-row type="flex" justify="end" class="mt20">
<el-button type="primary" plain @click="$emit('do-back')">返回</el-button>
<el-button type="primary" @click="onSubmit">提交变更</el-button>
</el-row>
<!-- <el-row justify="end" type="flex" class="mt10">-->
<!-- <el-button @click="$emit('do-back')" v-if="formData.id || !isShow" type="primary">返 回</el-button>-->
<!-- <template v-if="isShow">-->
<!-- <el-button @click="doSave" type="primary">保存变更</el-button>-->
<!-- </template>-->
<!-- <el-button @click="doSubmit" type="primary">提交变更</el-button>-->
<!-- </el-row>-->
</el-card>
`,
props: {
@@ -390,7 +346,7 @@ const MEMBER_CHANGE = {
methods: {
getUnionName(val){
const data = this.units.find(v => v.id === val)
this.$set(this.formData, 'unionName', data ? data.unionname : '')
this.$set(this.formData, 'unionName', data ? data.unionName : '')
},
allowFields(prop) {
return !this.allowChangeFields.map(v => v.code).includes(prop)
@@ -406,7 +362,7 @@ const MEMBER_CHANGE = {
})
.catch()
},
doSubmit() {
onSubmit() {
this.$refs.formRef.validate((valid) => {
if (valid) {
this.$confirm("提交后将进入审核流程,无法再进行编辑,您确定要提交申请吗?", "提示", { type: "warning" })
@@ -32,7 +32,7 @@ layout("/layouts/platform.html"){
</search-item>
<search-item label="人员类型">
<dict-select v-model="pageForm.personType" placeholder="人员类型" @change="doSearch"
code="PERSON_TYPE"></dict-select>
code="USER_PERSON_TYPE"></dict-select>
</search-item>
<search-item label="更新日期">
<el-date-picker :picker-options="pickerOptions" @change="changeDateRangeChange"
@@ -210,7 +210,6 @@ layout("/layouts/platform.html"){
unions: [],
units: [],
id: "",
url: "",
tableColumns: [
{prop: 'loginname', label: '工号', sortable: true},
{prop: 'username', label: '姓名', sortable: true},
@@ -285,16 +284,11 @@ layout("/layouts/platform.html"){
async initData() {
const isAdmin = this.$auth.hasRoleOr(["SYSADMIN", "SCHOOL_UNION_ADMIN"])
if (isAdmin) {
this.$businessTool.listUnion(this.pageForm.unionId).then(data => {
this.unions = data
})
this.unions = await this.$businessTool.listUnion(this.pageForm.unionId)
} else {
this.$businessTool.listUnion(this.$store.state.user.union.id).then(data => {
this.unions = data
})
this.unions = await this.$businessTool.listUnion(this.$store.state.user.union.id)
}
this.changeTypeData = await this.$businessTool.getEnumOptions("MemberChangeType")
this.url = isAdmin ? "/platform/member/school/manage/generalMemberChange" : "/platform/member/branch/manage/generalMemberChange"
},
async flushUnits() {
this.$set(this.pageForm, "unitId", null)
@@ -29,7 +29,7 @@ layout("/layouts/platform.html"){
</search-item>
<search-item label="人员类型">
<dict-select v-model="pageForm.personType" placeholder="人员类型" @change="doSearch"
code="PERSON_TYPE"></dict-select>
code="USER_PERSON_TYPE"></dict-select>
</search-item>
<search-item label="变更类型">
<dict-select v-model="pageForm.changeType" placeholder="变更类型" @change="doSearch"
@@ -133,7 +133,7 @@
</el-descriptions-item>
<el-descriptions-item label="人员类型">
<el-form-item prop="personType">
<dict-select v-model="formData.personType" code="PERSON_TYPE"
<dict-select v-model="formData.personType" code="USER_PERSON_TYPE"
:disabled="allowFields('personType')" style="width: 100%"></dict-select>
</el-form-item>
</el-descriptions-item>
@@ -69,7 +69,7 @@ layout("/layouts/platform.html"){
</el-form-item>
</el-descriptions-item>
<template v-if="$auth.hasRoleOr('SYSADMIN, SCHOOL_UNION_ADMIN, SCHOOL_UNION_MEMBER_ADMIN')">
<!--<template v-if="$auth.hasRoleOr('SYSADMIN, SCHOOL_UNION_ADMIN, SCHOOL_UNION_MEMBER_ADMIN')">
<el-descriptions-item label="工作单位">
<el-form-item prop="unitId">
<el-select clearable filterable placeholder="请选择工作单位" style="width: 100%"
@@ -88,8 +88,8 @@ layout("/layouts/platform.html"){
</el-select>
</el-form-item>
</el-descriptions-item>
</template>
<template v-else>
</template>-->
<template>
<el-descriptions-item label="工作单位">
<el-form-item prop="unitId">
<el-select clearable filterable placeholder="请选择工作单位" style="width: 100%"
@@ -138,7 +138,7 @@ layout("/layouts/platform.html"){
</el-descriptions-item>
<el-descriptions-item label="人员类型">
<el-form-item prop="personType">
<dict-select v-model="formData.personType" code="PERSON_TYPE"
<dict-select v-model="formData.personType" code="USER_PERSON_TYPE"
:disabled="allowFields('personType')" style="width: 100%"></dict-select>
</el-form-item>
</el-descriptions-item>
@@ -438,7 +438,7 @@ layout("/layouts/platform.html"){
// 获取表单工会名称
getUnionName(val){
const data = this.units.find(v => v.id === val)
this.$set(this.formData, 'unionName', data ? data.unionname : '')
this.$set(this.formData, 'unionName', data ? data.unionName : '')
},
// 获取表单可编辑的字段信息
allowFields(prop) {
@@ -103,7 +103,7 @@ layout("/layouts/platform.html"){
new Vue({
el: "#app",
mixins: [initTableMixins],
dicts: ["USER_STATE", "PERSON_TYPE", "MEMBER_CHANGE_TYPE"],
dicts: ["USER_STATE", "USER_PERSON_TYPE", "MEMBER_CHANGE_TYPE"],
data() {
return {
pageForm: {
@@ -28,7 +28,7 @@ layout("/layouts/platform.html"){
</search-item>
<search-item label="人员类型">
<dict-select v-model="pageForm.personType" placeholder="人员类型" @change="doSearch"
code="PERSON_TYPE"></dict-select>
code="USER_PERSON_TYPE"></dict-select>
</search-item>
</search>
</el-card>
@@ -25,7 +25,7 @@ const SCHOOL_VIEW_AND_HANDLE = {
</search-item>
<search-item label="人员类型">
<dict-select v-model="pageForm.personType" placeholder="人员类型" @change="doSearch"
code="PERSON_TYPE"></dict-select>
code="USER_PERSON_TYPE"></dict-select>
</search-item>
</search>
</el-card>
@@ -23,7 +23,7 @@ const VIEW_CHANGE_TYPE_USER = {
</search-item>
<search-item label="人员类型">
<dict-select v-model="pageForm.personType" placeholder="人员类型" @change="doSearch"
code="PERSON_TYPE"></dict-select>
code="USER_PERSON_TYPE"></dict-select>
</search-item>
</search>
</el-card>
@@ -25,7 +25,7 @@ const VERIFICATION_QUERY = {
</search-item>
<search-item label="人员类型">
<dict-select v-model="pageForm.personType" placeholder="人员类型" @change="doSearch"
code="PERSON_TYPE"></dict-select>
code="USER_PERSON_TYPE"></dict-select>
</search-item>
<search-item label="变更类型">
<dict-select v-model="pageForm.changeType" placeholder="变更类型" @change="doSearch"
@@ -30,7 +30,7 @@ const VERIFICATION_SET_USER_LIST = {
</search-item>
<search-item label="人员类型">
<dict-select v-model="pageForm.personType" placeholder="人员类型" @change="doSearch"
code="PERSON_TYPE"></dict-select>
code="USER_PERSON_TYPE"></dict-select>
</search-item>
<search-item label="聘用方式">
<dict-select v-model="pageForm.preparedBy" placeholder="聘用方式" @change="doSearch"
@@ -32,7 +32,7 @@ const VERIFICATION_SHOW_SELECTION_USERS = {
</search-item>
<search-item label="人员类型">
<dict-select v-model="pageForm.personType" placeholder="人员类型" @change="doSearch"
code="PERSON_TYPE"></dict-select>
code="USER_PERSON_TYPE"></dict-select>
</search-item>
</search>
</el-card>
@@ -1,167 +1,196 @@
<!--#
layout("/layouts/platform.html"){
#-->
<style></style>
<div id="app">
<guava ref="guava">
<template>
<query-form @query="assignmentTableData" ref="queryFormRef"></query-form>
<el-card shadow="never">
<table-tool label="会员列表">
<el-select
v-model="pageForm.searchType"
placeholder="是否会员"
clearable
style="width: 120px"
@change="pageData"
class="mr10"
size="small"
>
<el-option label="全部教工" value="all"></el-option>
<el-option label="会员" value="member"></el-option>
<el-option label="非会员" value="unMember"></el-option>
</el-select>
<el-select
v-model="pageForm.isUnit"
placeholder="是否有单位"
clearable
style="width: 120px"
@change="pageData"
class="mr10"
size="small"
>
<el-option label="有单位" value="true"></el-option>
<el-option label="无单位" value="false"></el-option>
</el-select>
<el-select
v-model="pageForm.isUnion"
placeholder="是否有工会"
clearable
style="width: 120px"
@change="pageData"
class="mr10"
size="small"
>
<el-option label="有工会" value="true"></el-option>
<el-option label="无工会" value="false"></el-option>
</el-select>
<el-button icon="el-icon-printer" type="primary" style="float: right" size="small" @click="doExport">导出</el-button>
</table-tool>
<el-table
:data="tableData"
style="width: 100%"
stripe
border
:header-cell-style="{background:'#FAFAFA'}"
row-key="id"
@sort-change="pageOrder"
>
<el-table-column
align="center"
header-align="center"
type="index"
:index="indexMethod"
label="序号"
width="80px"
></el-table-column>
<el-table-column
align="center"
header-align="center"
v-for="column in tableColumns"
show-overflow-tooltip
:label="column.label"
:prop="column.prop"
:width="column.width"
:sortable="column.sortable"
>
<template v-if="column.prop==='memberJoinTime'" scope="{row}">{{$moment(row.memberJoinTime).format('YYYY-MM-DD')}}</template>
<template v-else-if="column.prop==='birthday'" scope="{row}">
{{row.birthday ? $moment(row.birthday).format('YYYY-MM-DD') : null}}
</template>
</el-table-column>
<el-table-column align="center" header-align="center" label="操作" width="100px">
<template scope="{row}">
<el-button size="mini" @click="openView(row.id)" type="primary">查看</el-button>
</template>
</el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
</template>
<template #view>
<member-info ref="memberInfoRef"></member-info>
</template>
</guava>
<guava ref="guava">
<template>
<query-form @search="search" ref="queryFormRef"></query-form>
<el-card shadow="never">
<table-tool label="会员列表">
<el-select
v-model="pageForm.searchType"
placeholder="是否会员"
clearable
style="width: 120px"
@change="pageData"
class="mr10"
size="small"
>
<el-option label="全部教工" value="all"></el-option>
<el-option label="会员" value="member"></el-option>
<el-option label="非会员" value="unMember"></el-option>
</el-select>
<el-select
v-model="pageForm.isUnit"
placeholder="是否有单位"
clearable
style="width: 120px"
@change="pageData"
class="mr10"
size="small"
>
<el-option label="有单位" value="true"></el-option>
<el-option label="无单位" value="false"></el-option>
</el-select>
<el-select
v-model="pageForm.isUnion"
placeholder="是否有工会"
clearable
style="width: 120px"
@change="pageData"
class="mr10"
size="small"
>
<el-option label="有工会" value="true"></el-option>
<el-option label="无工会" value="false"></el-option>
</el-select>
<el-button icon="el-icon-printer" class="m10" type="primary" style="float: right" size="small" @click="doExport">导出</el-button>
</table-tool>
<el-table
:data="tableData"
style="width: 100%"
stripe
border
:header-cell-style="{background:'#FAFAFA'}"
row-key="id"
@sort-change="pageOrder"
>
<el-table-column
align="center"
header-align="center"
type="index"
:index="indexMethod"
label="序号"
width="80px"
></el-table-column>
<el-table-column
align="center"
header-align="center"
v-for="column in tableColumns"
show-overflow-tooltip
:label="column.label"
:prop="column.prop"
:width="column.width"
:sortable="column.sortable"
>
<template v-if="column.prop==='memberJoinTime'" scope="{row}">{{$moment(row.memberJoinTime).format('YYYY-MM-DD')}}</template>
<template v-else-if="column.prop==='birthday'" scope="{row}">
{{row.birthday ? $moment(row.birthday).format('YYYY-MM-DD') : null}}
</template>
</el-table-column>
<el-table-column align="center" header-align="center" label="操作" width="100px">
<template scope="{row}">
<el-button size="mini" @click="openView(row.id)" type="primary">查看</el-button>
</template>
</el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
</template>
<template #view>
<member-info ref="memberInfoRef"></member-info>
</template>
</guava>
</div>
<script>
<!--#include("queryForm.js"){}#-->
<!--#include("../../common/info/memberInfo.js"){}#-->
new Vue({
el: "#app",
store,
mixins: [initTableMixins],
data() {
return {
pageForm: {
searchType: "member"
},
unions: [],
units: [],
childrenData: {},
tableColumns: [
{ prop: "loginname", label: "工号", fixed: "left" },
{ prop: "username", label: "姓名", fixed: "left" },
{ prop: "sex", label: "性别" },
{ prop: "birthday", label: "出生年月", width: 120, sortable: true },
{ prop: "mobile", label: "联系电话" },
{ prop: "userState", label: "在职状态", width: 120, sortable: true },
{ prop: "personType", label: "教职工类别", width: 120, sortable: true },
{ prop: "preparedBy", label: "聘用方式", width: 120, sortable: true },
{ prop: "postDoctoralJoinDate", label: "进站时间", sortable: true },
{ prop: "identityType", label: "身份类型", width: 120, sortable: true },
{ prop: "unionName", label: "所属工会", width: 120, sortable: true },
{ prop: "unitName", label: "所属单位", width: 120, sortable: true },
{ prop: "arrivalAtSchoolDate", label: "来校年月", width: 120, sortable: true }
]
}
},
components: {
"query-form": MEMBER_STATISTICS_COMPREHENSIVE_QUERY_FORM,
"member-info": MEMBER_INFO
},
methods: {
openView(id) {
this.$refs.guava.view(() => {
this.$refs.memberInfoRef.onOpen(id)
})
},
doExport() {
const pageForm = clone(this.pageForm)
pageForm.unionId = JSON.stringify(this.pageForm.unionId)
pageForm.unitId = JSON.stringify(this.pageForm.unitId)
pageForm.sexTypes = JSON.stringify(this.pageForm.sexTypes)
pageForm.memberTypes = JSON.stringify(this.pageForm.memberTypes)
pageForm.personTypes = JSON.stringify(this.pageForm.personTypes)
pageForm.userStates = JSON.stringify(this.pageForm.userStates)
this.$downLoad("/platform/member/statistics/comprehensive/doExport", pageForm)
},
assignmentTableData(data) {
this.tableData = data.list
this.pageForm = this.$refs.queryFormRef.pageForm
this.pageForm.totalCount = data.totalCount
},
pageData() {
this.$refs.queryFormRef.pageForm = this.pageForm
this.$refs.queryFormRef.pageData()
}
}
})
<!--#include("queryForm.js"){}#-->
<!--#include("../../common/info/memberInfo.js"){}#-->
new Vue({
el: "#app",
store,
mixins: [initTableMixins],
data() {
return {
pageForm: {
searchType: "member"
},
unions: [],
units: [],
childrenData: {},
tableColumns: [
{ prop: "loginname", label: "工号", fixed: "left" },
{ prop: "username", label: "姓名", fixed: "left" },
{ prop: "sex", label: "性别" },
{ prop: "birthday", label: "出生年月", width: 120, sortable: true },
{ prop: "mobile", label: "联系电话" },
{ prop: "userState", label: "在职状态", width: 120, sortable: true },
{ prop: "personType", label: "教职工类别", width: 120, sortable: true },
{ prop: "preparedBy", label: "聘用方式", width: 120, sortable: true },
{ prop: "postDoctoralJoinDate", label: "进站时间", sortable: true },
{ prop: "identityType", label: "身份类型", width: 120, sortable: true },
{ prop: "unionName", label: "所属工会", width: 120, sortable: true },
{ prop: "unitName", label: "所属单位", width: 120, sortable: true },
{ prop: "arrivalAtSchoolDate", label: "来校年月", width: 120, sortable: true }
]
}
},
components: {
"query-form": MEMBER_STATISTICS_COMPREHENSIVE_QUERY_FORM,
"member-info": MEMBER_INFO
},
methods: {
openView(id) {
this.$refs.guava.view(() => {
this.$refs.memberInfoRef.onOpen(id)
})
},
doExport() {
const pageForm = clone(this.pageForm)
pageForm.unionId = JSON.stringify(this.pageForm.unionId)
pageForm.unitId = JSON.stringify(this.pageForm.unitId)
pageForm.sexTypes = JSON.stringify(this.pageForm.sexTypes)
pageForm.memberTypes = JSON.stringify(this.pageForm.memberTypes)
pageForm.personTypes = JSON.stringify(this.pageForm.personTypes)
pageForm.userStates = JSON.stringify(this.pageForm.userStates)
this.$downLoad("/platform/member/statistics/comprehensive/doExport", pageForm)
},
search(pageForm) {
this.pageForm = {
...this.pageForm,
...pageForm,
}
this.pageData()
},
pageData() {
const pageForm = clone(this.pageForm)
pageForm.age = JSON.stringify(this.pageForm.age)
pageForm.unionId = JSON.stringify(this.pageForm.unionId)
pageForm.unitId = JSON.stringify(this.pageForm.unitId)
pageForm.sexTypes = JSON.stringify(this.pageForm.sexTypes)
pageForm.memberTypes = JSON.stringify(this.pageForm.memberTypes)
pageForm.personTypes = JSON.stringify(this.pageForm.personTypes)
pageForm.preparedBys = JSON.stringify(this.pageForm.preparedBys)
pageForm.memberStatus = JSON.stringify(this.pageForm.memberStatus)
pageForm.userStates = JSON.stringify(this.pageForm.userStates)
if (pageForm.birthdayRange && pageForm.birthdayRange.length > 0) {
pageForm.startDate = pageForm.birthdayRange[0]
pageForm.endDate = pageForm.birthdayRange[1]
}
if (pageForm.joinMemberRange && pageForm.joinMemberRange.length > 0) {
pageForm.startJoinDate = pageForm.joinMemberRange[0]
pageForm.endJoinDate = pageForm.joinMemberRange[1]
}
if (pageForm.leaveMemberRange && pageForm.leaveMemberRange.length > 0) {
pageForm.startLeaveDate = pageForm.leaveMemberRange[0]
pageForm.endLeaveDate = pageForm.leaveMemberRange[1]
}
this.$axios.post("/platform/member/statistics/comprehensive/pageData", pageForm).then((res) => {
if (res.code === 0) {
this.tableData = res.data.list
this.pageForm.totalCount = res.data.totalCount
} else {
this.$message.error(res.msg)
}
})
}
}
})
</script>
<!--#
}
@@ -1,131 +1,201 @@
const MEMBER_STATISTICS_COMPREHENSIVE_QUERY_FORM = {
template: /*language=HTML*/ `
<el-card shadow="never">
<search @search="doSearch">
<search-item label="年度">
<el-date-picker @change="doSearch"
:picker-options="pickerOptions"
style="width: 100%"
v-model="pageForm.year"
type="year"
value-format="yyyy"
placeholder="选择年" :clearable="false">
</el-date-picker>
</search-item>
<search-item label="姓名工号">
<el-input placeholder="请输入姓名或者工号" clearable v-model="pageForm.searchKeyword"></el-input>
</search-item>
<search-item label="所属工会">
<el-select placeholder="所属工会"
v-model="pageForm.unionId"
clearable
multiple
@change="flushUnits();doSearch()"
@clear="flushUnits();doSearch()"
filterable>
<el-option v-for="item in unions"
:key="item.id"
:label="item.name"
:value="item.id"></el-option>
</el-select>
</search-item>
<search-item label="所属单位">
<el-select placeholder="所属单位"
v-model="pageForm.unitId"
clearable
multiple
filterable>
<el-option v-for="item in units"
:label="item.name"
:key="item.id"
:value="item.id"></el-option>
</el-select>
</search-item>
<search-item label="性别">
<el-select v-model="pageForm.sexTypes" clearable multiple placeholder="性别">
<el-option label="男" value="男"></el-option>
<el-option label="女" value="女"></el-option>
</el-select>
</search-item>
<search-item label="人员类型">
<dict-select
clearable
code="USER_PERSON_TYPE"
multiple
collapse-tags
placeholder="请选择人员类型"
v-model="pageForm.personTypes"
></dict-select>
</search-item>
<search-item label="聘用方式">
<dict-select clearable
code="USER_PREPARED_BY_TYPE"
multiple
collapse-tags
placeholder="请选择聘用方式"
v-model="pageForm.preparedBys"></dict-select>
</search-item>
<search-item label="在职状态">
<dict-select
clearable
code="USER_STATE"
multiple
collapse-tags
placeholder="请选择人员状态"
v-model="pageForm.userStates"
></dict-select>
</search-item>
<search-item label="出生日期">
<el-date-picker
v-model="pageForm.startDate"
type="date"
@change="determineStartDate"
style="width: 100%"
placeholder="选择开始出生日期">
</el-date-picker>
</search-item>
<search-item label="出生日期">
<el-date-picker
v-model="pageForm.endDate"
type="date"
@change="determineEndDate"
style="width: 100%"
placeholder="选择结束出生日期">
</el-date-picker>
</search-item>
<search-item label="年龄区间">
<div style="display: flex;align-items: center">
<el-slider
v-model="pageForm.age"
range
show-stops
:max="100"
style="flex: 1;padding: 0 12px"
>
</el-slider>
<div style="width: 70px;flex-shrink: 0;text-align: right">
{{ pageForm.age ? pageForm.age.join('-') : '' }}
</div>
</div>
</search-item>
</search>
<!-- <el-row type="flex" align="middle" class="query-row">-->
<!-- <el-col class="query-row-title">模糊查询:</el-col>-->
<!-- <el-col class="query-row-content">-->
<!-- <member-cnd @cnd="(v)=>pageForm={...pageForm,...v}"></member-cnd>-->
<!-- </el-col>-->
<!-- </el-row>-->
<!-- <el-row class="query-row" style="justify-content: end">-->
<!-- <el-checkbox v-model="pageForm.reverseSelection" label="是否反选" border-->
<!-- @change="doSearch"-->
<!-- class="reverseCheckBox"></el-checkbox>-->
<!-- <el-button type="danger" icon="el-icon-circle-close" @click="doReset">重置-->
<!-- </el-button>-->
<!-- <el-button type="primary" icon="el-icon-search" @click="doSearch">搜索</el-button>-->
<!-- </el-row>-->
<el-row type="flex" align="middle" class="query-row">
<el-col class="query-row-title">年&emsp;&emsp;度:</el-col>
<el-col class="query-row-content" :span="12">
<el-row style="margin-left: 3px">
<el-date-picker @change="doSearch()"
style="width: 85%"
:picker-options="pickerOptions"
v-model="pageForm.year"
type="year"
value-format="yyyy"
placeholder="选择年" :clearable="false">
</el-date-picker>
<el-link type="primary" style="margin-left: 10px"
:underline="false"
@click="setNowYear();doSearch()">
本年
</el-link>
</el-row>
</el-col>
<el-col class="query-row-title">姓名/工号:</el-col>
<el-col class="query-row-content" :span="12">
<el-row style="width: 92%">
<el-input placeholder="请输入内容" clearable v-model="pageForm.searchKeyword"></el-input>
</el-row>
</el-col>
</el-row>
<el-row type="flex" align="middle" class="query-row">
<el-col class="query-row-content">
<el-row>
<el-col :span="12">
<span>所属工会:</span>
<el-select placeholder="所属工会" v-model="pageForm.unionId"
clearable multiple style="margin-left: 33px;width: 80%"
@change="flushUnits();doSearch()"
@clear="flushUnits();doSearch()"
filterable>
<el-option v-for="item in unions" :label="item.name"
:value="item.id"></el-option>
</el-select>
</el-col>
<el-col :span="12">
<span>所属单位:</span>
<el-select placeholder="所属单位" v-model="pageForm.unitId"
clearable multiple style="margin-left: 33px;width: 80%" filterable>
<el-option v-for="item in units" :label="item.name"
:value="item.id"></el-option>
</el-select>
</el-col>
</el-row>
</el-col>
</el-row>
<el-row class="query-row">
<el-col class="query-row-title">性别:</el-col>
<el-col class="query-row-content">
<el-tag
:effect="pageForm.sexTypes.includes(item.name)?'dark':'plain'"
:key="item.code"
:type="item.name"
@click="tagClick('sexTypes',item.name)"
style="margin-right: 10px;cursor: pointer"
v-for="item in sexTypeOptions">
{{ item.name }}
</el-tag>
</el-col>
</el-row>
<el-row type="flex" align="middle" class="query-row query-row-tag">
<el-col class="query-row-title">人员类型:</el-col>
<el-col class="query-row-content query-row-content-tag">
<el-tag
style="margin-right: 10px;cursor: pointer"
v-for="item in personTypeOptions"
:key="item.code"
:type="item.name"
:effect="pageForm.personTypes.includes(item.name)?'dark':'plain'"
@click="tagClick('personTypes',item.name)">
{{ item.name }}
</el-tag>
<el-link type="danger"
v-if="personTypeOptions.length&&pageForm.personTypes.length"
:underline="false"
@click="pageForm.personTypes=[];doSearch()">清空
</el-link>
<el-link :underline="false"
@click="pageForm.personTypes=personTypeOptions.map(p=>p.code);doSearch()"
type="success">全部
</el-link>
</el-col>
</el-row>
<el-row type="flex" align="middle" class="query-row query-row-tag">
<el-col class="query-row-title">人事编制:</el-col>
<el-col class="query-row-content query-row-content-tag">
<el-tag
style="margin-right: 10px;cursor: pointer"
v-for="item in preparedByOptions"
:key="item.code"
:type="item.name"
:effect="pageForm.preparedBys.includes(item.name)?'dark':'plain'"
@click="tagClick('preparedBys',item.name)">
{{ item.name }}
</el-tag>
<el-link type="danger"
v-if="preparedByOptions.length&&pageForm.preparedBys.length"
:underline="false"
@click="pageForm.preparedBys=[];doSearch()">清空
</el-link>
<el-link :underline="false"
@click="pageForm.preparedBys=preparedByOptions.map(p=>p.code);doSearch()"
type="success">全部
</el-link>
</el-col>
</el-row>
<el-row type="flex" align="middle" class="query-row query-row-tag">
<el-col class="query-row-title">在职状态:</el-col>
<el-col class="query-row-content query-row-content-tag">
<el-tag
style="margin-right: 10px;cursor: pointer"
v-for="item in userStateOptions"
:key="item.code"
:type="item.name"
:effect="pageForm.userStates.includes(item.name)?'dark':'plain'"
@click="tagClick('userStates',item.name)">
{{ item.name }}
</el-tag>
<el-link type="danger"
v-if="userStateOptions.length&&pageForm.userStates.length"
:underline="false"
@click="pageForm.userStates=[];doSearch()">清空
</el-link>
<el-link :underline="false"
@click="pageForm.userStates=userStateOptions.map(p=>p.code);doSearch()"
type="success">全部
</el-link>
</el-col>
</el-row>
<el-row class="query-row" type="flex" align="middle">
<el-col class="query-row-title">出生日期:</el-col>
<el-col class="query-row-content">
<el-date-picker
v-model="pageForm.startDate"
type="date"
@change="determineStartDate"
placeholder="选择开始日期">
</el-date-picker>
<el-date-picker
v-model="pageForm.endDate"
type="date"
@change="determineEndDate"
placeholder="选择结束日期">
</el-date-picker>
</el-col>
</el-row>
<el-row class="query-row" type="flex" align="middle">
<el-col class="query-row-title">年龄范围:</el-col>
<el-col class="query-row-content">
<el-row type="flex" style="align-items: center">
<el-col :span="15">
<el-slider
v-model="pageForm.age"
range
show-stops
:max="100">
</el-slider>
</el-col>
<el-col :span="9" class="pl20">
当前范围:{{ pageForm.age }}
</el-col>
</el-row>
</el-col>
</el-row>
<el-row type="flex" align="middle" class="query-row">
<el-col class="query-row-title">模糊查询:</el-col>
<el-col class="query-row-content">
<member-cnd @cnd="(v)=>pageForm={...pageForm,...v}"></member-cnd>
</el-col>
</el-row>
<el-row class="query-row" style="justify-content: end">
<el-checkbox v-model="pageForm.reverseSelection" label="是否反选" border
@change="doSearch"
class="reverseCheckBox"></el-checkbox>
<el-button type="danger" icon="el-icon-circle-close" @click="doReset">重置
</el-button>
<el-button type="primary" icon="el-icon-search" @click="doSearch">搜索</el-button>
</el-row>
</el-card>
`,
mixins: [initTableMixins],
@@ -259,8 +329,6 @@ const MEMBER_STATISTICS_COMPREHENSIVE_QUERY_FORM = {
this.pageForm.activityUserCnd = ""
this.pageForm.age = [0, 0]
this.pageForm.reverseSelection = false
this.pageForm.startDate = ""
this.pageForm.endDate = ""
this.doSearch()
},
getMenuOptions() {
@@ -270,9 +338,6 @@ const MEMBER_STATISTICS_COMPREHENSIVE_QUERY_FORM = {
}
})
},
setNowYear() {
this.$set(this.pageForm, "year", moment().format("YYYY"))
},
async initData() {
if (this.$auth.hasRoleOr(["SYSADMIN", "SCHOOL_UNION_ADMIN"])) {
this.unions = await this.$businessTool.listUnion(this.pageForm.unionId)
@@ -281,18 +346,15 @@ const MEMBER_STATISTICS_COMPREHENSIVE_QUERY_FORM = {
this.unions = await this.$businessTool.listUnion(this.$store.state.user.union.id)
this.units = await this.$businessTool.listUnit(this.$store.state.user.union.id)
}
this.$businessTool.getDictOptions("USER_STAFF_TYPE").then((data) => {
this.$businessTool.getDictOptions("USER_PERSON_TYPE").then((data) => {
this.personTypeOptions = data
})
this.$businessTool.getDictOptions("USER_EMPLOYMENT_TYPE").then((data) => {
this.$businessTool.getDictOptions("USER_PREPARED_BY_TYPE").then((data) => {
this.preparedByOptions = data
})
this.$businessTool.getDictOptions("USER_STATE").then((data) => {
this.userStateOptions = data
})
this.$businessTool.getAllDictOptions("MEMBER_CHANGE_TYPE").then((data) => {
this.memberStatusOptions = data
})
},
flushUnits() {
this.$set(this.pageForm, "unitId", null)
@@ -308,28 +370,62 @@ const MEMBER_STATISTICS_COMPREHENSIVE_QUERY_FORM = {
this.pageForm.isUnion = params.isUnion
this.pageData()
},
pageData() {
const pageForm = clone(this.pageForm)
pageForm.age = JSON.stringify(this.pageForm.age)
pageForm.unionId = JSON.stringify(this.pageForm.unionId)
pageForm.unitId = JSON.stringify(this.pageForm.unitId)
pageForm.sexTypes = JSON.stringify(this.pageForm.sexTypes)
pageForm.memberTypes = JSON.stringify(this.pageForm.memberTypes)
pageForm.personTypes = JSON.stringify(this.pageForm.personTypes)
pageForm.preparedBys = JSON.stringify(this.pageForm.preparedBys)
pageForm.memberStatus = JSON.stringify(this.pageForm.memberStatus)
pageForm.userStates = JSON.stringify(this.pageForm.userStates)
this.$axios.post("/platform/member/statistics/comprehensive/pageData", pageForm).then((data) => {
if (data.code === 0) {
this.$emit("query", data.data)
} else {
this.$message.error(data.msg)
}
})
doSearch() {
this.$emit('search', this.pageForm)
}
},
created() {
this.initData()
this.pageData()
}
this.doSearch()
},
style: /*language=CSS*/ `
/deep/ .reverseCheckBox {
margin: 0 10px 0 0 !important;
}
/deep/ .query-row {
min-height: 60px;
display: flex;
justify-content: center;
align-items: center;
box-sizing: border-box;
}
/deep/ .query-row:not(:last-child) {
border-bottom: 1px dashed rgb(230, 230, 230);
}
/deep/ .query-row-title {
width: 120px;
}
/deep/ .query-row > .query-title {
width: 100px;
max-width: 100px;
min-width: 100px;
overflow: hidden;
}
/deep/ .query-row > .query-content {
min-width: 200px;
overflow: hidden;
}
/deep/ .query-row > .query-content > .el-tag {
margin-bottom: 5px;
margin-top: 5px;
}
/deep/ .query-row-tag {
padding: 10px 0;
}
/deep/ .query-row-content-tag {
display: flex;
flex-wrap: wrap; /* 标签自动换行 */
align-items: center;
gap: 4px 6px; /* 横纵向间距 */
}
`
}
@@ -357,7 +357,7 @@ layout("/layouts/platform.html"){
},
async created() {
this.pageData()
this.personTypeList = await this.$businessTool.getDictOptions('PERSON_TYPE')
this.personTypeList = await this.$businessTool.getDictOptions('USER_PERSON_TYPE')
//在职状态
this.userStateList = await this.$businessTool.getDictOptions('USER_STATE')
//会员类型
@@ -78,7 +78,7 @@ layout("/layouts/platform.html"){
<search-item label="人员类型">
<dict-select v-model="pageForm.personType" style="width: 100%" clearable
placeholder="人员类型" code="PERSON_TYPE"></dict-select>
placeholder="人员类型" code="USER_PERSON_TYPE"></dict-select>
</search-item>
<search-item label="在职状态">
@@ -52,7 +52,7 @@ layout("/layouts/platform.html"){
style="width: 100%;"
v-model="pageForm.personType">
<el-option :label="item.name" :value="item.code"
v-for="item in dict.type.PERSON_TYPE"></el-option>
v-for="item in dict.type.USER_PERSON_TYPE"></el-option>
</el-select>
</search-item>
<search-item label="在职状态">
@@ -102,7 +102,7 @@ layout("/layouts/platform.html"){
el: "#app",
store,
mixins: [initTableMixins],
dicts: ["USER_STATE", "PERSON_TYPE", "USER_EDUCATION"],
dicts: ["USER_STATE", "USER_PERSON_TYPE", "USER_EDUCATION"],
components: {
"form-edit": formEdit
},
@@ -33,7 +33,7 @@ layout("/layouts/platform.html"){
</search-item>
<search-item label="人员类型">
<dict-select v-model="pageForm.personType" placeholder="人员类型" @change="doSearch"
code="PERSON_TYPE"></dict-select>
code="USER_PERSON_TYPE"></dict-select>
</search-item>
<search-item label="变更类型">
<dict-select v-model="pageForm.changeType" placeholder="变更类型" @change="doSearch"
@@ -33,7 +33,7 @@ layout("/layouts/platform.html"){
</search-item>
<search-item label="人员类型">
<dict-select v-model="pageForm.personType" placeholder="人员类型" @change="doSearch"
code="PERSON_TYPE"></dict-select>
code="USER_PERSON_TYPE"></dict-select>
</search-item>
</search>
</el-card>
@@ -55,7 +55,7 @@ layout("/layouts/platform.html"){
<dict-select v-model="pageForm.personType" style="width: 100%"
clearable
placeholder="人员类型"
code="PERSON_TYPE"></dict-select>
code="USER_PERSON_TYPE"></dict-select>
</search-item>
</search>
</el-card>
+34 -4
View File
@@ -15,10 +15,7 @@ import cn.hutool.json.JSONArray;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import com.budwk.app.base.utils.PwdUtil;
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_source;
import com.budwk.app.sys.models.*;
import com.budwk.app.sys.services.SysDictService;
import com.budwk.app.sys.services.SysUnitService;
import com.budwk.app.sys.services.SysUserService;
@@ -38,6 +35,8 @@ import org.nutz.boot.test.junit4.NbJUnit4Runner;
import org.nutz.dao.Chain;
import org.nutz.dao.Cnd;
import org.nutz.dao.Dao;
import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.json.Json;
@@ -221,5 +220,36 @@ public class JugTest {
}
@Test
public void test11111(){
File file = new File("C:\\temp\\response.json");
JSONObject entries = JSONUtil.parseObj(FileUtil.readUtf8String(file));
JSONArray records = entries.getJSONArray("records");
List<JSONObject> list = records.stream().map(item -> (JSONObject) item).toList();
// 工号集合
List<String> loginNameList = list.stream().map(v -> v.getStr("rydm")).toList();
// Sql sql = Sqls.create("update sys_user set member = 1, welfareMember = 1 where loginname in (@loginNameList)")
// .setParam("loginNameList", loginNameList);
// dao.execute(sql);
Sql sql = Sqls.create("select id from sys_user where loginname in (@loginNameList)").setParam("loginNameList", loginNameList);
sql.setCallback(Sqls.callback.strList());
dao.execute(sql);
List<String> userIds = sql.getList(String.class);
List<Sys_user_role> roleList = userIds.stream().map(v -> {
Sys_user_role userRole = new Sys_user_role();
userRole.setUserId(v);
userRole.setRoleId("6d603b652abee584ba6274dc1fcee3bb");
return userRole;
}).toList();
dao.clear(Sys_user_role.class, Cnd.where("userId", "in", userIds));
dao.insert(roleList);
}
}