dev_xd
姜玉琦 2025-01-05 14:51:01 +08:00
commit e88f802800
9 changed files with 100 additions and 85 deletions

View File

@ -15,6 +15,7 @@ export default {
this.$bus.$on('projectChange', prj => {
this.selProject = prj;
});
this.$router.push("/detail");
}
}
</script>

View File

@ -148,6 +148,16 @@ public class ProProjectInfoSubdeptsUsers extends BaseEntity
@Excel(name = "进场唯一代码")
private String admitGuid;
private String faceGuid;
public String getFaceGuid() {
return faceGuid;
}
public void setFaceGuid(String faceGuid) {
this.faceGuid = faceGuid;
}
/** 二维码 */
private String qrCode;

View File

@ -40,6 +40,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="useDate" column="use_date" />
<result property="useStatus" column="use_status" />
<result property="admitGuid" column="admit_guid" />
<result property="faceGuid" column="face_guid" />
<result property="qrCode" column="qr_code" />
<result property="subStep" column="sub_step" />
<result property="illnessStatus" column="illness_status" />
@ -56,7 +57,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select psu.id, psu.par_id, psu.com_id, psu.project_id, pi.project_name, psu.sub_dept_id, psu.sub_dept_type, dic3.dict_label as sub_dept_type_name, psu.sub_dept_name, psu.sub_dept_power_path, psu.user_id, psu.user_post, psu.sub_dept_group,
psu.sub_dept_group_name, psu.user_name, psu.card_type, psu.card_code, psu.user_sex, psu.user_picture, psu.user_phone, psu.degree_grade, dic4.dict_label as degree_grade_name, psu.user_infos, psu.craft_type, psu.craft_post, psu.edu_status, psu.edu_file_path, psu.edu_date, psu.approve_status,
psu.use_date, psu.use_status, psu.admit_guid, psu.qr_code, psu.sub_step, psu.illness_status, psu.sup_illness_status, psu.is_del, psu.create_by, psu.create_time, psu.update_by, psu.update_time,
psu.remark
psu.remark,psu.face_guid
from pro_project_info_subdepts_users psu
left join pro_project_info pi on pi.id = psu.project_id
left join sys_dept sd on sd.dept_id = pi.com_id
@ -86,6 +87,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="approveStatus != null "> and psu.approve_status = #{approveStatus}</if>
<if test="useStatus != null and useStatus != ''"> and psu.use_status = #{useStatus}</if>
<if test="admitGuid!=null and admitGuid!=''">and psu.admit_guid = #{admitGuid}</if>
<if test="faceGuid!=null and faceGuid!=''">and psu.face_guid = #{faceGuid}</if>
<if test="subStep != null "> and psu.sub_step = #{subStep}</if>
<if test="illnessStatus != null "> and psu.illness_status = #{illnessStatus}</if>
<if test="supIllnessStatus != null "> and psu.sup_illness_status = #{supIllnessStatus}</if>
@ -137,6 +139,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="useDate != null">use_date,</if>
<if test="useStatus != null">use_status,</if>
<if test="admitGuid != null">admit_guid,</if>
<if test="faceGuid != null">face_guid,</if>
<if test="qrCode != null">qr_code,</if>
<if test="subStep != null">sub_step,</if>
<if test="illnessStatus != null">illness_status,</if>
@ -177,6 +180,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="useDate != null">#{useDate},</if>
<if test="useStatus != null">#{useStatus},</if>
<if test="admitGuid != null">#{admitGuid},</if>
<if test="faceGuid != null">#{faceGuid},</if>
<if test="qrCode != null">#{qrCode},</if>
<if test="subStep != null">#{subStep},</if>
<if test="illnessStatus != null">#{illnessStatus},</if>
@ -221,6 +225,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="useDate != null">use_date = #{useDate},</if>
<if test="useStatus != null">use_status = #{useStatus},</if>
<if test="admitGuid != null">admit_guid = #{admitGuid},</if>
<if test="faceGuid != null">face_guid = #{faceGuid},</if>
<if test="qrCode != null">qr_code = #{qrCode},</if>
<if test="subStep != null">sub_step = #{subStep},</if>
<if test="illnessStatus != null">illness_status = #{illnessStatus},</if>

View File

@ -1,6 +1,7 @@
package com.yanzhu.manage.service;
import com.alibaba.fastjson2.JSONObject;
import com.yanzhu.manage.domain.ProProjectInfoSubdeptsUsers;
import java.security.NoSuchAlgorithmException;
import java.util.Map;
@ -124,10 +125,8 @@ public interface IUniService {
/**
*
* @param userId
* @param projectId
*/
public Long syncUniUser(Long userId, Long projectId);
public Long syncUniUser(ProProjectInfoSubdeptsUsers puser);
/**
*

View File

@ -123,8 +123,6 @@ public class ProProjectInfoSubdeptsGroupServiceImpl implements IProProjectInfoSu
// 已注册账号!!忽略异常...
}
if(Objects.nonNull(userId)){
// 系统添加的人员默认增加入场信息
uniService.syncUniUser(userId,info.getId());
if(res>0){
// 保存单位人员信息
ProProjectInfoSubdeptsUsers subdeptsUser = new ProProjectInfoSubdeptsUsers();
@ -155,6 +153,8 @@ public class ProProjectInfoSubdeptsGroupServiceImpl implements IProProjectInfoSu
subdeptsUser.setApproveStatus(ApproveStatus.passed.getCode());
subdeptsUser.setCreateTime(DateUtils.getNowDate());
res = proProjectInfoSubdeptsUsersMapper.insertProProjectInfoSubdeptsUsers(subdeptsUser);
// 系统添加的人员默认增加入场信息
uniService.syncUniUser(subdeptsUser);
if(res>0){
try {
String accessToken = wxMaService.getAccessToken();
@ -297,13 +297,14 @@ public class ProProjectInfoSubdeptsGroupServiceImpl implements IProProjectInfoSu
FileUtil.copyFile(file,new File(savePath));
subdeptsUser.setQrCode(profilePath);
res = proProjectInfoSubdeptsUsersMapper.updateProProjectInfoSubdeptsUsers(subdeptsUser);
// 系统添加的人员默认增加入场信息
uniService.syncUniUser(subdeptsUser);
}catch (Exception e){
log.error(e.getMessage());
}
}
}
// 系统添加的人员默认增加入场信息
uniService.syncUniUser(userId,proProjectInfoSubdeptsGroup.getProjectId());
return res;
}
}

View File

@ -180,7 +180,7 @@ public class ProProjectInfoSubdeptsServiceImpl implements IProProjectInfoSubdept
subdeptsUser.setCreateTime(DateUtils.getNowDate());
int r = proProjectInfoSubdeptsUsersMapper.insertProProjectInfoSubdeptsUsers(subdeptsUser);
// 系统添加的人员默认增加入场信息
uniService.syncUniUser(subdeptsUser.getUserId(),subdeptsUser.getProjectId());
uniService.syncUniUser(subdeptsUser);
try {
if(r>0){
String accessToken = wxMaService.getAccessToken();

View File

@ -2,6 +2,7 @@ package com.yanzhu.manage.service.impl;
import cn.binarywang.wx.miniapp.api.WxMaService;
import com.yanzhu.common.core.constant.SecurityConstants;
import com.yanzhu.common.core.domain.R;
import com.yanzhu.common.core.enums.*;
import com.yanzhu.common.core.exception.ServiceException;
import com.yanzhu.common.core.text.Convert;
@ -138,12 +139,14 @@ public class ProProjectInfoSubdeptsUsersServiceImpl implements IProProjectInfoSu
sysUser.setPhonenumber(proProjectInfoSubdeptsUsers.getUserPhone());
sysUser.setUpdateBy(SecurityUtils.getUsername());
sysUser.setUpdateTime(DateUtils.getNowDate());
sysUser.setUserType("xx");
sysUser.setActiveProjectId(proProjectInfoSubdeptsUsers.getProjectId());
Long userId= remoteUserService.registerUserInfo(sysUser, SecurityConstants.INNER).getData();
R<Long> obj= remoteUserService.registerUserInfo(sysUser, SecurityConstants.INNER);
Long userId= obj.getData();
proProjectInfoSubdeptsUsers.setUserId(userId);
uniService.syncUniUser(userId,proProjectInfoSubdeptsUsers.getProjectId());
int res = proProjectInfoSubdeptsUsersMapper.insertProProjectInfoSubdeptsUsers(proProjectInfoSubdeptsUsers);
uniService.syncUniUser(proProjectInfoSubdeptsUsers);
if(res>0 && Objects.nonNull(proProjectInfoSubdeptsUsers.getUserPost())){
// 生成二维码
try {
@ -608,7 +611,7 @@ public class ProProjectInfoSubdeptsUsersServiceImpl implements IProProjectInfoSu
proProjectInfoSubdeptsUsers.setApproveStatus(ApproveStatus.exempt.getCode());
proProjectInfoSubdeptsUsersMapper.updateProProjectInfoSubdeptsUsers(proProjectInfoSubdeptsUsers);
//增加入场
uniService.syncUniUser(proProjectInfoSubdeptsUsers.getUserId(),proProjectInfoSubdeptsUsers.getProjectId());
uniService.syncUniUser(proProjectInfoSubdeptsUsers);
}
/**

View File

@ -39,9 +39,6 @@ public class UniServiceImpl implements IUniService{
@Autowired
private AttendanceCfgMapper attendanceCfgMapper;
@Autowired
private RemoteUserService remoteUserService;
@Autowired
private AttendanceUbiDeviceMapper attendanceUbiDeviceMapper;
@ -473,26 +470,27 @@ public class UniServiceImpl implements IUniService{
}
@Override
public Long syncUniUser(Long userId, Long projectId) {
SysUser user=remoteUserService.getSysUserInfo(userId, SecurityConstants.INNER).getData();
JSONObject jo=JSON.parseObject(user.getUserInfos());
String admitGuid=jo.getString("admitGuid");
String faceGuid=jo.getString("faceGuid");
//public Long syncUniUser(Long userId, Long projectId) {
public Long syncUniUser(ProProjectInfoSubdeptsUsers puser) {
//SysUser user=remoteUserService.getSysUserInfo(userId, SecurityConstants.INNER).getData();
JSONObject jo=JSON.parseObject(puser.getUserInfos());
Long projectId=puser.getProjectId();
String admitGuid=puser.getAdmitGuid(); //jo.getString("admitGuid");
String faceGuid=puser.getFaceGuid(); //jo.getString("faceGuid");
JSONObject userJo=new JSONObject();
userJo.put("projectId",projectId);
userJo.put("name",user.getUserName());
userJo.put("phone",user.getPhonenumber());
userJo.put("tag",user.getNickName());
userJo.put("cardNo",user.getUserId()+","+projectId);
userJo.put("idCardNo",user.getCardCode());
userJo.put("name",puser.getUserName());
userJo.put("phone",puser.getUserPhone());
userJo.put("tag",puser.getUserName());
userJo.put("cardNo",puser.getUserId()+"00000"+projectId);
userJo.put("idCardNo",puser.getCardCode());
userJo.put("password","");
userJo.put("addition","");
boolean hasUpdate=false;
if(StringUtils.isEmpty(admitGuid)){
//未注册人员
admitGuid=admitCreate(userJo);
user.setAdmitGuid(admitGuid);
jo.put("admitGuid",admitGuid);
puser.setAdmitGuid(admitGuid);
hasUpdate=true;
}else{
//已注册
@ -502,7 +500,7 @@ public class UniServiceImpl implements IUniService{
userJo.remove("admitGuid");
userJo.put("projectId",projectId);
admitGuid=admitCreate(userJo);
jo.put("admitGuid",admitGuid);
puser.setAdmitGuid(admitGuid);
hasUpdate=true;
}
}
@ -510,7 +508,7 @@ public class UniServiceImpl implements IUniService{
faceJo.put("projectId",projectId);
faceJo.put("base64","");
faceJo.put("admitGuid",admitGuid);
faceJo.put("url",user.getUserPicture());
faceJo.put("url",puser.getUserPicture());
//faceJo.put("url","https://uniubi-aiot.oss-cn-hangzhou.aliyuncs.com/detect/20241007/211204-71D9BCBE526C4F57B8D31ECAE03AEBFB");
faceJo.put("faceTag","");
HttpServletRequest request = ((ServletRequestAttributes)RequestContextHolder.currentRequestAttributes()).getRequest();
@ -526,18 +524,14 @@ public class UniServiceImpl implements IUniService{
//注册图像
JSONObject faceRes = faceRegister(faceJo);
if(faceRes!=null) {
jo.put("faceGuid", faceRes.getString("faceGuid"));
jo.put("uniFaceInfo", faceRes.toJSONString());
hasUpdate=true;
}
user.setUserInfos(jo.toJSONString());
puser.setUserInfos(jo.toJSONString());
if(hasUpdate){
Long ret= remoteUserService.registerUserInfo(user,SecurityConstants.INNER).getData();
if(ret==null){
return 0l;
}
return ret.longValue();
int ret=proProjectInfoSubdeptsUsersMapper.updateProProjectInfoSubdeptsUsers(puser);
return ret*1l;
}
return 0l;
}

View File

@ -4,7 +4,7 @@
<el-form-item label="所属单位" prop="subDeptId">
<el-select v-model="queryParams.subDeptId" placeholder="请选择所属单位" @change="doSubDeptChange('query')" clearable style="width:150px;">
<el-option v-for="(it, idx) in data.subdepts" :key="it.id" :label="it.subDeptName" :value="it.id" />
<el-option v-for="(it) in data.subdepts" :key="it.id" :label="it.subDeptName" :value="it.id" />
</el-select>
</el-form-item>
<el-form-item label="班组" prop="subDeptName">
@ -125,17 +125,8 @@
</template>
<el-form ref="proProjectInfoSubdeptsUsersRef" :model="form" :rules="rules" label-width="120px"
style="position: relative;">
<div style="width: 50%;">
<el-form-item label="联系电话" prop="userPhone">
<el-input v-model="form.userPhone" disabled v-if="data.mode == 'edit'" placeholder="请输入联系电话" minlength="11"
maxlength="11" style="width: 200px;" />
<el-input v-model="form.userPhone" v-else placeholder="请输入联系电话" minlength="11" maxlength="11"
style="width: 200px;" />
<el-button type="primary" v-if="data.mode != 'edit'" style="margin-left:10px;"
@click="queryPhone">查询</el-button>
</el-form-item>
</div>
<el-row v-if="data.phoneState">
<el-row v-if="data.phoneState||true">
<el-col :span="12">
<el-form-item label="所属项目">
<el-tag effect="plain">{{ form.projectName }}</el-tag>
@ -144,7 +135,7 @@
<el-col :span="12">
<el-form-item label="所属单位" prop="subDeptId">
<el-select v-model="form.subDeptId" placeholder="请选择所属单位" @change="doSubDeptChange()">
<el-option v-for="(it, idx) in data.subdepts" :key="it.id" :label="it.subDeptName" :value="it.id" />
<el-option v-for="(it) in data.subdepts" :key="it.id" :label="it.subDeptName" :value="it.id" />
</el-select>
</el-form-item>
</el-col>
@ -162,7 +153,17 @@
<el-input v-model="form.certificateCode" placeholder="请输入证件号码" />
</el-form-item>
</el-col>
<div style="width: 100%;">
<el-form-item label="联系电话" prop="userPhone">
<el-input v-model="form.userPhone" disabled v-if="data.mode == 'edit'" placeholder="请输入联系电话" minlength="11"
maxlength="11" style="width: 200px;" />
<el-input v-model="form.userPhone" v-else placeholder="请输入联系电话" minlength="11" maxlength="11"
style="width: 200px;" />
<el-button type="primary" v-if="data.mode != 'edit' && false" style="margin-left:10px;"
@click="queryPhone">查询</el-button>
<span style="margin-left:10px;color:#999;">此电话号码将用作登录</span>
</el-form-item>
</div>
<el-col :span="12">
<el-form-item label="班组名称" prop="subDeptGroup">
<el-select v-model="form.subDeptGroup" placeholder="请选择班组" @change="doDeptGroupChange">
@ -574,6 +575,7 @@ function handleAdd() {
data.mode = 'add';
form.value.certificateType = "";
form.value.projectId = userStore.currentPrjId;
form.value.comId=userStore.currentComId;
form.value.projectName = userStore.currentProName;
form.value.nation = data.nationOpts[0];
form.value.sex = data.sexOpts[0];
@ -648,50 +650,50 @@ function imgUrl(url){
function submitForm() {
proxy.$refs["proProjectInfoSubdeptsUsersRef"].validate(valid => {
if (valid) {
debugger
let depts = data.subdepts.filter(d => d.id == form.value.subDeptId);
let info=form.value.info;
info.nation=form.value.nation;
info.educationalType=form.value.educationalType;
info.birthDay=form.value.birthDay;
info.nativePlace=form.value.nativePlace;
info.address=form.value.address;
info.emergencyContact=form.value.emergencyContact;
info.emergencyContact= form.value.emergencyContact;
info.contactPhone=form.value.contactPhone;
info.bankName=form.value.bankName;
info.bankCardNo= form.value.bankCardNo;
info.bankOffice= form.value.bankOffice;
form.value.subDeptName = depts.length > 0 ? depts[0].subDeptName : '';
form.value.comId = depts.length > 0 ? depts[0].comId : '';
let groups = data.deptGroups.filter(d => d.id == form.value.subDeptGroup);
form.value.subDeptGroupName = groups.length > 0 ? groups[0].groupName : '';
form.value.userId = data.userInfo ? data.userInfo.userId : '';
form.value.user = {
userId: data.userInfo ? data.userInfo.userId : '',
let info={
nation:form.value.nation,
birthDay:form.value.birthDay,
nativePlace:form.value.nativePlace,
address:form.value.address,
emergencyContact:form.value.emergencyContact,
contactPhone:form.value.contactPhone,
bankName:form.value.bankName,
bankCardNo:form.value.bankCardNo,
bankOffice:form.value.bankOffice,
certificatePhoto1:form.value.certificatePhoto1,
certificatePhoto2:form.value.certificatePhoto2
};
let postData={
comId: form.value.comId,
deptId: form.value.projectId,
nickName: form.value.userName,
userName: form.value.userName,
userType: 99,
cardType: form.value.certificateType,
cardCode: form.value.certificateCode,
userPicture: imgUrl(form.value.faceImage),
cardImgPos: form.value.certificatePhoto1,
cardImgInv: form.value.certificatePhoto2,
userInfos: JSON.stringify(info),
phonenumber: form.value.userPhone,
sex: form.value.sex,
avatar: form.value.faceImage
projectId: form.value.projectId,
subDeptId:form.value.subDeptId,
subDeptName:depts.length > 0 ? depts[0].subDeptName : '',
subDeptGroup:form.value.subDeptGroup,
subDeptGroupName :groups.length > 0 ? groups[0].groupName : '',
userName:form.value.userName,
cardType:form.value.certificateType,
cardCode:form.value.certificateCode,
userSex:form.value.sex,
userPicture:form.value.faceImage,
userPhone:form.value.userPhone,
degreeGrade:form.value.educationalType,
userInfos:JSON.stringify(info),
craftType:form.value.craftType,
craftPost:form.value.craftPost,
};
if (form.value.id != null) {
form.value.user.userId = form.value.userId;
updateProProjectInfoSubdeptsUsers(form.value).then(response => {
postData.id=form.value.id;
updateProProjectInfoSubdeptsUsers(postData).then(response => {
proxy.$modal.msgSuccess("修改成功");
open.value = false;
getList();
});
} else {
addProProjectInfoSubdeptsUsers(form.value).then(response => {
addProProjectInfoSubdeptsUsers(postData).then(response => {
proxy.$modal.msgSuccess("新增成功");
open.value = false;
getList();