提交代码
parent
d7a12c5a2a
commit
6cdfdf8da9
|
@ -30,16 +30,6 @@ public interface RemoteProService
|
|||
@GetMapping(value = "/proProjectInfo/info/{id}")
|
||||
public R<Map<String,Object>> info(@PathVariable("id") Long id, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
|
||||
|
||||
/**
|
||||
* 获取当前用户入场项目信息
|
||||
*
|
||||
* @param userId 用户主键
|
||||
* @param source 请求来源
|
||||
* @return 结果
|
||||
*/
|
||||
@GetMapping("/proProjectInfoUsers/projects/{userId}")
|
||||
public R<List<Map<String, Object>>> getProjects(@PathVariable("userId") Long userId, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
|
||||
|
||||
/**
|
||||
* 分包人员审批通过信息同步
|
||||
*
|
||||
|
|
|
@ -4,11 +4,10 @@ import com.yanzhu.common.core.constant.SecurityConstants;
|
|||
import com.yanzhu.common.core.constant.ServiceNameConstants;
|
||||
import com.yanzhu.common.core.domain.R;
|
||||
import com.yanzhu.system.api.domain.SysRole;
|
||||
import com.yanzhu.system.api.domain.SysUser;
|
||||
import com.yanzhu.system.api.factory.RemoteUserFallbackFactory;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestHeader;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* 用户服务
|
||||
|
|
|
@ -110,6 +110,22 @@ public interface RemoteUserService
|
|||
@PostMapping("/user/register")
|
||||
public R<Long> registerUserInfo(@RequestBody SysUser sysUser, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
|
||||
|
||||
/**
|
||||
* 删除用户角色
|
||||
*
|
||||
* @param sysUser 用户信息
|
||||
* @param source 请求来源
|
||||
* @return 结果
|
||||
*/
|
||||
@PostMapping("/user/removeUserRoles")
|
||||
public R<Long> removeUserRoles(@RequestBody SysUser sysUser, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
|
||||
|
||||
/**
|
||||
* 修改用户信息
|
||||
* @param sysUser
|
||||
* @param source
|
||||
* @return
|
||||
*/
|
||||
@PutMapping("/user")
|
||||
public R<Long> updateUserInfo(@RequestBody SysUser sysUser, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
|
||||
}
|
||||
|
|
|
@ -33,12 +33,6 @@ public class RemoteProFallbackFactory implements FallbackFactory<RemoteProServic
|
|||
return R.fail("查询项目失败:" + throwable.getMessage());
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<List<Map<String, Object>>> getProjects(Long userId, String source)
|
||||
{
|
||||
return R.fail("获取用户项目信息失败:" + throwable.getMessage());
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<AjaxResult> approveSubDeptsUser(Long busKey, String source)
|
||||
{
|
||||
|
|
|
@ -84,6 +84,12 @@ public class RemoteUserFallbackFactory implements FallbackFactory<RemoteUserServ
|
|||
return R.fail("注册用户失败:" + throwable.getMessage());
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<Long> removeUserRoles(SysUser sysUser, String source)
|
||||
{
|
||||
return R.fail("删除用户角色失败:" + throwable.getMessage());
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<Long> updateUserInfo(SysUser sysUser, String source) {
|
||||
return R.fail("修改用户失败:" + throwable.getMessage());
|
||||
|
|
|
@ -172,6 +172,9 @@ public class ProProjectInfoSubdeptsUsers extends BaseEntity
|
|||
/** 进行步骤 */
|
||||
private Long subStep;
|
||||
|
||||
/** 排序规则 */
|
||||
private Long sortBy;
|
||||
|
||||
/** 删除标识 */
|
||||
@Excel(name = "数据状态")
|
||||
private Long isDel;
|
||||
|
@ -512,6 +515,14 @@ public class ProProjectInfoSubdeptsUsers extends BaseEntity
|
|||
this.userNation = userNation;
|
||||
}
|
||||
|
||||
public Long getSortBy() {
|
||||
return sortBy;
|
||||
}
|
||||
|
||||
public void setSortBy(Long sortBy) {
|
||||
this.sortBy = sortBy;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ProProjectInfoSubdeptsUsers{" +
|
||||
|
|
|
@ -107,4 +107,12 @@ public interface ProProjectInfoSubdeptsUsersMapper
|
|||
* @param subDeptGroupId 班组主键
|
||||
*/
|
||||
public void updateUseStatusByParams(@Param("subDeptId")Long subDeptId, @Param("subDeptGroupId")Long subDeptGroupId);
|
||||
|
||||
/**
|
||||
* 修改项目人员的默认项目
|
||||
*
|
||||
* @param id 项目人员主键
|
||||
* @return 结果
|
||||
*/
|
||||
int editDefaultProjectById(Long id);
|
||||
}
|
||||
|
|
|
@ -88,13 +88,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
|
||||
<select id="selectProProjectInfoList" parameterType="ProProjectInfo" resultMap="ProProjectInfoResult">
|
||||
<include refid="selectProProjectInfoVo"/>
|
||||
<if test="currentUserId != null "> left join pro_project_info_users pu on pu.project_id = pi.id </if>
|
||||
<if test="currentUserId != null "> left join pro_project_info_subdepts_users psu on psu.project_id = pi.id </if>
|
||||
<where>
|
||||
<if test="comId != null "> and pi.com_id = #{comId}</if>
|
||||
<if test="disDeptId != null "> and pi.dis_dept_id = #{disDeptId}</if>
|
||||
<if test="activeComId != null "> and pi.com_id = #{activeComId}</if>
|
||||
<if test="currentUserId != null"> and ((pu.user_id = #{currentUserId} and pu.use_status='1' and pu.is_del=0) or (psu.user_id = #{currentUserId} and approve_status <![CDATA[ >= ]]> 100 and psu.user_id = #{currentUserId} and psu.use_status='1' and psu.is_del=0))</if>
|
||||
<if test="currentUserId != null"> and psu.user_id = #{currentUserId} and psu.approve_status <![CDATA[ >= ]]> 100 and psu.user_id = #{currentUserId} and psu.use_status='0' and psu.is_del=0</if>
|
||||
<if test="projectName != null and projectName != ''"> and pi.project_name like concat('%', #{projectName}, '%')</if>
|
||||
<if test="projectCode != null and projectCode != ''"> and pi.project_code = #{projectCode}</if>
|
||||
<if test="simpleName != null and simpleName != ''"> and pi.simple_name like concat('%', #{simpleName}, '%')</if>
|
||||
|
@ -357,13 +356,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
from pro_project_info pi
|
||||
left join pro_project_info_setting ps on pi.id=ps.project_id
|
||||
left join sys_dict_data sdd1 on sdd1.dict_value = pi.project_type and sdd1.dict_type='pro_project_type'
|
||||
<if test="currentUserId != null "> left join pro_project_info_users pu on pu.project_id = pi.id </if>
|
||||
<if test="currentUserId != null "> left join pro_project_info_subdepts_users psu on psu.project_id = pi.id </if>
|
||||
<where>
|
||||
<if test="comId != null "> and pi.com_id = #{comId}</if>
|
||||
<if test="disDeptId != null "> and pi.dis_dept_id = #{disDeptId}</if>
|
||||
<if test="activeComId != null "> and pi.com_id = #{activeComId}</if>
|
||||
<if test="currentUserId != null"> and ((pu.user_id = #{currentUserId} and pu.use_status='1' and pu.is_del=0) or (psu.user_id = #{currentUserId} and approve_status <![CDATA[ >= ]]> 100 and psu.user_id = #{currentUserId} and psu.use_status='1' and psu.is_del=0))</if>
|
||||
<if test="currentUserId != null"> and psu.user_id = #{currentUserId} and psu.approve_status <![CDATA[ >= ]]> 100 and psu.user_id = #{currentUserId} and psu.use_status='0' and psu.is_del=0</if>
|
||||
<if test="projectName != null and projectName != ''"> and pi.project_name like concat('%', #{projectName}, '%')</if>
|
||||
<if test="projectCode != null and projectCode != ''"> and pi.project_code = #{projectCode}</if>
|
||||
<if test="simpleName != null and simpleName != ''"> and pi.simple_name like concat('%', #{simpleName}, '%')</if>
|
||||
|
|
|
@ -92,6 +92,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="illnessStatus != null "> and psu.illness_status = #{illnessStatus}</if>
|
||||
<if test="supIllnessStatus != null "> and psu.sup_illness_status = #{supIllnessStatus}</if>
|
||||
<if test="userPhone != null and userPhone != ''"> and psu.user_phone = #{userPhone}</if>
|
||||
<if test='activeTags == "finished"'> and psu.approve_status <![CDATA[ >= ]]> 100 </if>
|
||||
<if test="isDel != null "> and psu.is_del = #{isDel}</if>
|
||||
and psu.is_del != 2
|
||||
</where>
|
||||
|
@ -230,6 +231,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="subStep != null">sub_step = #{subStep},</if>
|
||||
<if test="illnessStatus != null">illness_status = #{illnessStatus},</if>
|
||||
<if test="supIllnessStatus != null">sup_illness_status = #{supIllnessStatus},</if>
|
||||
<if test="sortBy != null">sort_by = #{sortBy},</if>
|
||||
<if test="isDel != null">is_del = #{isDel},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
|
@ -331,10 +333,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</select>
|
||||
|
||||
<update id="updateUseStatusByParams">
|
||||
update pro_project_info_subdepts_group set use_status = 2
|
||||
update pro_project_info_subdepts_users set use_status = 2
|
||||
where 1=1
|
||||
<if test="subDeptId != null "> and sub_dept_id = #{subDeptId}</if>
|
||||
<if test="subDeptGroupId != null "> and u.sub_dept_group = #{subDeptGroupId}</if>
|
||||
<if test="subDeptGroupId != null "> and sub_dept_group = #{subDeptGroupId}</if>
|
||||
</update>
|
||||
|
||||
<update id="editDefaultProjectById">
|
||||
update pro_project_info_subdepts_group set sort_by = project_id where user_id = #{userId}
|
||||
</update>
|
||||
|
||||
</mapper>
|
|
@ -299,10 +299,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
|
||||
<!--根据用户编号查询入场项目信息-->
|
||||
<select id="selectProjectsByUserId" parameterType="Long" resultType="Map">
|
||||
select pi.com_id, sd.dept_name as com_name, pu.project_id, pi.project_name from pro_project_info_users pu
|
||||
select pi.com_id, sd.dept_name as com_name, pu.project_id, pi.project_name from pro_project_info_subdepts_users pu
|
||||
left join pro_project_info pi on pi.id = pu.project_id
|
||||
left join sys_dept sd on sd.dept_id = pi.com_id
|
||||
where pu.user_id=#{userId} and pu.is_del=0 and pu.use_status=1 order by pu.sort_by asc
|
||||
where pu.user_id=#{userId} and pu.approve_status <![CDATA[ >= ]]> 100 and pu.is_del=0 and pu.use_status=0 order by pu.sort_by asc
|
||||
</select>
|
||||
|
||||
</mapper>
|
|
@ -1,5 +1,6 @@
|
|||
package com.yanzhu.manage.controller;
|
||||
|
||||
import com.yanzhu.common.core.text.Convert;
|
||||
import com.yanzhu.common.core.utils.poi.ExcelUtil;
|
||||
import com.yanzhu.common.core.web.controller.BaseController;
|
||||
import com.yanzhu.common.core.web.domain.AjaxResult;
|
||||
|
@ -8,12 +9,14 @@ import com.yanzhu.common.log.annotation.Log;
|
|||
import com.yanzhu.common.log.enums.BusinessType;
|
||||
import com.yanzhu.common.security.annotation.RequiresPermissions;
|
||||
import com.yanzhu.manage.domain.ProProjectInfoSubdeptsGroup;
|
||||
import com.yanzhu.manage.domain.ProProjectInfoSubdeptsUsers;
|
||||
import com.yanzhu.manage.service.IProProjectInfoSubdeptsGroupService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 单位班组Controller
|
||||
|
@ -85,6 +88,17 @@ public class ProProjectInfoSubdeptsGroupController extends BaseController
|
|||
return toAjax(proProjectInfoSubdeptsGroupService.updateProProjectInfoSubdeptsGroup(proProjectInfoSubdeptsGroup));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改班组组长
|
||||
* @param proProjectInfoSubdeptsGroup 班组信息
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("manage:proProjectInfoSubdeptsGroup:edit")
|
||||
@PostMapping("/updateGroupLeader")
|
||||
public AjaxResult updateGroupLeader(@RequestBody ProProjectInfoSubdeptsGroup proProjectInfoSubdeptsGroup){
|
||||
return toAjax(proProjectInfoSubdeptsGroupService.updateGroupLeader(proProjectInfoSubdeptsGroup));
|
||||
}
|
||||
|
||||
/**
|
||||
* 单位班组入场/离场
|
||||
*/
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package com.yanzhu.manage.controller;
|
||||
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.yanzhu.common.core.domain.R;
|
||||
import com.yanzhu.common.core.text.Convert;
|
||||
import com.yanzhu.common.core.utils.DateUtils;
|
||||
import com.yanzhu.common.core.utils.poi.ExcelUtil;
|
||||
|
@ -20,6 +21,7 @@ import org.springframework.web.bind.annotation.*;
|
|||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
|
@ -151,7 +153,7 @@ public class ProProjectInfoSubdeptsUsersController extends BaseController
|
|||
* @param state
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("manage:proProjectInfoSubdeptsUsers:remove")
|
||||
@RequiresPermissions("manage:proProjectInfoSubdeptsUsers:edit")
|
||||
@PostMapping("/enterState/{state}")
|
||||
public AjaxResult updateEnterState(@RequestBody List<Long> ids,@PathVariable int state){
|
||||
try {
|
||||
|
@ -197,4 +199,14 @@ public class ProProjectInfoSubdeptsUsersController extends BaseController
|
|||
List<ProProjectInfoSubdeptsUsers> list = proProjectInfoSubdeptsUsersService.findAllProSubDeptsUser(proProjectInfoSubdeptsUsers);
|
||||
return success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改为默认项目
|
||||
*/
|
||||
@GetMapping("/changeDefaultProject/{id}")
|
||||
public AjaxResult changeDefaultProject(@PathVariable("id") Long id)
|
||||
{
|
||||
return toAjax(proProjectInfoSubdeptsUsersService.editDefaultProjectById(id));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -43,6 +43,13 @@ public interface IProProjectInfoSubdeptsGroupService
|
|||
*/
|
||||
public int updateProProjectInfoSubdeptsGroup(ProProjectInfoSubdeptsGroup proProjectInfoSubdeptsGroup);
|
||||
|
||||
/**
|
||||
* 修改班组组长
|
||||
* @param proProjectInfoSubdeptsGroup
|
||||
* @return
|
||||
*/
|
||||
public int updateGroupLeader(ProProjectInfoSubdeptsGroup proProjectInfoSubdeptsGroup);
|
||||
|
||||
/**
|
||||
* 修改班组状态
|
||||
* @param id 班组主键
|
||||
|
|
|
@ -132,4 +132,12 @@ public interface IProProjectInfoSubdeptsUsersService
|
|||
* @param proId
|
||||
*/
|
||||
List<Map<String,Object>> statsSubDeptsUsersByProId(Long proId);
|
||||
|
||||
/**
|
||||
* 修改项目人员的默认项目
|
||||
*
|
||||
* @param id 项目人员主键
|
||||
* @return 结果
|
||||
*/
|
||||
int editDefaultProjectById(Long id);
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package com.yanzhu.manage.service.impl;
|
||||
|
||||
import cn.binarywang.wx.miniapp.api.WxMaService;
|
||||
import com.yanzhu.common.core.annotation.Excel;
|
||||
import com.yanzhu.common.core.constant.SecurityConstants;
|
||||
import com.yanzhu.common.core.enums.*;
|
||||
import com.yanzhu.common.core.exception.ServiceException;
|
||||
|
@ -304,13 +305,93 @@ public class ProProjectInfoSubdeptsGroupServiceImpl implements IProProjectInfoSu
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改班组组长
|
||||
* @param proProjectInfoSubdeptsGroup
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public int updateGroupLeader(ProProjectInfoSubdeptsGroup proProjectInfoSubdeptsGroup){
|
||||
int res = 1;
|
||||
ProProjectInfoSubdeptsGroup entiry = proProjectInfoSubdeptsGroupMapper.selectProProjectInfoSubdeptsGroupById(proProjectInfoSubdeptsGroup.getId());
|
||||
if(StringUtils.isEmpty(entiry.getGroupLeaderPhone()) || !Objects.equals(entiry.getGroupLeaderPhone(),proProjectInfoSubdeptsGroup.getGroupLeaderPhone())){
|
||||
// 删除旧班组长角色信息
|
||||
if(StringUtils.isNotEmpty(entiry.getGroupLeaderPhone())){
|
||||
ProProjectInfoSubdeptsUsers oldQuery = new ProProjectInfoSubdeptsUsers();
|
||||
oldQuery.setProjectId(entiry.getProjectId());
|
||||
oldQuery.setSubDeptId(entiry.getSubDeptId());
|
||||
oldQuery.setUserPhone(entiry.getGroupLeaderPhone());
|
||||
List<ProProjectInfoSubdeptsUsers> dataList = proProjectInfoSubdeptsUsersMapper.selectProProjectInfoSubdeptsUsersList(oldQuery);
|
||||
ProProjectInfoSubdeptsUsers oldUser = dataList.get(0);
|
||||
oldUser.setUserPost(UserPostEnums.LWGR.getCode());
|
||||
oldUser.setQrCode("");
|
||||
proProjectInfoSubdeptsUsersMapper.updateProProjectInfoSubdeptsUsers(oldUser);
|
||||
try {
|
||||
SysUser sysUser = new SysUser();
|
||||
sysUser.setUserName(entiry.getGroupLeaderPhone());
|
||||
sysUser.setActiveProjectId(proProjectInfoSubdeptsGroup.getProjectId());
|
||||
remoteUserService.removeUserRoles(sysUser, SecurityConstants.INNER);
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
ProProjectInfoSubdeptsUsers query = new ProProjectInfoSubdeptsUsers();
|
||||
query.setProjectId(proProjectInfoSubdeptsGroup.getProjectId());
|
||||
query.setSubDeptId(proProjectInfoSubdeptsGroup.getSubDeptId());
|
||||
query.setUserPhone(proProjectInfoSubdeptsGroup.getGroupLeaderPhone());
|
||||
List<ProProjectInfoSubdeptsUsers> dataList = proProjectInfoSubdeptsUsersMapper.selectProProjectInfoSubdeptsUsersList(query);
|
||||
ProProjectInfoSubdeptsUsers proProjectInfoSubdeptsUsers = dataList.get(0);
|
||||
entiry.setGroupLeaderName(proProjectInfoSubdeptsUsers.getUserName());
|
||||
entiry.setGroupLeaderCode(proProjectInfoSubdeptsUsers.getCardCode());
|
||||
entiry.setGroupLeaderPhone(proProjectInfoSubdeptsUsers.getUserPhone());
|
||||
entiry.setUpdateBy(SecurityUtils.getUsername());
|
||||
entiry.setUpdateTime(DateUtils.getNowDate());
|
||||
res = proProjectInfoSubdeptsGroupMapper.updateProProjectInfoSubdeptsGroup(entiry);
|
||||
if(res > 0){
|
||||
proProjectInfoSubdeptsUsers.setUserPost(UserPostEnums.BZZ.getCode());
|
||||
proProjectInfoSubdeptsUsers.setSubDeptGroup(entiry.getId());
|
||||
proProjectInfoSubdeptsUsers.setSubDeptGroupName(entiry.getGroupName());
|
||||
// 设置班组长二维码信息...
|
||||
try {
|
||||
String accessToken = wxMaService.getAccessToken();
|
||||
String filePath = DateUtils.datePath()+"/"+System.currentTimeMillis()+".png";
|
||||
String savePath = ProfileConfig.profilePath+"/"+filePath;
|
||||
String profilePath = ProfileConfig.profile+"/"+filePath;
|
||||
// 生成二维码
|
||||
File file = wxMaService.getQrcodeService().createQrcode("pages/project_qr/index?SIGID=4&QRPID="+proProjectInfoSubdeptsUsers.getProjectId()+"&PARID="+proProjectInfoSubdeptsUsers.getId(),280);
|
||||
FileUtil.copyFile(file,new File(savePath));
|
||||
proProjectInfoSubdeptsUsers.setQrCode(profilePath);
|
||||
proProjectInfoSubdeptsUsersMapper.updateProProjectInfoSubdeptsUsers(proProjectInfoSubdeptsUsers);
|
||||
}catch (Exception e){
|
||||
log.error(e.getMessage());
|
||||
}
|
||||
// 修改用户角色信息
|
||||
try {
|
||||
SysUser sysUser = new SysUser();
|
||||
sysUser.setUserName(entiry.getGroupLeaderPhone());
|
||||
sysUser.setUserType(UserTypeEnums.FBBZZZ.getCode());
|
||||
sysUser.setNickName(entiry.getGroupLeaderName());
|
||||
sysUser.setPhonenumber(entiry.getGroupLeaderPhone());
|
||||
sysUser.setUpdateBy(SecurityUtils.getUsername());
|
||||
sysUser.setUpdateTime(DateUtils.getNowDate());
|
||||
sysUser.setRemark(entiry.getSubDeptName());
|
||||
sysUser.setActiveProjectId(entiry.getProjectId());
|
||||
remoteUserService.registerUserInfo(sysUser, SecurityConstants.INNER);
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改班组状态
|
||||
* @param id 班组主键
|
||||
|
@ -318,6 +399,7 @@ public class ProProjectInfoSubdeptsGroupServiceImpl implements IProProjectInfoSu
|
|||
* @return
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public int updateUseStatus(Long id, String status){
|
||||
if(StringUtils.isNotEmpty(status)){
|
||||
ProProjectInfoSubdeptsGroup proProjectInfoSubdeptsGroup = proProjectInfoSubdeptsGroupMapper.selectProProjectInfoSubdeptsGroupById(id);
|
||||
|
|
|
@ -462,6 +462,7 @@ public class ProProjectInfoSubdeptsServiceImpl implements IProProjectInfoSubdept
|
|||
* @return
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public int updateUseStatus(Long id, String status){
|
||||
if(StringUtils.isNotEmpty(status)){
|
||||
ProProjectInfoSubdepts proProjectInfoSubdepts = proProjectInfoSubdeptsMapper.selectProProjectInfoSubdeptsById(id);
|
||||
|
|
|
@ -683,4 +683,22 @@ public class ProProjectInfoSubdeptsUsersServiceImpl implements IProProjectInfoSu
|
|||
return proProjectInfoSubdeptsUsersMapper.statsSubDeptsUsersByProId(query);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改项目人员的默认项目
|
||||
*
|
||||
* @param id 项目人员主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public int editDefaultProjectById(Long id){
|
||||
int res = proProjectInfoSubdeptsUsersMapper.editDefaultProjectById(SecurityUtils.getUserId());
|
||||
if(res>0){
|
||||
ProProjectInfoSubdeptsUsers proProjectInfoSubdeptsUsers = proProjectInfoSubdeptsUsersMapper.selectProProjectInfoSubdeptsUsersById(id);
|
||||
proProjectInfoSubdeptsUsers.setSortBy(0L);
|
||||
res = proProjectInfoSubdeptsUsersMapper.updateProProjectInfoSubdeptsUsers(proProjectInfoSubdeptsUsers);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -208,6 +208,15 @@ public class SysUserController extends BaseController {
|
|||
return R.ok(userService.registerUser(sysUser));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除用户角色
|
||||
*/
|
||||
@InnerAuth
|
||||
@PostMapping("/removeUserRoles")
|
||||
public R<Long> removeUserRoles(@RequestBody SysUser sysUser) {
|
||||
return R.ok(userService.removeUserRoles(sysUser));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户信息
|
||||
*/
|
||||
|
|
|
@ -149,6 +149,13 @@ public interface ISysUserService
|
|||
*/
|
||||
public Long registerUser(SysUser user);
|
||||
|
||||
/**
|
||||
* 删除用户角色
|
||||
* @param user
|
||||
* @return
|
||||
*/
|
||||
public Long removeUserRoles(SysUser user);
|
||||
|
||||
/**
|
||||
* 修改用户信息
|
||||
*
|
||||
|
|
|
@ -383,6 +383,21 @@ public class SysUserServiceImpl implements ISysUserService
|
|||
return userId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除用户角色
|
||||
* @param user
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Long removeUserRoles(SysUser user){
|
||||
SysUser info = userMapper.checkUserNameUnique(user.getUserName());
|
||||
SysUserRole userRole = new SysUserRole();
|
||||
userRole.setUserId(info.getUserId());
|
||||
userRole.setDeptId(user.getActiveProjectId());
|
||||
userRoleMapper.deleteUserRoleByUserRole(userRole);
|
||||
return info.getUserId();
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存单位角色...
|
||||
* @param roleName
|
||||
|
|
|
@ -43,6 +43,15 @@ export function editUseStatus(id,status) {
|
|||
})
|
||||
}
|
||||
|
||||
// 修改分包单位班组
|
||||
export function updateGroupLeader(data) {
|
||||
return request({
|
||||
url: '/manage/proProjectInfoSubdeptsGroup/updateGroupLeader',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除分包单位班组
|
||||
export function delProProjectInfoSubdeptsGroup(id) {
|
||||
return request({
|
||||
|
|
|
@ -9,6 +9,15 @@ export function listProProjectInfoSubdeptsUsers(query) {
|
|||
})
|
||||
}
|
||||
|
||||
// 查询分包单位工人列表
|
||||
export function findAllProSubDeptsUser(query) {
|
||||
return request({
|
||||
url: '/manage/proProjectInfoSubdeptsUsers/findAllProSubDeptsUser',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询分包单位工人详细
|
||||
export function getProProjectInfoSubdeptsUsers(id) {
|
||||
return request({
|
||||
|
@ -51,3 +60,11 @@ export function updateEnterState(ids,state) {
|
|||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
// 修改项目排序
|
||||
export function changeDefaultProject(id) {
|
||||
return request({
|
||||
url: '/manage/proProjectInfoSubdeptsUsers/changeDefaultProject/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
|
@ -1,52 +0,0 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 查询项目人员列表
|
||||
export function listProProjectInfoUsers(query) {
|
||||
return request({
|
||||
url: '/manage/proProjectInfoUsers/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询项目人员详细
|
||||
export function getProProjectInfoUsers(id) {
|
||||
return request({
|
||||
url: '/manage/proProjectInfoUsers/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增项目人员
|
||||
export function addProProjectInfoUsers(data) {
|
||||
return request({
|
||||
url: '/manage/proProjectInfoUsers',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改项目人员
|
||||
export function updateProProjectInfoUsers(data) {
|
||||
return request({
|
||||
url: '/manage/proProjectInfoUsers',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除项目人员
|
||||
export function delProProjectInfoUsers(id) {
|
||||
return request({
|
||||
url: '/manage/proProjectInfoUsers/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 改变项目排序
|
||||
export function changeDefaultProject(id) {
|
||||
return request({
|
||||
url: '/manage/proProjectInfoUsers/changeDefaultProject/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
|
@ -62,7 +62,7 @@
|
|||
import { OfficeBuilding } from '@element-plus/icons-vue'
|
||||
import { findMyProjectList } from "@/api/publics";
|
||||
import { switchProject, cancelProject } from '@/api/login'
|
||||
import { changeDefaultProject } from "@/api/manage/proProjectInfoUsers";
|
||||
import { changeDefaultProject } from "@/api/manage/proProjectInfoSubdeptsUsers";
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
import useUserStore from '@/store/modules/user'
|
||||
|
|
|
@ -61,7 +61,7 @@
|
|||
<span v-if="!scope.row.qrCode">-</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="进场状态" align="center" prop="useStatus">
|
||||
<el-table-column label="进场状态" align="center" prop="useStatus" width="80">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="sys_use_status" :value="scope.row.useStatus" />
|
||||
</template>
|
||||
|
@ -76,7 +76,7 @@
|
|||
<dict-tag :options="sys_approve_status" :value="scope.row.approveStatus" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="数据状态" align="center" prop="isDel" width="80">
|
||||
<el-table-column label="数据状态" align="center" prop="isDel" width="80" v-if="false">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="sys_is_del" :value="scope.row.isDel" />
|
||||
</template>
|
||||
|
|
|
@ -72,7 +72,7 @@
|
|||
<dict-tag :options="pro_craft_post" :value="scope.row.craftPost" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="班组长" align="center" prop="groupLeaderName" >
|
||||
<el-table-column label="班组长" align="center" prop="groupLeaderName" width="120">
|
||||
<template #default="scope">
|
||||
<el-button link v-if="scope.row.groupLeaderName" type="primary" icon="UserFilled"
|
||||
@click="handleUpdateGroupLeader(scope.row)">{{scope.row.groupLeaderName}}</el-button>
|
||||
|
@ -80,6 +80,11 @@
|
|||
@click="handleUpdateGroupLeader(scope.row)"> - </el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="进场状态" align="center" prop="useStatus" width="80">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="sys_use_status" :value="scope.row.useStatus" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" width="120">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
|
||||
|
@ -90,7 +95,7 @@
|
|||
<dict-tag :options="sys_approve_status" :value="scope.row.approveStatus" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="数据状态" align="center" prop="isDel" width="80">
|
||||
<el-table-column label="数据状态" align="center" prop="isDel" width="80" v-if="false">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="sys_is_del" :value="scope.row.isDel" />
|
||||
</template>
|
||||
|
@ -141,13 +146,13 @@
|
|||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
<el-button @click="open = false">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 添加或修改单位班组对话框 -->
|
||||
<el-dialog :title="title" v-model="open" width="680px" append-to-body modal-class="SubdeptsGroupDlg">
|
||||
<el-dialog :title="leaderTitle" v-model="leaderOpen" width="680px" append-to-body modal-class="SubdeptsGroupDlg">
|
||||
<el-form ref="proProjectInfoSubdeptsGroupRef" :model="leaderForm" :rules="leaderRules" label-width="88px">
|
||||
<el-form-item label="项目名称">
|
||||
<el-tag effect="plain">{{ leaderForm.projectName }}</el-tag>
|
||||
|
@ -163,16 +168,16 @@
|
|||
{{leaderForm.groupName}}
|
||||
</el-form-item>
|
||||
<el-form-item label="班组组长" prop="groupLeaderPhone">
|
||||
<el-select v-model="form.groupLeaderPhone" placeholder="请选择班组组长" style="width:100%">
|
||||
<el-option v-for="dict in pro_craft_post" :key="dict.value" :label="dict.label"
|
||||
:value="dict.value"></el-option>
|
||||
<el-select v-model="leaderForm.groupLeaderPhone" placeholder="请选择班组组长" style="width:100%">
|
||||
<el-option v-for="option in groupLeaderOptions" :key="option.userPhone" :label="option.userName"
|
||||
:value="option.userPhone"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
<el-button type="primary" @click="submitLeaderForm">确 定</el-button>
|
||||
<el-button @click="leaderOpen = false">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
@ -180,12 +185,14 @@
|
|||
</template>
|
||||
|
||||
<script setup name="ProProjectInfoSubdeptsGroup">
|
||||
import auth from '@/plugins/auth'
|
||||
import { findAllProjectInfoSubdepts } from "@/api/manage/proProjectInfoSubdepts";
|
||||
import { listProProjectInfoSubdeptsGroup, getProProjectInfoSubdeptsGroup, delProProjectInfoSubdeptsGroup, addProProjectInfoSubdeptsGroup, updateProProjectInfoSubdeptsGroup, editUseStatus } from "@/api/manage/proProjectInfoSubdeptsGroup";
|
||||
import { findAllProSubDeptsUser } from "@/api/manage/proProjectInfoSubdeptsUsers";
|
||||
import { listProProjectInfoSubdeptsGroup, getProProjectInfoSubdeptsGroup, delProProjectInfoSubdeptsGroup, addProProjectInfoSubdeptsGroup, updateProProjectInfoSubdeptsGroup, editUseStatus, updateGroupLeader } from "@/api/manage/proProjectInfoSubdeptsGroup";
|
||||
import useUserStore from '@/store/modules/user'
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
const { sys_approve_status, sub_dept_type, pro_craft_type, sys_is_del, pro_craft_post } = proxy.useDict('sys_approve_status', 'sub_dept_type', 'pro_craft_type', 'sys_is_del', 'pro_craft_post');
|
||||
const { sys_approve_status, sub_dept_type, pro_craft_type, sys_is_del, pro_craft_post, sys_use_status } = proxy.useDict('sys_approve_status', 'sub_dept_type', 'pro_craft_type', 'sys_is_del', 'pro_craft_post', 'sys_use_status');
|
||||
|
||||
const userStore = useUserStore()
|
||||
const proProjectInfoSubdeptsGroupList = ref([]);
|
||||
|
@ -228,7 +235,7 @@ const data = reactive({
|
|||
}
|
||||
});
|
||||
|
||||
const { queryParams, form, rules, leaderForm } = toRefs(data);
|
||||
const { queryParams, form, rules, leaderForm, leaderRules } = toRefs(data);
|
||||
|
||||
/** 查询单位班组列表 */
|
||||
function getList() {
|
||||
|
@ -324,15 +331,20 @@ function handleUpdate(row) {
|
|||
|
||||
/** 修改班组长按钮操作 */
|
||||
function handleUpdateGroupLeader(row) {
|
||||
open.value = true;
|
||||
title.value = "修改单位班组长";
|
||||
reset();
|
||||
initSubDeptOptions(row.projectId);
|
||||
const _id = row.id || ids.value
|
||||
getProProjectInfoSubdeptsGroup(_id).then(response => {
|
||||
form.value = response.data;
|
||||
|
||||
});
|
||||
let param = {
|
||||
projectId: row.projectId,
|
||||
subDeptId: row.subDeptId,
|
||||
craftPost: row.craftPost,
|
||||
activeTags: 'finished'
|
||||
}
|
||||
if(auth.hasPermi('manage:proProjectInfoSubdeptsGroup:edit')){
|
||||
leaderForm.value = row;
|
||||
findAllProSubDeptsUser(param).then(res => {
|
||||
leaderOpen.value = true;
|
||||
leaderTitle.value = "修改单位班组长";
|
||||
groupLeaderOptions.value = res.data;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/** 提交按钮 */
|
||||
|
@ -357,6 +369,19 @@ function submitForm() {
|
|||
});
|
||||
}
|
||||
|
||||
/** 变更按钮 */
|
||||
function submitLeaderForm() {
|
||||
proxy.$refs["proProjectInfoSubdeptsGroupRef"].validate(valid => {
|
||||
if (valid) {
|
||||
updateGroupLeader(leaderForm.value).then(response => {
|
||||
proxy.$modal.msgSuccess("修改成功");
|
||||
leaderOpen.value = false;
|
||||
getList();
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/** 删除按钮操作 */
|
||||
function handleDelete(row) {
|
||||
const _ids = row.id || ids.value;
|
||||
|
|
Loading…
Reference in New Issue