提交代码

dev_xd
姜玉琦 2025-03-02 11:34:29 +08:00
parent 6491e9d05d
commit bf1d2ce0a7
14 changed files with 126 additions and 8 deletions

View File

@ -115,7 +115,7 @@ public class ProProjectInfoSubdeptsUsers extends BaseEntity
@Excel(name = "学历类型")
private String degreeGradeName;
/** 手机号码 */
/** 用户详情 */
private String userInfos;
/** 工种类型 */

View File

@ -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);
}

View File

@ -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);
}

View File

@ -114,5 +114,11 @@ public interface ProProjectInfoSubdeptsUsersMapper
* @param id
* @return
*/
int editDefaultProjectById(Long id);
public int editDefaultProjectById(Long id);
public Map<String, Object> 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);
}

View File

@ -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>
<update id="updatePhone">
update pro_project_info_subdepts_group set group_leader_phone = #{newUserPhone} where group_leader_phone = #{oldUserPhone}
</update>
</mapper>

View File

@ -164,4 +164,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{id}
</foreach>
</update>
<update id="updatePhone">
update pro_project_info_subdepts set sub_dept_leader_phone = #{newUserPhone} where sub_dept_leader_phone = #{oldUserPhone}
</update>
</mapper>

View File

@ -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>
<select id="findUserPhone" resultType="Map">
select count(1) as total from sys_user su where (user_name = #{userPhone} or phonenumber = #{userPhone})
</select>
<update id="updateUserPhone">
update sys_user set user_name = #{newUserPhone}, phonenumber = #{newUserPhone} where phonenumber = #{oldUserPhone}
</update>
<update id="updatePhone">
update pro_project_info_subdepts_users set user_phone = #{newUserPhone} where user_phone = #{oldUserPhone}
</update>
</mapper>

View File

@ -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();
}
/**
*
*/

View File

@ -63,6 +63,14 @@ public interface IProProjectInfoSubdeptsUsersService
*/
public int updateProProjectInfoSubdeptsUsers(ProProjectInfoSubdeptsUsers proProjectInfoSubdeptsUsers);
/**
*
*
* @param proProjectInfoSubdeptsUsers
* @return
*/
public void updateProProjectInfoSubdeptsUsersPhone(ProProjectInfoSubdeptsUsers proProjectInfoSubdeptsUsers);
/**
*
*

View File

@ -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;
}
/**

View File

@ -598,6 +598,26 @@ public class ProProjectInfoSubdeptsUsersServiceImpl implements IProProjectInfoSu
}
/**
*
*
* @param proProjectInfoSubdeptsUsers
* @return
*/
@Override
@Transactional
public void updateProProjectInfoSubdeptsUsersPhone(ProProjectInfoSubdeptsUsers proProjectInfoSubdeptsUsers){
Map<String, Object> 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

View File

@ -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({

View File

@ -196,12 +196,12 @@
<el-row>
<el-col :span="12">
<el-form-item label="身份证正面">
<image-upload v-model="form.leaderCardImgPos" :limit="1" />
<image-upload v-model="form.leaderUserInfos.cardImgPos" :limit="1" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="身份证反面">
<image-upload v-model="form.leaderCardImgInv" :limit="1" />
<image-upload v-model="form.leaderUserInfos.cardImgInv" :limit="1" />
</el-form-item>
</el-col>
</el-row>
@ -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 = "修改参建单位";

View File

@ -109,6 +109,7 @@
</el-table-column>
<el-table-column label="工种岗位" align="center" prop="craftPost">
<template #default="scope">
<div><el-button v-if="scope.row.userPost=='3'" link type="warning" disabled> 班组长 </el-button></div>
<dict-tag :options="pro_craft_post" :value="scope.row.craftPost" />
</template>
</el-table-column>
@ -158,6 +159,7 @@
v-hasPermi="['manage:proProjectInfoSubdeptsUsers:edit']">重新生成文件</el-button>
<el-button v-if="isSign(scope.row)" link type="primary" icon="StarFilled" @click="handleFileSign(scope.row)"
v-hasPermi="['manage:proProjectInfoSubdeptsUsers:edit']">文件重新签名</el-button>
<el-button link type="primary" icon="WarnTriangleFilled" @click="handleUpdatePhone(scope.row)" v-hasPermi="['manage:proProjectInfoSubdeptsUsers:editPhone']"></el-button>
</template>
</el-table-column>
</el-table>
@ -327,7 +329,7 @@
</template>
<script setup name="ProProjectInfoSubdeptsUsers">
import { listProProjectInfoSubdeptsUsers, getProProjectInfoSubdeptsUsers, updateEnterState, delProProjectInfoSubdeptsUsers, addProProjectInfoSubdeptsUsers, updateProProjectInfoSubdeptsUsers, fileSign } from "@/api/manage/proProjectInfoSubdeptsUsers";
import { listProProjectInfoSubdeptsUsers, getProProjectInfoSubdeptsUsers, updateEnterState, delProProjectInfoSubdeptsUsers, addProProjectInfoSubdeptsUsers, updateProProjectInfoSubdeptsUsers, editPhone, fileSign } from "@/api/manage/proProjectInfoSubdeptsUsers";
import { listProProjectInfoSubdepts } from "@/api/manage/proProjectInfoSubdepts";
import { listProProjectInfoSubdeptsGroup } from "@/api/manage/proProjectInfoSubdeptsGroup";
import { listUser } from "@/api/system/user";
@ -786,6 +788,26 @@ function handleUpdate(row) {
});
}
/** 修改手机号码 */
function handleUpdatePhone(row) {
proxy.$prompt('请输入"' + row.userName + '"的新手机号码', "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
closeOnClickModal: false,
inputPattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
inputErrorMessage: "请输入正确的手机号码",
}).then(({ value }) => {
let datas = {
id:row.id,
userPhone:value
}
editPhone(datas).then(response => {
proxy.$modal.msgSuccess("变更手机号成功");
getList();
});
}).catch(() => { });
}
function isSign(row){
if(row.approveStatus==100){
if(row.userPost=='1' || row.userPost=='2' || row.userPost=='3' || row.userPost=='6' || row.userPost=='8'){