修改bug
This commit is contained in:
@ -33,7 +33,6 @@ public class SubContractorCreateReq implements Serializable {
|
||||
/**
|
||||
* 供应商id
|
||||
*/
|
||||
@NotNull(message = "供应商不能为空")
|
||||
private Long supplierId;
|
||||
|
||||
/**
|
||||
|
||||
@ -167,8 +167,8 @@ public class PgsProgressPlanDetailServiceImpl extends ServiceImpl<PgsProgressPla
|
||||
throw new ServiceException("进度计划详情信息不存在", HttpStatus.NOT_FOUND);
|
||||
}
|
||||
// 判断当前详情是否已提交
|
||||
if (progressPlanDetail.getStatus().equals("3")) {
|
||||
throw new ServiceException("当前详情已在施工产值中审核完成,无法提交", HttpStatus.BAD_REQUEST);
|
||||
if (!progressPlanDetail.getStatus().equals("1")) {
|
||||
throw new ServiceException("当前详情已提交至施工产值,无法进行修改", HttpStatus.BAD_REQUEST);
|
||||
}
|
||||
Long progressPlanId = progressPlanDetail.getProgressPlanId();
|
||||
PgsProgressPlan progressPlan = progressPlanService.getById(progressPlanId);
|
||||
@ -369,8 +369,8 @@ public class PgsProgressPlanDetailServiceImpl extends ServiceImpl<PgsProgressPla
|
||||
throw new ServiceException("完成时间不能大于当前时间", HttpStatus.BAD_REQUEST);
|
||||
}*/
|
||||
// 判断当前详情是否已提交
|
||||
if (progressPlanDetail.getStatus().equals("3")) {
|
||||
throw new ServiceException("当前详情已在施工产值中提交,无法提交", HttpStatus.BAD_REQUEST);
|
||||
if (!progressPlanDetail.getStatus().equals("1")) {
|
||||
throw new ServiceException("当前详情已提交至施工产值,无法进行修改", HttpStatus.BAD_REQUEST);
|
||||
}
|
||||
Long progressPlanId = progressPlanDetail.getProgressPlanId();
|
||||
PgsProgressPlan progressPlan = progressPlanService.getById(progressPlanId);
|
||||
|
||||
@ -15,12 +15,13 @@ import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.project.domain.vo.projectteam.BusProjectTeamForemanVo;
|
||||
import org.dromara.project.service.IBusProjectTeamService;
|
||||
import org.dromara.quality.domain.QltQualityInspection;
|
||||
import org.dromara.quality.domain.dto.qualityinspection.*;
|
||||
import org.dromara.quality.domain.dto.qualityinspection.QltQualityInspectionCreateReq;
|
||||
import org.dromara.quality.domain.dto.qualityinspection.QltQualityInspectionGisReq;
|
||||
import org.dromara.quality.domain.dto.qualityinspection.QltQualityInspectionQueryReq;
|
||||
import org.dromara.quality.domain.dto.qualityinspection.QltQualityInspectionUpdateReq;
|
||||
import org.dromara.quality.domain.vo.qualityinspection.QltQualityInspectionListGisVo;
|
||||
import org.dromara.quality.domain.vo.qualityinspection.QltQualityInspectionVo;
|
||||
import org.dromara.quality.service.IQltQualityInspectionService;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@ -42,13 +43,6 @@ public class QltQualityInspectionController extends BaseController {
|
||||
|
||||
private final IBusProjectTeamService busProjectTeamService;
|
||||
|
||||
@PutMapping("/test/add")
|
||||
public R<Boolean> testAdd(QltQualityInspectionUpdateFileReq req) {
|
||||
QltQualityInspection qualityInspection = new QltQualityInspection();
|
||||
BeanUtils.copyProperties(req, qualityInspection);
|
||||
return R.ok(qualityInspectionService.updateById(qualityInspection));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询质量-检查工单列表
|
||||
*/
|
||||
|
||||
@ -13,12 +13,10 @@ import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.safety.domain.HseSafetyInspection;
|
||||
import org.dromara.safety.domain.dto.safetyinspection.*;
|
||||
import org.dromara.safety.domain.vo.safetyinspection.HseSafetyInspectionListGisVo;
|
||||
import org.dromara.safety.domain.vo.safetyinspection.HseSafetyInspectionVo;
|
||||
import org.dromara.safety.service.IHseSafetyInspectionService;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@ -38,13 +36,6 @@ public class HseSafetyInspectionController extends BaseController {
|
||||
|
||||
private final IHseSafetyInspectionService safetyInspectionService;
|
||||
|
||||
@PutMapping("/test/add")
|
||||
public R<Boolean> testAdd(@Validated @RequestBody HseSafetyInspectionUpdateFileReq req) {
|
||||
HseSafetyInspection inspection = new HseSafetyInspection();
|
||||
BeanUtils.copyProperties(req, inspection);
|
||||
return R.ok(safetyInspectionService.updateById(inspection));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询安全巡检工单列表
|
||||
*/
|
||||
|
||||
@ -1,13 +1,12 @@
|
||||
package org.dromara.safety.domain.bo;
|
||||
|
||||
import org.dromara.safety.domain.WgzQuestionBank;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import jakarta.validation.constraints.*;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import org.dromara.safety.domain.WgzQuestionBank;
|
||||
|
||||
/**
|
||||
* 题库业务对象 wgz_question_bank
|
||||
@ -23,7 +22,7 @@ public class WgzQuestionBankBo extends BaseEntity {
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@NotNull(message = "主键ID不能为空", groups = { EditGroup.class })
|
||||
@NotNull(message = "主键ID不能为空", groups = {EditGroup.class})
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
|
||||
@ -1,13 +1,13 @@
|
||||
package org.dromara.safety.domain.bo;
|
||||
|
||||
import org.dromara.safety.domain.WgzQuestionSavePdf;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import jakarta.validation.constraints.*;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import org.dromara.safety.domain.WgzQuestionSavePdf;
|
||||
|
||||
/**
|
||||
* 用户试卷存储pdf业务对象 wgz_question_save_pdf
|
||||
@ -24,22 +24,32 @@ public class WgzQuestionSavePdfBo extends BaseEntity {
|
||||
/**
|
||||
* 主键iD
|
||||
*/
|
||||
@NotNull(message = "主键iD不能为空", groups = { EditGroup.class })
|
||||
@NotNull(message = "主键iD不能为空", groups = {EditGroup.class})
|
||||
private Long id;
|
||||
|
||||
|
||||
/**
|
||||
* 项目ID
|
||||
*/
|
||||
@NotBlank(message = "项目Id", groups = { EditGroup.class })
|
||||
@NotBlank(message = "项目Id", groups = {EditGroup.class})
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
* 1线上 2线下
|
||||
*/
|
||||
@NotBlank(message = "1线上 2线下不能为空", groups = { EditGroup.class })
|
||||
@NotBlank(message = "1线上 2线下不能为空", groups = {EditGroup.class})
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 用户名称
|
||||
*/
|
||||
private String userName;
|
||||
|
||||
/**
|
||||
* 班组id
|
||||
*/
|
||||
private Long teamId;
|
||||
|
||||
/**
|
||||
* 用户主键ID
|
||||
*/
|
||||
|
||||
@ -27,7 +27,6 @@ import org.dromara.common.utils.DocumentUtil;
|
||||
import org.dromara.contractor.domain.SubContractor;
|
||||
import org.dromara.contractor.service.ISubContractorService;
|
||||
import org.dromara.project.domain.BusProjectTeam;
|
||||
import org.dromara.project.domain.BusProjectTeamMember;
|
||||
import org.dromara.project.service.IBusProjectService;
|
||||
import org.dromara.project.service.IBusProjectTeamMemberService;
|
||||
import org.dromara.project.service.IBusProjectTeamService;
|
||||
@ -127,7 +126,7 @@ public class HseSafetyInspectionServiceImpl extends ServiceImpl<HseSafetyInspect
|
||||
@Override
|
||||
public TableDataInfo<HseSafetyInspectionVo> queryPageList(HseSafetyInspectionQueryReq req, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<HseSafetyInspection> lqw = this.buildQueryWrapper(req);
|
||||
lqw.eq(req.getCorrectorId()!= null, HseSafetyInspection::getCorrectorId, req.getCorrectorId());
|
||||
lqw.eq(req.getCorrectorId() != null, HseSafetyInspection::getCorrectorId, req.getCorrectorId());
|
||||
lqw.eq(req.getCreateBy() != null, HseSafetyInspection::getCreateBy, req.getCreateBy());
|
||||
// Long userId = LoginHelper.getUserId();
|
||||
// if (userId != null) {
|
||||
@ -242,6 +241,10 @@ public class HseSafetyInspectionServiceImpl extends ServiceImpl<HseSafetyInspect
|
||||
BeanUtils.copyProperties(req, safetyInspection);
|
||||
// 数据校验
|
||||
validEntityBeforeSave(safetyInspection);
|
||||
// 写入默认值
|
||||
if (req.getCheckTime() == null) {
|
||||
safetyInspection.setCheckTime(new Date());
|
||||
}
|
||||
// 写入数据库
|
||||
safetyInspection.setJobKey(UUID.randomUUID().toString().replace("-", "").substring(0, 16).toUpperCase());
|
||||
boolean save = this.save(safetyInspection);
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package org.dromara.safety.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
||||
@ -10,15 +11,19 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.project.domain.BusProjectTeamMember;
|
||||
import org.dromara.project.service.IBusProjectTeamMemberService;
|
||||
import org.dromara.safety.domain.WgzQuestionSavePdf;
|
||||
import org.dromara.safety.domain.bo.WgzQuestionSavePdfBo;
|
||||
import org.dromara.safety.domain.vo.WgzQuestionSavePdfVo;
|
||||
import org.dromara.safety.mapper.WgzQuestionSavePdfMapper;
|
||||
import org.dromara.safety.service.IWgzQuestionSavePdfService;
|
||||
import org.dromara.system.domain.vo.SysUserVo;
|
||||
import org.dromara.system.service.ISysUserService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@ -34,6 +39,9 @@ public class WgzQuestionSavePdfServiceImpl extends ServiceImpl<WgzQuestionSavePd
|
||||
@Resource
|
||||
private ISysUserService userService;
|
||||
|
||||
@Resource
|
||||
private IBusProjectTeamMemberService projectTeamMemberService;
|
||||
|
||||
@Override
|
||||
public WgzQuestionSavePdf queryById(Long id) {
|
||||
return getById(id);
|
||||
@ -58,12 +66,43 @@ public class WgzQuestionSavePdfServiceImpl extends ServiceImpl<WgzQuestionSavePd
|
||||
LambdaQueryWrapper<WgzQuestionSavePdf> lqw = Wrappers.lambdaQuery();
|
||||
lqw.orderByDesc(WgzQuestionSavePdf::getId);
|
||||
lqw.orderByDesc(WgzQuestionSavePdf::getType);
|
||||
// 关联查询用户名称
|
||||
String userName = bo.getUserName();
|
||||
if (StringUtils.isNotBlank(userName)) {
|
||||
List<Long> userIds = userService.selectUserListByNikeName(userName)
|
||||
.stream()
|
||||
.map(SysUserVo::getUserId)
|
||||
.distinct()
|
||||
.toList();
|
||||
// 如果 userIds 为空,就用一个不会命中的值填充
|
||||
if (CollUtil.isEmpty(userIds)) {
|
||||
userIds = Collections.singletonList(-1L);
|
||||
}
|
||||
lqw.in(WgzQuestionSavePdf::getUserId, userIds);
|
||||
}
|
||||
// 关联查询班组成员
|
||||
Long teamId = bo.getTeamId();
|
||||
if (teamId != null) {
|
||||
List<Long> userIds = projectTeamMemberService.lambdaQuery()
|
||||
.eq(BusProjectTeamMember::getTeamId, teamId)
|
||||
.list()
|
||||
.stream()
|
||||
.map(BusProjectTeamMember::getMemberId)
|
||||
.distinct()
|
||||
.toList();
|
||||
// 如果 userIds 为空,就用一个不会命中的值填充
|
||||
if (CollUtil.isEmpty(userIds)) {
|
||||
userIds = Collections.singletonList(-1L);
|
||||
}
|
||||
lqw.in(WgzQuestionSavePdf::getUserId, userIds);
|
||||
}
|
||||
lqw.eq(bo.getUserId() != null, WgzQuestionSavePdf::getUserId, bo.getUserId());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getPath()), WgzQuestionSavePdf::getPath, bo.getPath());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getPass()), WgzQuestionSavePdf::getPass, bo.getPass());
|
||||
lqw.eq(bo.getTimeOut() != null, WgzQuestionSavePdf::getTimeOut, bo.getTimeOut());
|
||||
lqw.eq(bo.getTakeTime() != null, WgzQuestionSavePdf::getTakeTime, bo.getTakeTime());
|
||||
lqw.eq(bo.getSumScore() != null, WgzQuestionSavePdf::getSumScore, bo.getSumScore());
|
||||
lqw.eq(bo.getProjectId() != null, WgzQuestionSavePdf::getProjectId, bo.getProjectId());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user