| | |
| | | @Log(title = "实验结果工作评定管理-删除化验师、实验员工作评定", businessType = BusinessType.DELETE) |
| | | @ApiOperation(value = "删除化验师、实验员工作评定") |
| | | @DeleteMapping(value = "/open/t-result-work-evaluate/deleteById") |
| | | public R<Boolean> deleteById(@RequestBody String id) { |
| | | public R<Boolean> deleteById(@RequestParam String id) { |
| | | tResultWorkEvaluateService.removeById(id); |
| | | return R.ok(); |
| | | } |
| | |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.LocalDateTime; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | private final TProjectTeamStaffService projectTeamStaffService; |
| | | private final TExperimentDispatchParticipantsService experimentDispatchParticipantsService; |
| | | private final TNoticeService noticeService; |
| | | private final TInspectionReportService inspectionReportService; |
| | | @Autowired |
| | | public TSamplingRecordController(TSamplingRecordService samplingRecordService, TokenService tokenService, ISysUserService sysUserService, SysUserMapper sysUserMapper, TSamplingRecordOperationService samplingRecordOperationService, TExperimentDispatchService experimentDispatchService, TProjectProposalService projectProposalService, TProjectTeamService projectTeamService, TProjectTeamStaffService projectTeamStaffService, TExperimentDispatchParticipantsService experimentDispatchParticipantsService, TNoticeService noticeService) { |
| | | public TSamplingRecordController(TSamplingRecordService samplingRecordService, TokenService tokenService, ISysUserService sysUserService, SysUserMapper sysUserMapper, TSamplingRecordOperationService samplingRecordOperationService, TExperimentDispatchService experimentDispatchService, TProjectProposalService projectProposalService, TProjectTeamService projectTeamService, TProjectTeamStaffService projectTeamStaffService, TExperimentDispatchParticipantsService experimentDispatchParticipantsService, TNoticeService noticeService, TInspectionReportService inspectionReportService) { |
| | | this.samplingRecordService = samplingRecordService; |
| | | this.tokenService = tokenService; |
| | | this.sysUserService = sysUserService; |
| | |
| | | this.projectTeamStaffService = projectTeamStaffService; |
| | | this.experimentDispatchParticipantsService = experimentDispatchParticipantsService; |
| | | this.noticeService = noticeService; |
| | | this.inspectionReportService = inspectionReportService; |
| | | } |
| | | |
| | | /** |
| | |
| | | query.setDispatchIds(dispatchIds); |
| | | } |
| | | } |
| | | if(roleType == 4){ |
| | | // 查询检验报告 |
| | | List<TInspectionReport> inspectionReports = inspectionReportService.list(Wrappers.lambdaQuery(TInspectionReport.class) |
| | | .eq(TInspectionReport::getStatus, 1)); |
| | | if (!CollectionUtils.isEmpty(inspectionReports)) { |
| | | List<String> dispatchIds = inspectionReports.stream().map(TInspectionReport::getDispatchId).distinct().collect(Collectors.toList()); |
| | | List<String> dispatchIds1 = query.getDispatchIds(); |
| | | Iterator<String> iterator = dispatchIds1.iterator(); |
| | | while (iterator.hasNext()) { |
| | | String next = iterator.next(); |
| | | if (!dispatchIds.contains(next)) { |
| | | iterator.remove(); |
| | | } |
| | | } |
| | | if(CollectionUtils.isEmpty(dispatchIds1)){ |
| | | List<String> id = new ArrayList<>(); |
| | | id.add("-1"); |
| | | query.setDispatchIds(id); |
| | | }else { |
| | | query.setDispatchIds(dispatchIds1); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return R.ok(samplingRecordService.pageList(query)); |
| | | } |
| | |
| | | import com.ruoyi.common.core.domain.entity.SysRole; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.utils.CodeGenerateUtils; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.framework.web.service.TokenService; |
| | |
| | | user.setCreateBy(getUsername()); |
| | | user.setPassword(SecurityUtils.encryptPassword("123456")); |
| | | user.setRoleType(Integer.parseInt(user.getRoleId().toString())); |
| | | user.setUserIdentification(CodeGenerateUtils.generateVolumeSn()); |
| | | userService.insertUser(user); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 账号继承 |
| | | */ |
| | | // @PreAuthorize("@ss.hasPermi('system:user:add')") |
| | | @ApiOperation(value = "账号继承,userId:继承账号id,oldUserId:老账号id",response = SysUser.class) |
| | | @Log(title = "用户信息-账号继承", businessType = BusinessType.UPDATE) |
| | | @PutMapping("/open/system/user/inherit") |
| | | public R<String> inherit(@RequestParam Long userId, |
| | | @RequestParam Long oldUserId) |
| | | { |
| | | // 查询老帐号 |
| | | SysUser oldUser = userService.selectUserById(oldUserId); |
| | | if (Objects.isNull(oldUser)){ |
| | | return R.fail("原始账号不存在"); |
| | | } |
| | | SysUser user = userService.selectUserById(userId); |
| | | if (Objects.isNull(user)){ |
| | | return R.fail("继承账号不存在"); |
| | | } |
| | | Long oldUserUserId = oldUser.getUserId(); |
| | | List<SysUser> oldUserList = userService.selectOldList(); |
| | | // oldUser.setUserId(); |
| | | // userService.updateUserOldUser(oldUser); |
| | | user.setParentId(oldUser.getUserId()); |
| | | user.setParentAccount(oldUser.getUserName()); |
| | | |
| | | // userService.updateUserInherit(user); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 修改用户 |
| | | */ |
| | | // @PreAuthorize("@ss.hasPermi('system:user:edit')") |
| | |
| | | @TableField("sign_picture") |
| | | private String signPicture; |
| | | |
| | | @ApiModelProperty(value = "用户唯一标识") |
| | | @TableField("userIdentification") |
| | | private String userIdentification; |
| | | @ApiModelProperty(value = "继承账号id") |
| | | @TableField("parentId") |
| | | private Long parentId; |
| | | @ApiModelProperty(value = "继承账号") |
| | | @TableField("parentAccount") |
| | | private String parentAccount; |
| | | |
| | | public Integer getRoleType() { |
| | | return roleType; |
| | | } |
| | |
| | | import java.math.BigDecimal; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Calendar; |
| | | import java.util.Date; |
| | | import java.util.concurrent.atomic.AtomicInteger; |
| | | |
| | | /** |
| | | * @Description |
| | |
| | | Calendar calendar = Calendar.getInstance(); |
| | | SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddhhmmss"); |
| | | String dateTime = dateFormat.format(calendar.getTime()); |
| | | dateTime = dateTime.substring(2); |
| | | dateTime = dateTime.substring(0); |
| | | String timestampPart = "" + (Math.random() * 10000) * (System.currentTimeMillis() / 10000); |
| | | timestampPart = timestampPart.replace(".", "").replace("E", ""); |
| | | timestampPart = timestampPart.substring(0, 0); |
| | | return dateTime + timestampPart; |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | System.err.println(generateVolumeSn()); |
| | | } |
| | | |
| | | } |
| | |
| | | List<SysUser> selectListByNameAndUserIds(@Param("nickName")String nickName, @Param("userIds")List<Long> userIds); |
| | | |
| | | int editSignPicture(SysUser user); |
| | | |
| | | List<SysUser> selectOldList(); |
| | | |
| | | |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | Integer editSignPicture(SysUser user); |
| | | |
| | | List<SysUser> selectOldList(); |
| | | |
| | | |
| | | } |
| | |
| | | return userMapper.editSignPicture(user); |
| | | } |
| | | |
| | | @Override |
| | | public List<SysUser> selectOldList() { |
| | | return userMapper.selectOldList(); |
| | | } |
| | | |
| | | // @Override |
| | | // public UserInfoVo userInfo(Long userId) { |
| | | // return userMapper.userInfo(userId); |
| | |
| | | AND u.nick_name LIKE concat('%',#{nickName},'%') |
| | | </if> |
| | | </select> |
| | | <select id="selectOldList" resultType="com.ruoyi.common.core.domain.entity.SysUser"> |
| | | select u.user_id AS userId, u.dept_id AS deptId, u.user_name AS userName, u.nick_name AS nickName, u.email AS email, u.avatar AS avatar, |
| | | u.phonenumber AS phonenumber, u.sex AS sex, u.status AS status, u.del_flag AS delFlag, u.login_ip AS loginIp, |
| | | u.login_date AS loginDate, u.create_by AS createBy, u.create_time AS createTime, u.remark AS remark |
| | | from sys_user u where user_id < 0 and u.status = 0 and u.del_flag = 0 order by user_id desc |
| | | </select> |
| | | |
| | | <insert id="insertUser" parameterType="SysUser" useGeneratedKeys="true" keyProperty="userId"> |
| | | insert into sys_user( |
| | |
| | | <if test="ifBlack != null">ifBlack,</if> |
| | | <if test="districtId != null">districtId,</if> |
| | | <if test="roleType != null">role_type,</if> |
| | | <if test="userIdentification != null and userIdentification != ''">userIdentification,</if> |
| | | create_time |
| | | )values( |
| | | <if test="userId != null and userId != ''">#{userId},</if> |
| | |
| | | <if test="ifBlack != null">#{ifBlack},</if> |
| | | <if test="districtId != null">#{districtId},</if> |
| | | <if test="roleType != null">#{roleType},</if> |
| | | <if test="userIdentification != null and userIdentification != ''">#{userIdentification},</if> |
| | | sysdate() |
| | | ) |
| | | </insert> |
| | |
| | | </foreach> |
| | | </if> |
| | | <if test="query.roleType != null and query.roleType == 4"> |
| | | and tir.status = 1 |
| | | and tir.status in (-1, 1) |
| | | </if> |
| | | <if test="query.status == null"> |
| | | and tir.status != -1 |