Compare commits
	
		
			2 Commits
		
	
	
		
			48ea20581c
			...
			be0f425e14
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| be0f425e14 | |||
| f24e33b1c7 | 
| @ -92,7 +92,7 @@ public class SysRegisterService { | |||||||
| //        if (!isValid) { | //        if (!isValid) { | ||||||
| //            throw new UserException("注册失败,密码需满足8–18位,包含大小写字母、数字、特殊字符中的至少三种组合"); | //            throw new UserException("注册失败,密码需满足8–18位,包含大小写字母、数字、特殊字符中的至少三种组合"); | ||||||
| //        } | //        } | ||||||
|         // 验证码开关 |  | ||||||
|         SysUserBo sysUser = new SysUserBo(); |         SysUserBo sysUser = new SysUserBo(); | ||||||
|         sysUser.setUserName(username); |         sysUser.setUserName(username); | ||||||
|         sysUser.setNickName(username); |         sysUser.setNickName(username); | ||||||
| @ -101,16 +101,24 @@ public class SysRegisterService { | |||||||
|         sysUser.setUserType(userType); |         sysUser.setUserType(userType); | ||||||
|         sysUser.setEmail(registerBody.getEmail()); |         sysUser.setEmail(registerBody.getEmail()); | ||||||
|  |  | ||||||
|         boolean exist = TenantHelper.dynamic(tenantId, () -> { |         SysUser sysUserByPhonenumber = userMapper.selectDefFlagUser(username); | ||||||
|             return userMapper.exists(new LambdaQueryWrapper<SysUser>() |         if(sysUserByPhonenumber != null){ | ||||||
|                 .eq(SysUser::getPhonenumber, sysUser.getPhonenumber())); |             sysUser.setUserId(sysUserByPhonenumber.getUserId()); | ||||||
|         }); |             userMapper.updateDefFlag(sysUser); | ||||||
|         if (exist) { |             userMapper.updateConstructionUser(sysUserByPhonenumber.getUserId()); | ||||||
|             throw new UserException("user.register.save.error", username); |         }else { | ||||||
|         } |  | ||||||
|         boolean regFlag = userService.registerUser(sysUser, tenantId); |             boolean exist = TenantHelper.dynamic(tenantId, () -> { | ||||||
|         if (!regFlag) { |                 return userMapper.exists(new LambdaQueryWrapper<SysUser>() | ||||||
|             throw new UserException("user.register.error"); |                     .eq(SysUser::getPhonenumber, sysUser.getPhonenumber())); | ||||||
|  |             }); | ||||||
|  |             if (exist) { | ||||||
|  |                 throw new UserException("user.register.save.error", username); | ||||||
|  |             } | ||||||
|  |             boolean regFlag = userService.registerUser(sysUser, tenantId); | ||||||
|  |             if (!regFlag) { | ||||||
|  |                 throw new UserException("user.register.error"); | ||||||
|  |             } | ||||||
|         } |         } | ||||||
|  |  | ||||||
|         recordLogininfor(tenantId, username, Constants.REGISTER, MessageUtils.message("user.register.success")); |         recordLogininfor(tenantId, username, Constants.REGISTER, MessageUtils.message("user.register.success")); | ||||||
|  | |||||||
| @ -211,6 +211,11 @@ public class BusPurchaseDocServiceImpl extends ServiceImpl<BusPurchaseDocMapper, | |||||||
|     public void validNum(List<BusPlanDocAssociationBo> associationList, Long supplierId) { |     public void validNum(List<BusPlanDocAssociationBo> associationList, Long supplierId) { | ||||||
|  |  | ||||||
|         for (BusPlanDocAssociationBo association : associationList) { |         for (BusPlanDocAssociationBo association : associationList) { | ||||||
|  |  | ||||||
|  |             if(association.getDemandQuantity() == null){ | ||||||
|  |                 throw new ServiceException("请填写需求数量"); | ||||||
|  |             } | ||||||
|  |  | ||||||
|             //获取批次需求计划 |             //获取批次需求计划 | ||||||
|             BusMaterialbatchdemandplan byId = materialbatchdemandplanService.getById(association.getPlanId()); |             BusMaterialbatchdemandplan byId = materialbatchdemandplanService.getById(association.getPlanId()); | ||||||
|             List<String> statuss = new ArrayList<>(); |             List<String> statuss = new ArrayList<>(); | ||||||
|  | |||||||
| @ -1,6 +1,7 @@ | |||||||
| package org.dromara.contractor.domain; | package org.dromara.contractor.domain; | ||||||
|  |  | ||||||
| import com.baomidou.mybatisplus.annotation.TableId; | import com.baomidou.mybatisplus.annotation.TableId; | ||||||
|  | import com.baomidou.mybatisplus.annotation.TableLogic; | ||||||
| import com.baomidou.mybatisplus.annotation.TableName; | import com.baomidou.mybatisplus.annotation.TableName; | ||||||
| import lombok.Data; | import lombok.Data; | ||||||
| import lombok.EqualsAndHashCode; | import lombok.EqualsAndHashCode; | ||||||
| @ -204,4 +205,10 @@ public class SubConstructionUser extends BaseEntity { | |||||||
|     private Long goId; |     private Long goId; | ||||||
|  |  | ||||||
|     private String goOpenid; |     private String goOpenid; | ||||||
|  |  | ||||||
|  |     /** | ||||||
|  |      * 删除标志(0代表存在 1代表删除) | ||||||
|  |      */ | ||||||
|  |     @TableLogic | ||||||
|  |     private String delFlag; | ||||||
| } | } | ||||||
|  | |||||||
| @ -370,6 +370,9 @@ public class MatMaterialsServiceImpl extends ServiceImpl<MatMaterialsMapper, Mat | |||||||
|     @Override |     @Override | ||||||
|     public void create(Long projectId, List<MatMaterialReceiveItemDto> itemList, String formCode, String supplierUnit, String nickname) { |     public void create(Long projectId, List<MatMaterialReceiveItemDto> itemList, String formCode, String supplierUnit, String nickname) { | ||||||
|         for (MatMaterialReceiveItemDto item : itemList) { |         for (MatMaterialReceiveItemDto item : itemList) { | ||||||
|  |             if(item.getAcceptedQuantity().compareTo(BigDecimal.ZERO) <= 0){ | ||||||
|  |                 continue; | ||||||
|  |             } | ||||||
|             MatMaterials matMaterials = new MatMaterials(); |             MatMaterials matMaterials = new MatMaterials(); | ||||||
|             matMaterials.setMaterialsName(item.getName()); |             matMaterials.setMaterialsName(item.getName()); | ||||||
|             matMaterials.setProjectId(projectId); |             matMaterials.setProjectId(projectId); | ||||||
|  | |||||||
| @ -17,6 +17,7 @@ import org.dromara.common.core.utils.StringUtils; | |||||||
| import org.dromara.common.encrypt.annotation.ApiEncrypt; | import org.dromara.common.encrypt.annotation.ApiEncrypt; | ||||||
| import org.dromara.common.excel.core.ExcelResult; | import org.dromara.common.excel.core.ExcelResult; | ||||||
| import org.dromara.common.excel.utils.ExcelUtil; | import org.dromara.common.excel.utils.ExcelUtil; | ||||||
|  | import org.dromara.common.idempotent.annotation.RepeatSubmit; | ||||||
| import org.dromara.common.log.annotation.Log; | import org.dromara.common.log.annotation.Log; | ||||||
| import org.dromara.common.log.enums.BusinessType; | import org.dromara.common.log.enums.BusinessType; | ||||||
| import org.dromara.common.mybatis.core.page.PageQuery; | import org.dromara.common.mybatis.core.page.PageQuery; | ||||||
| @ -83,5 +84,21 @@ public class SysUserAppController extends BaseController { | |||||||
|         return R.ok(deptService.selectDeptTreeList(dept)); |         return R.ok(deptService.selectDeptTreeList(dept)); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |     /** | ||||||
|  |      * 注销用户信息 | ||||||
|  |      */ | ||||||
|  |     @RepeatSubmit() | ||||||
|  |     @PutMapping("/deletion") | ||||||
|  |     public R<Boolean> deletion() { | ||||||
|  |         return R.ok(userService.deletion()); | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     /** | ||||||
|  |      * 密码比对 | ||||||
|  |      */ | ||||||
|  |     @GetMapping("/passwordCompare") | ||||||
|  |     public R<Boolean> passwordCompare(String password) { | ||||||
|  |         return R.ok(userService.passwordCompare(password)); | ||||||
|  |     } | ||||||
|  |  | ||||||
| } | } | ||||||
|  | |||||||
| @ -8,6 +8,7 @@ import org.dromara.common.mybatis.annotation.DataColumn; | |||||||
| import org.dromara.common.mybatis.annotation.DataPermission; | import org.dromara.common.mybatis.annotation.DataPermission; | ||||||
| import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; | import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; | ||||||
| import org.dromara.system.domain.SysUser; | import org.dromara.system.domain.SysUser; | ||||||
|  | import org.dromara.system.domain.bo.SysUserBo; | ||||||
| import org.dromara.system.domain.vo.SysUserExportVo; | import org.dromara.system.domain.vo.SysUserExportVo; | ||||||
| import org.dromara.system.domain.vo.SysUserVo; | import org.dromara.system.domain.vo.SysUserVo; | ||||||
|  |  | ||||||
| @ -137,4 +138,13 @@ public interface SysUserMapper extends BaseMapperPlus<SysUser, SysUserVo> { | |||||||
|  |  | ||||||
|  |  | ||||||
|     List<SysUserVo> selectUserListByAppUserType(@Param("appUserType") String appUserType, @Param("projectId")Long projectId, @Param("contractorId")Long contractorId); |     List<SysUserVo> selectUserListByAppUserType(@Param("appUserType") String appUserType, @Param("projectId")Long projectId, @Param("contractorId")Long contractorId); | ||||||
|  |  | ||||||
|  |  | ||||||
|  |     SysUser selectDefFlagUser(@Param("phonenumber")  String phonenumber); | ||||||
|  |  | ||||||
|  |  | ||||||
|  |     void updateDefFlag(@Param("sysUserBo") SysUserBo sysUserBo); | ||||||
|  |  | ||||||
|  |     void updateConstructionUser(@Param("userId") Long userId); | ||||||
|  |  | ||||||
| } | } | ||||||
|  | |||||||
| @ -283,5 +283,7 @@ public interface ISysUserService { | |||||||
|  |  | ||||||
|     String queryNameById(Long id); |     String queryNameById(Long id); | ||||||
|  |  | ||||||
|  |     Boolean deletion(); | ||||||
|  |  | ||||||
|  |     Boolean passwordCompare(String password); | ||||||
| } | } | ||||||
|  | |||||||
| @ -1,5 +1,6 @@ | |||||||
| package org.dromara.system.service.impl; | package org.dromara.system.service.impl; | ||||||
|  |  | ||||||
|  | import cn.dev33.satoken.secure.BCrypt; | ||||||
| import cn.hutool.core.bean.BeanUtil; | import cn.hutool.core.bean.BeanUtil; | ||||||
| import cn.hutool.core.collection.CollUtil; | import cn.hutool.core.collection.CollUtil; | ||||||
| import cn.hutool.core.collection.CollectionUtil; | import cn.hutool.core.collection.CollectionUtil; | ||||||
| @ -57,6 +58,7 @@ import org.springframework.http.HttpStatus; | |||||||
| import org.springframework.stereotype.Service; | import org.springframework.stereotype.Service; | ||||||
| import org.springframework.transaction.annotation.Transactional; | import org.springframework.transaction.annotation.Transactional; | ||||||
|  |  | ||||||
|  | import java.math.BigDecimal; | ||||||
| import java.util.*; | import java.util.*; | ||||||
| import java.util.stream.Collectors; | import java.util.stream.Collectors; | ||||||
|  |  | ||||||
| @ -1281,6 +1283,49 @@ public class SysUserServiceImpl implements ISysUserService, UserService { | |||||||
|         return sysUserVo != null ? sysUserVo.getNickName() : null; |         return sysUserVo != null ? sysUserVo.getNickName() : null; | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |     @Override | ||||||
|  |     @Transactional(rollbackFor = Exception.class) | ||||||
|  |     public Boolean deletion() { | ||||||
|  |         Long userId = LoginHelper.getUserId(); | ||||||
|  |         SubConstructionUser constructionUser = constructionUserService.getByUserId(userId); | ||||||
|  |         if(constructionUser!=null && constructionUser.getTeamId()!=null){ | ||||||
|  |             throw new ServiceException("请先退出班组"); | ||||||
|  |         } | ||||||
|  |  | ||||||
|  |         //清空关联项目 | ||||||
|  |         userProjectRelevancyService.deleteByUserId(userId); | ||||||
|  |  | ||||||
|  |         //逻辑删除 | ||||||
|  |         constructionUserService.lambdaUpdate() | ||||||
|  |             .set(SubConstructionUser::getProjectId, null) | ||||||
|  |             .set(SubConstructionUser::getContractorId, null) | ||||||
|  |             .set(SubConstructionUser::getTeamId, null) | ||||||
|  |             .set(SubConstructionUser::getUserRole, "9") | ||||||
|  |             .set(SubConstructionUser::getTypeOfWork, null) | ||||||
|  |             .set(SubConstructionUser::getWageMeasureUnit, null) | ||||||
|  |             .set(SubConstructionUser::getEntryDate, null) | ||||||
|  |             .set(SubConstructionUser::getLeaveDate, null) | ||||||
|  |             .set(SubConstructionUser::getSalary, BigDecimal.ZERO) | ||||||
|  |             .set(SubConstructionUser::getFirstDate, null) | ||||||
|  |             .set(SubConstructionUser::getExitStatus, "0") | ||||||
|  |             .set(SubConstructionUser::getDelFlag, "1") | ||||||
|  |             .eq(SubConstructionUser::getSysUserId, userId) | ||||||
|  |             .update(); | ||||||
|  |  | ||||||
|  |  | ||||||
|  |         //删除用户角色关联 | ||||||
|  |         userRoleMapper.delete(new LambdaQueryWrapper<SysUserRole>().eq(SysUserRole::getUserId, userId)); | ||||||
|  |  | ||||||
|  |         return baseMapper.deleteById(userId)>0; | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     @Override | ||||||
|  |     public Boolean passwordCompare(String password) { | ||||||
|  |         Long userId = LoginHelper.getUserId(); | ||||||
|  |         SysUser sysUser = baseMapper.selectById(userId); | ||||||
|  |         return BCrypt.checkpw(password, sysUser.getPassword()); | ||||||
|  |     } | ||||||
|  |  | ||||||
|     @Override |     @Override | ||||||
|     public UserDTO selectUser(Long userId) { |     public UserDTO selectUser(Long userId) { | ||||||
|  |  | ||||||
|  | |||||||
| @ -1,6 +1,7 @@ | |||||||
| package org.dromara.tender.service.impl; | package org.dromara.tender.service.impl; | ||||||
|  |  | ||||||
| import cn.hutool.core.bean.BeanUtil; | import cn.hutool.core.bean.BeanUtil; | ||||||
|  | import cn.hutool.core.collection.CollectionUtil; | ||||||
| import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | ||||||
| import lombok.extern.slf4j.Slf4j; | import lombok.extern.slf4j.Slf4j; | ||||||
| import org.dromara.common.core.exception.ServiceException; | import org.dromara.common.core.exception.ServiceException; | ||||||
| @ -384,6 +385,9 @@ public class BusBiddingPlanServiceImpl extends ServiceImpl<BusBiddingPlanMapper, | |||||||
|             bplanIdds.add(busBiddingPlanVo.getId()); |             bplanIdds.add(busBiddingPlanVo.getId()); | ||||||
|         } |         } | ||||||
|         Map<Long, BigDecimal> map = new HashMap<>(); |         Map<Long, BigDecimal> map = new HashMap<>(); | ||||||
|  |         if(CollectionUtil.isEmpty(bplanIdds)){ | ||||||
|  |             return map; | ||||||
|  |         } | ||||||
|         //获取该供应商的所有材料 |         //获取该供应商的所有材料 | ||||||
|         List<BusTenderPlanningLimitList> busTenderPlanningLimitLists = busTenderPlanningLimitListMapper.selectList(new LambdaQueryWrapper<BusTenderPlanningLimitList>().in(BusTenderPlanningLimitList::getBiddingPlanId, bplanIdds)); |         List<BusTenderPlanningLimitList> busTenderPlanningLimitLists = busTenderPlanningLimitListMapper.selectList(new LambdaQueryWrapper<BusTenderPlanningLimitList>().in(BusTenderPlanningLimitList::getBiddingPlanId, bplanIdds)); | ||||||
|         for (BusTenderPlanningLimitList v : busTenderPlanningLimitLists) { |         for (BusTenderPlanningLimitList v : busTenderPlanningLimitLists) { | ||||||
|  | |||||||
| @ -140,5 +140,30 @@ | |||||||
|           AND su.status = '0' |           AND su.status = '0' | ||||||
|     </select> |     </select> | ||||||
|  |  | ||||||
|  |     <select id="selectDefFlagUser" resultType="org.dromara.system.domain.SysUser"> | ||||||
|  |         select * from sys_user where del_flag = '1' and phonenumber = #{phonenumber} | ||||||
|  |     </select> | ||||||
|  |  | ||||||
|  |     <update id="updateDefFlag"> | ||||||
|  |         UPDATE sys_user | ||||||
|  |         SET | ||||||
|  |             del_flag = '0', | ||||||
|  |             contractor_id = null, | ||||||
|  |             dept_id = null, | ||||||
|  |             password  = #{sysUserBo.password}, | ||||||
|  |             user_type = #{sysUserBo.userType}, | ||||||
|  |             app_user_type = '0', | ||||||
|  |             status = '0' | ||||||
|  |         WHERE | ||||||
|  |             user_id = #{sysUserBo.userId} | ||||||
|  |     </update> | ||||||
|  |  | ||||||
|  |     <update id="updateConstructionUser"> | ||||||
|  |         UPDATE sub_construction_user | ||||||
|  |         SET | ||||||
|  |             del_flag = '0', | ||||||
|  |             user_role = '0' | ||||||
|  |         WHERE | ||||||
|  |             sys_user_id = #{userId} | ||||||
|  |     </update> | ||||||
| </mapper> | </mapper> | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user
	