From 9988754739e3155363db429867c837c79a9b4698 Mon Sep 17 00:00:00 2001 From: haha Date: Sun, 5 Jan 2025 01:03:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=8A=B1=E5=90=8D=E5=86=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- yanzhu-bigscreen/src/views/index.vue | 1 + .../domain/ProProjectInfoSubdeptsUsers.java | 10 ++ .../ProProjectInfoSubdeptsUsersMapper.xml | 7 +- .../yanzhu/manage/service/IUniService.java | 5 +- ...roProjectInfoSubdeptsGroupServiceImpl.java | 9 +- .../ProProjectInfoSubdeptsServiceImpl.java | 2 +- ...roProjectInfoSubdeptsUsersServiceImpl.java | 9 +- .../manage/service/impl/UniServiceImpl.java | 42 ++++---- .../proProjectInfoSubdeptsUsers/index.vue | 100 +++++++++--------- 9 files changed, 100 insertions(+), 85 deletions(-) diff --git a/yanzhu-bigscreen/src/views/index.vue b/yanzhu-bigscreen/src/views/index.vue index f1b914be..9d663095 100644 --- a/yanzhu-bigscreen/src/views/index.vue +++ b/yanzhu-bigscreen/src/views/index.vue @@ -15,6 +15,7 @@ export default { this.$bus.$on('projectChange', prj => { this.selProject = prj; }); + this.$router.push("/detail"); } } diff --git a/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/manage/domain/ProProjectInfoSubdeptsUsers.java b/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/manage/domain/ProProjectInfoSubdeptsUsers.java index 965d57ce..e4760aaf 100644 --- a/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/manage/domain/ProProjectInfoSubdeptsUsers.java +++ b/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/manage/domain/ProProjectInfoSubdeptsUsers.java @@ -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; diff --git a/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/ProProjectInfoSubdeptsUsersMapper.xml b/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/ProProjectInfoSubdeptsUsersMapper.xml index 00a9f552..524911a7 100644 --- a/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/ProProjectInfoSubdeptsUsersMapper.xml +++ b/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/ProProjectInfoSubdeptsUsersMapper.xml @@ -40,6 +40,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + @@ -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 @@ -87,6 +88,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and psu.approve_status = #{approveStatus} and psu.use_status = #{useStatus} and psu.admit_guid = #{admitGuid} + and psu.face_guid = #{faceGuid} and psu.sub_step = #{subStep} and psu.illness_status = #{illnessStatus} and psu.sup_illness_status = #{supIllnessStatus} @@ -137,6 +139,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" use_date, use_status, admit_guid, + face_guid, qr_code, sub_step, illness_status, @@ -177,6 +180,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{useDate}, #{useStatus}, #{admitGuid}, + #{faceGuid}, #{qrCode}, #{subStep}, #{illnessStatus}, @@ -221,6 +225,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" use_date = #{useDate}, use_status = #{useStatus}, admit_guid = #{admitGuid}, + face_guid = #{faceGuid}, qr_code = #{qrCode}, sub_step = #{subStep}, illness_status = #{illnessStatus}, diff --git a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/IUniService.java b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/IUniService.java index da0199d5..dab50c4d 100644 --- a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/IUniService.java +++ b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/IUniService.java @@ -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); /** * 同步宇泛的设备信息 diff --git a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/impl/ProProjectInfoSubdeptsGroupServiceImpl.java b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/impl/ProProjectInfoSubdeptsGroupServiceImpl.java index ee2b56d5..d1ce1c56 100644 --- a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/impl/ProProjectInfoSubdeptsGroupServiceImpl.java +++ b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/impl/ProProjectInfoSubdeptsGroupServiceImpl.java @@ -126,8 +126,6 @@ public class ProProjectInfoSubdeptsGroupServiceImpl implements IProProjectInfoSu // 已注册账号!!忽略异常... } if(Objects.nonNull(userId)){ - // 系统添加的人员默认增加入场信息 - uniService.syncUniUser(userId,info.getId()); if(res>0){ // 保存单位人员信息 ProProjectInfoSubdeptsUsers subdeptsUser = new ProProjectInfoSubdeptsUsers(); @@ -158,6 +156,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(); @@ -300,13 +300,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; } } diff --git a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/impl/ProProjectInfoSubdeptsServiceImpl.java b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/impl/ProProjectInfoSubdeptsServiceImpl.java index 654661ca..074277da 100644 --- a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/impl/ProProjectInfoSubdeptsServiceImpl.java +++ b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/impl/ProProjectInfoSubdeptsServiceImpl.java @@ -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(); diff --git a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/impl/ProProjectInfoSubdeptsUsersServiceImpl.java b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/impl/ProProjectInfoSubdeptsUsersServiceImpl.java index 6e49709e..925c39ed 100644 --- a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/impl/ProProjectInfoSubdeptsUsersServiceImpl.java +++ b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/impl/ProProjectInfoSubdeptsUsersServiceImpl.java @@ -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; @@ -126,12 +127,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 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 { @@ -596,7 +599,7 @@ public class ProProjectInfoSubdeptsUsersServiceImpl implements IProProjectInfoSu proProjectInfoSubdeptsUsers.setApproveStatus(ApproveStatus.exempt.getCode()); proProjectInfoSubdeptsUsersMapper.updateProProjectInfoSubdeptsUsers(proProjectInfoSubdeptsUsers); //增加入场 - uniService.syncUniUser(proProjectInfoSubdeptsUsers.getUserId(),proProjectInfoSubdeptsUsers.getProjectId()); + uniService.syncUniUser(proProjectInfoSubdeptsUsers); } /** diff --git a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/impl/UniServiceImpl.java b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/impl/UniServiceImpl.java index 294469ed..7a2a72a5 100644 --- a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/impl/UniServiceImpl.java +++ b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/impl/UniServiceImpl.java @@ -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; } diff --git a/yanzhu-ui-vue3/src/views/manage/proProjectInfoSubdeptsUsers/index.vue b/yanzhu-ui-vue3/src/views/manage/proProjectInfoSubdeptsUsers/index.vue index 169b2c28..b44fecb7 100644 --- a/yanzhu-ui-vue3/src/views/manage/proProjectInfoSubdeptsUsers/index.vue +++ b/yanzhu-ui-vue3/src/views/manage/proProjectInfoSubdeptsUsers/index.vue @@ -4,7 +4,7 @@ - + @@ -125,17 +125,8 @@ -
- - - - 查询 - -
- + + {{ form.projectName }} @@ -144,7 +135,7 @@ - + @@ -162,7 +153,17 @@ - +
+ + + + 查询 + 此电话号码将用作登录 + +
@@ -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();