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 a188287f..335e7a75 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 @@ -115,7 +115,7 @@ public class ProProjectInfoSubdeptsUsers extends BaseEntity @Excel(name = "学历类型") private String degreeGradeName; - /** 手机号码 */ + /** 用户详情 */ private String userInfos; /** 工种类型 */ diff --git a/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/manage/mapper/ProProjectInfoSubdeptsGroupMapper.java b/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/manage/mapper/ProProjectInfoSubdeptsGroupMapper.java index 3c25f8fc..c20e4db3 100644 --- a/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/manage/mapper/ProProjectInfoSubdeptsGroupMapper.java +++ b/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/manage/mapper/ProProjectInfoSubdeptsGroupMapper.java @@ -2,6 +2,7 @@ package com.yanzhu.manage.mapper; import java.util.List; import com.yanzhu.manage.domain.ProProjectInfoSubdeptsGroup; +import org.apache.ibatis.annotations.Param; /** * 分包单位班组Mapper接口 @@ -64,4 +65,6 @@ public interface ProProjectInfoSubdeptsGroupMapper * @param subDeptId */ public void updateUseStatusByParams(Long subDeptId); + + public int updatePhone(@Param("oldUserPhone")String oldUserPhone, @Param("newUserPhone")String newUserPhone); } diff --git a/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/manage/mapper/ProProjectInfoSubdeptsMapper.java b/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/manage/mapper/ProProjectInfoSubdeptsMapper.java index 36a0ca9a..86698817 100644 --- a/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/manage/mapper/ProProjectInfoSubdeptsMapper.java +++ b/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/manage/mapper/ProProjectInfoSubdeptsMapper.java @@ -2,6 +2,7 @@ package com.yanzhu.manage.mapper; import java.util.List; import com.yanzhu.manage.domain.ProProjectInfoSubdepts; +import org.apache.ibatis.annotations.Param; /** * 分包单位Mapper接口 @@ -58,4 +59,6 @@ public interface ProProjectInfoSubdeptsMapper * @return 结果 */ public int deleteProProjectInfoSubdeptsByIds(Long[] ids); + + public int updatePhone(@Param("oldUserPhone")String oldUserPhone, @Param("newUserPhone")String newUserPhone); } diff --git a/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/manage/mapper/ProProjectInfoSubdeptsUsersMapper.java b/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/manage/mapper/ProProjectInfoSubdeptsUsersMapper.java index 1b08251c..942087fe 100644 --- a/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/manage/mapper/ProProjectInfoSubdeptsUsersMapper.java +++ b/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/manage/mapper/ProProjectInfoSubdeptsUsersMapper.java @@ -114,5 +114,11 @@ public interface ProProjectInfoSubdeptsUsersMapper * @param id 项目人员主键 * @return 结果 */ - int editDefaultProjectById(Long id); + public int editDefaultProjectById(Long id); + + public Map findUserPhone(String userPhone); + + public int updateUserPhone(@Param("oldUserPhone")String oldUserPhone, @Param("newUserPhone")String newUserPhone); + + public int updatePhone(@Param("oldUserPhone")String oldUserPhone, @Param("newUserPhone")String newUserPhone); } diff --git a/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/ProProjectInfoSubdeptsGroupMapper.xml b/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/ProProjectInfoSubdeptsGroupMapper.xml index ac8cd115..1405c15b 100644 --- a/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/ProProjectInfoSubdeptsGroupMapper.xml +++ b/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/ProProjectInfoSubdeptsGroupMapper.xml @@ -162,4 +162,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" update pro_project_info_subdepts_group set use_status = 2 where sub_dept_id = #{subDeptId} + + update pro_project_info_subdepts_group set group_leader_phone = #{newUserPhone} where group_leader_phone = #{oldUserPhone} + + \ No newline at end of file diff --git a/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/ProProjectInfoSubdeptsMapper.xml b/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/ProProjectInfoSubdeptsMapper.xml index 9b32dbd4..47a26dbf 100644 --- a/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/ProProjectInfoSubdeptsMapper.xml +++ b/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/ProProjectInfoSubdeptsMapper.xml @@ -164,4 +164,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{id} + + + update pro_project_info_subdepts set sub_dept_leader_phone = #{newUserPhone} where sub_dept_leader_phone = #{oldUserPhone} + + \ No newline at end of file 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 63934c95..faae1302 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 @@ -350,4 +350,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" update pro_project_info_subdepts_users set sort_by = project_id where user_id = #{userId} + + + + update sys_user set user_name = #{newUserPhone}, phonenumber = #{newUserPhone} where phonenumber = #{oldUserPhone} + + + + update pro_project_info_subdepts_users set user_phone = #{newUserPhone} where user_phone = #{oldUserPhone} + + \ No newline at end of file diff --git a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/controller/ProProjectInfoSubdeptsUsersController.java b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/controller/ProProjectInfoSubdeptsUsersController.java index 0db4bd64..aecb73eb 100644 --- a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/controller/ProProjectInfoSubdeptsUsersController.java +++ b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/controller/ProProjectInfoSubdeptsUsersController.java @@ -21,7 +21,6 @@ import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletResponse; import java.util.List; -import java.util.Map; import java.util.Objects; /** @@ -126,6 +125,18 @@ public class ProProjectInfoSubdeptsUsersController extends BaseController return toAjax(proProjectInfoSubdeptsUsersService.updateProProjectInfoSubdeptsUsers(proProjectInfoSubdeptsUsers)); } + /** + * 变更手机号码 + */ + @RequiresPermissions("manage:proProjectInfoSubdeptsUsers:editPhone") + @Log(title = "变更手机号", businessType = BusinessType.UPDATE) + @PostMapping("/editPhone") + public AjaxResult editPhone(@RequestBody ProProjectInfoSubdeptsUsers proProjectInfoSubdeptsUsers) + { + proProjectInfoSubdeptsUsersService.updateProProjectInfoSubdeptsUsersPhone(proProjectInfoSubdeptsUsers); + return success(); + } + /** * 删除分包单位工人 */ diff --git a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/IProProjectInfoSubdeptsUsersService.java b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/IProProjectInfoSubdeptsUsersService.java index 2a5baeed..8ec4f94c 100644 --- a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/IProProjectInfoSubdeptsUsersService.java +++ b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/IProProjectInfoSubdeptsUsersService.java @@ -63,6 +63,14 @@ public interface IProProjectInfoSubdeptsUsersService */ public int updateProProjectInfoSubdeptsUsers(ProProjectInfoSubdeptsUsers proProjectInfoSubdeptsUsers); + /** + * 变更手机号码 + * + * @param proProjectInfoSubdeptsUsers 分包单位工人 + * @return 结果 + */ + public void updateProProjectInfoSubdeptsUsersPhone(ProProjectInfoSubdeptsUsers proProjectInfoSubdeptsUsers); + /** * 修改分包单位工人 * 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 5023e0b8..fbea0112 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 @@ -75,7 +75,14 @@ public class ProProjectInfoSubdeptsServiceImpl implements IProProjectInfoSubdept @Override public ProProjectInfoSubdepts selectProProjectInfoSubdeptsById(Long id) { - return proProjectInfoSubdeptsMapper.selectProProjectInfoSubdeptsById(id); + ProProjectInfoSubdepts proProjectInfoSubdepts = proProjectInfoSubdeptsMapper.selectProProjectInfoSubdeptsById(id); + if(Objects.equals(proProjectInfoSubdepts.getSubDeptType(),SubDeptsEnums.ZYFB.getCode()) || Objects.equals(proProjectInfoSubdepts.getSubDeptType(),SubDeptsEnums.LWFB.getCode())){ + ProProjectInfoSubdeptsUsers leaderUser = proProjectInfoSubdeptsUsersMapper.selectProProjectInfoSubdeptsUsersByParamId(proProjectInfoSubdepts.getProjectId(),proProjectInfoSubdepts.getSubDeptLeaderId()); + if(Objects.nonNull(leaderUser)){ + proProjectInfoSubdepts.setProProjectInfoSubdeptsUsers(leaderUser); + } + } + return proProjectInfoSubdepts; } /** 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 b8f1e481..3cfd31c0 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 @@ -598,6 +598,26 @@ public class ProProjectInfoSubdeptsUsersServiceImpl implements IProProjectInfoSu } /** + * 变更手机号码 + * + * @param proProjectInfoSubdeptsUsers 分包单位工人 + * @return 结果 + */ + @Override + @Transactional + public void updateProProjectInfoSubdeptsUsersPhone(ProProjectInfoSubdeptsUsers proProjectInfoSubdeptsUsers){ + Map map = proProjectInfoSubdeptsUsersMapper.findUserPhone(proProjectInfoSubdeptsUsers.getUserPhone()); + if(Objects.nonNull(map) && Convert.toInt(map.get("total"),0)>0){ + throw new ServiceException("手机号码已被注册"); + } + ProProjectInfoSubdeptsUsers entity = proProjectInfoSubdeptsUsersMapper.selectProProjectInfoSubdeptsUsersById(proProjectInfoSubdeptsUsers.getId()); + proProjectInfoSubdeptsMapper.updatePhone(entity.getUserPhone(),proProjectInfoSubdeptsUsers.getUserPhone()); + proProjectInfoSubdeptsGroupMapper.updatePhone(entity.getUserPhone(),proProjectInfoSubdeptsUsers.getUserPhone()); + proProjectInfoSubdeptsUsersMapper.updatePhone(entity.getUserPhone(),proProjectInfoSubdeptsUsers.getUserPhone()); + proProjectInfoSubdeptsUsersMapper.(entity.getUserPhone(),proProjectInfoSubdeptsUsers.getUserPhone()); + } + + /**updateUserPhone * 修改分包单位工人 * * @param proProjectInfoSubdeptsUsers 分包单位工人 diff --git a/yanzhu-ui-vue3/src/api/manage/proProjectInfoSubdeptsUsers.js b/yanzhu-ui-vue3/src/api/manage/proProjectInfoSubdeptsUsers.js index 352e8801..5290c7f5 100644 --- a/yanzhu-ui-vue3/src/api/manage/proProjectInfoSubdeptsUsers.js +++ b/yanzhu-ui-vue3/src/api/manage/proProjectInfoSubdeptsUsers.js @@ -44,6 +44,15 @@ export function updateProProjectInfoSubdeptsUsers(data) { }) } +// 修改手机号码 +export function editPhone(data) { + return request({ + url: '/manage/proProjectInfoSubdeptsUsers/editPhone', + method: 'post', + data: data + }) +} + // 删除分包单位工人 export function delProProjectInfoSubdeptsUsers(id) { return request({ diff --git a/yanzhu-ui-vue3/src/views/manage/proProjectInfoSubdepts/index.vue b/yanzhu-ui-vue3/src/views/manage/proProjectInfoSubdepts/index.vue index e383ee59..2a5920ba 100644 --- a/yanzhu-ui-vue3/src/views/manage/proProjectInfoSubdepts/index.vue +++ b/yanzhu-ui-vue3/src/views/manage/proProjectInfoSubdepts/index.vue @@ -196,12 +196,12 @@ - + - + @@ -312,7 +312,8 @@ function reset() { updateBy: null, updateTime: null, remark: null, - subDeptInfos: {} + subDeptInfos: {}, + leaderUserInfos:{} }; proxy.resetForm("proProjectInfoSubdeptsRef"); } @@ -356,6 +357,13 @@ function handleUpdate(row) { const _id = row.id || ids.value getProProjectInfoSubdepts(_id).then(response => { response.data.subDeptInfos = JSON.parse(response.data.subDeptInfos); + if(response.data.proProjectInfoSubdeptsUsers){ + response.data.leaderUserPicture = response.data.proProjectInfoSubdeptsUsers.userPicture; + response.data.subDeptLeaderPowerPath = response.data.proProjectInfoSubdeptsUsers.subDeptPowerPath; + if(response.data.proProjectInfoSubdeptsUsers.userInfos){ + response.data.leaderUserInfos = JSON.parse(response.data.proProjectInfoSubdeptsUsers.userInfos); + } + } form.value = response.data; open.value = true; title.value = "修改参建单位"; diff --git a/yanzhu-ui-vue3/src/views/manage/proProjectInfoSubdeptsUsers/index.vue b/yanzhu-ui-vue3/src/views/manage/proProjectInfoSubdeptsUsers/index.vue index a312555e..01a787ed 100644 --- a/yanzhu-ui-vue3/src/views/manage/proProjectInfoSubdeptsUsers/index.vue +++ b/yanzhu-ui-vue3/src/views/manage/proProjectInfoSubdeptsUsers/index.vue @@ -109,6 +109,7 @@ @@ -158,6 +159,7 @@ v-hasPermi="['manage:proProjectInfoSubdeptsUsers:edit']">重新生成文件 文件重新签名 + 手机号变更 @@ -327,7 +329,7 @@