提交代码
parent
6491e9d05d
commit
bf1d2ce0a7
|
@ -115,7 +115,7 @@ public class ProProjectInfoSubdeptsUsers extends BaseEntity
|
|||
@Excel(name = "学历类型")
|
||||
private String degreeGradeName;
|
||||
|
||||
/** 手机号码 */
|
||||
/** 用户详情 */
|
||||
private String userInfos;
|
||||
|
||||
/** 工种类型 */
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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>
|
|
@ -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>
|
|
@ -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>
|
|
@ -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();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除分包单位工人
|
||||
*/
|
||||
|
|
|
@ -63,6 +63,14 @@ public interface IProProjectInfoSubdeptsUsersService
|
|||
*/
|
||||
public int updateProProjectInfoSubdeptsUsers(ProProjectInfoSubdeptsUsers proProjectInfoSubdeptsUsers);
|
||||
|
||||
/**
|
||||
* 变更手机号码
|
||||
*
|
||||
* @param proProjectInfoSubdeptsUsers 分包单位工人
|
||||
* @return 结果
|
||||
*/
|
||||
public void updateProProjectInfoSubdeptsUsersPhone(ProProjectInfoSubdeptsUsers proProjectInfoSubdeptsUsers);
|
||||
|
||||
/**
|
||||
* 修改分包单位工人
|
||||
*
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -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 分包单位工人
|
||||
|
|
|
@ -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({
|
||||
|
|
|
@ -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 = "修改参建单位";
|
||||
|
|
|
@ -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'){
|
||||
|
|
Loading…
Reference in New Issue