安全,质量
This commit is contained in:
@ -26,7 +26,7 @@ snail-job:
|
||||
# 随主应用端口漂移
|
||||
port: 2${server.port}
|
||||
# 客户端ip指定
|
||||
host: 127.0.0.1
|
||||
host: 192.168.110.180
|
||||
# RPC类型: netty, grpc
|
||||
rpc-type: grpc
|
||||
|
||||
|
||||
@ -93,7 +93,7 @@ public class BusReissueCardAppController extends BaseController {
|
||||
/**
|
||||
* 修改补卡申请
|
||||
*/
|
||||
@Log(title = "施工人员补卡申请", businessType = BusinessType.UPDATE)
|
||||
@Log(title = "修改补卡申请", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping("")
|
||||
public R<Void> managerReview(@RequestBody BusReissueCardUpdateReq req) {
|
||||
|
||||
@ -3,6 +3,7 @@ package org.dromara.project.service;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.project.domain.BusProjectTeam;
|
||||
@ -11,6 +12,8 @@ import org.dromara.project.domain.dto.projectteam.BusProjectTeamQueryReq;
|
||||
import org.dromara.project.domain.dto.projectteam.BusProjectTeamUpdateReq;
|
||||
import org.dromara.project.domain.vo.projectteam.BusProjectTeamForemanVo;
|
||||
import org.dromara.project.domain.vo.projectteam.BusProjectTeamVo;
|
||||
import org.dromara.quality.domain.vo.qualityinspection.QltQualityInspectionVo;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
@ -396,11 +396,13 @@ public class BusReissueCardServiceImpl extends ServiceImpl<BusReissueCardMapper,
|
||||
if(BusAttendanceClockStatusEnum.UNCLOCK.getValue().equals(clockStatus)){
|
||||
userSalaryDetailService.insertByAttendance(byId.getUserId(),byId.getClockDate());
|
||||
}
|
||||
chatServerHandler.sendSystemMessageToUser(bean.getUserId(),"补卡申请已通过","1");
|
||||
}
|
||||
if("3".equals(bean.getManagerOpinion())){
|
||||
BusAttendance byId = attendanceService.getById(attendanceId);
|
||||
byId.setHandle("0");
|
||||
attendanceService.updateById(byId);
|
||||
chatServerHandler.sendSystemMessageToUser(bean.getUserId(),"补卡申请未通过","1");
|
||||
}
|
||||
return b;
|
||||
}
|
||||
|
||||
@ -99,4 +99,13 @@ public class QltQualityInspectionAppController extends BaseController {
|
||||
@PathVariable Long projectId) {
|
||||
return R.ok(busProjectTeamService.queryForemanListByProjectId(projectId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据任务号获取整改记录
|
||||
*/
|
||||
@GetMapping("/record/{jobKey}")
|
||||
public R<List<QltQualityInspectionVo>> getRecord(@NotNull(message = "任务批号不能为空")
|
||||
@PathVariable String jobKey) {
|
||||
return R.ok(qualityInspectionService.getRecord(jobKey));
|
||||
}
|
||||
}
|
||||
|
||||
@ -130,4 +130,12 @@ public class QltQualityInspection extends BaseEntity {
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 任务号
|
||||
*/
|
||||
private String jobKey;
|
||||
|
||||
|
||||
private Integer version;
|
||||
|
||||
}
|
||||
|
||||
@ -198,5 +198,10 @@ public class QltQualityInspectionVo implements Serializable {
|
||||
@ExcelProperty(value = "创建时间")
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 任务号
|
||||
*/
|
||||
private String jobKey;
|
||||
|
||||
private Integer version;
|
||||
}
|
||||
|
||||
@ -114,4 +114,8 @@ public interface IQltQualityInspectionService extends IService<QltQualityInspect
|
||||
*/
|
||||
void exportWordById(Long id, HttpServletResponse response);
|
||||
|
||||
/**
|
||||
* 根据任务号获取整改记录
|
||||
*/
|
||||
List<QltQualityInspectionVo> getRecord(String jobKey);
|
||||
}
|
||||
|
||||
@ -2,6 +2,8 @@ package org.dromara.quality.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import jakarta.annotation.Resource;
|
||||
@ -42,6 +44,7 @@ import org.dromara.system.service.ISysDictDataService;
|
||||
import org.dromara.system.service.ISysDictTypeService;
|
||||
import org.dromara.system.service.ISysOssService;
|
||||
import org.dromara.system.service.ISysUserService;
|
||||
import org.dromara.websocket.ChatServerHandler;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.stereotype.Service;
|
||||
@ -84,6 +87,9 @@ public class QltQualityInspectionServiceImpl extends ServiceImpl<QltQualityInspe
|
||||
@Resource
|
||||
private ISysDictTypeService dictTypeService;
|
||||
|
||||
@Resource
|
||||
private ChatServerHandler chatServerHandler;
|
||||
|
||||
/**
|
||||
* 查询质量-检查工单
|
||||
*
|
||||
@ -190,12 +196,19 @@ public class QltQualityInspectionServiceImpl extends ServiceImpl<QltQualityInspe
|
||||
validEntityBeforeSave(qualityInspection);
|
||||
// 填充默认值
|
||||
qualityInspection.setInspectionStatus(QltQualityInspectionStatusEnum.INFORM.getValue());
|
||||
|
||||
qualityInspection.setJobKey(UUID.randomUUID().toString().replace("-", "").substring(0, 16).toUpperCase());
|
||||
// 写入数据库
|
||||
boolean save = this.save(qualityInspection);
|
||||
if (!save) {
|
||||
throw new ServiceException("新增检查工单信息失败,数据库异常", HttpStatus.ERROR);
|
||||
}
|
||||
if (req.getCorrectorId() != null) {
|
||||
String title = "您有新的质量巡检工单,请及时查看!";
|
||||
if (req.getIsReply().equals("1")) {
|
||||
title = "您有新的质量巡检工单需要整改,请及时处理!";
|
||||
}
|
||||
chatServerHandler.sendSystemMessageToUser(req.getCorrectorId(), title, "3");
|
||||
}
|
||||
// 返回新写入的数据
|
||||
return qualityInspection.getId();
|
||||
}
|
||||
@ -218,10 +231,30 @@ public class QltQualityInspectionServiceImpl extends ServiceImpl<QltQualityInspe
|
||||
if (oldQualityInspection == null) {
|
||||
throw new ServiceException("修改检查工单信息失败,数据不存在", HttpStatus.NOT_FOUND);
|
||||
}
|
||||
if ("2".equals(req.getInspectionStatus()) && oldQualityInspection.getCreateBy() != null && oldQualityInspection.getIsReply().equals("1")) {
|
||||
chatServerHandler.sendSystemMessageToUser(oldQualityInspection.getCreateBy(),
|
||||
"质量巡检工单【" + oldQualityInspection.getInspectionHeadline() + "】已整改,请及时复查!", "3");
|
||||
}
|
||||
if("2".equals(req.getVerificationType())){
|
||||
handleFail(oldQualityInspection);
|
||||
}
|
||||
// 操作数据库
|
||||
return this.updateById(qualityInspection);
|
||||
}
|
||||
|
||||
private void handleFail(QltQualityInspection qualityInspection) {
|
||||
|
||||
qualityInspection.setId(null);
|
||||
qualityInspection.setInspectionStatus("2");
|
||||
qualityInspection.setRectificationResult(null);
|
||||
qualityInspection.setRectificationTime(null);
|
||||
qualityInspection.setRectificationFile(null);
|
||||
qualityInspection.setRectificationImgFile(null);
|
||||
qualityInspection.setVersion(qualityInspection.getVersion()+1);
|
||||
save(qualityInspection);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
@ -424,6 +457,16 @@ public class QltQualityInspectionServiceImpl extends ServiceImpl<QltQualityInspe
|
||||
return qualityInspectionVoPage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<QltQualityInspectionVo> getRecord(String jobKey) {
|
||||
List<QltQualityInspection> list = this.list(Wrappers.lambdaQuery(QltQualityInspection.class)
|
||||
.eq(QltQualityInspection::getJobKey, jobKey)
|
||||
.orderByAsc(QltQualityInspection::getCreateTime)
|
||||
);
|
||||
|
||||
return list.stream().map(this::getVo).toList();
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出质量-检查工单
|
||||
*
|
||||
|
||||
@ -9,6 +9,7 @@ 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.quality.domain.vo.qualityinspection.QltQualityInspectionVo;
|
||||
import org.dromara.safety.domain.dto.safetyinspection.HseSafetyInspectionCreateReq;
|
||||
import org.dromara.safety.domain.dto.safetyinspection.HseSafetyInspectionQueryReq;
|
||||
import org.dromara.safety.domain.dto.safetyinspection.HseSafetyInspectionRectificationReq;
|
||||
@ -18,6 +19,8 @@ import org.dromara.safety.service.IHseSafetyInspectionService;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 安全巡检工单 app 接口
|
||||
*
|
||||
@ -79,4 +82,13 @@ public class HseSafetyInspectionAppController extends BaseController {
|
||||
return toAjax(safetyInspectionService.insertReview(req));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据任务号获取整改记录
|
||||
*/
|
||||
@GetMapping("/record/{jobKey}")
|
||||
public R<List<HseSafetyInspectionVo>> getRecord(@NotNull(message = "任务批号不能为空")
|
||||
@PathVariable String jobKey) {
|
||||
return R.ok(safetyInspectionService.getRecord(jobKey));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -140,4 +140,12 @@ public class HseSafetyInspection extends BaseEntity {
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 任务号
|
||||
*/
|
||||
private String jobKey;
|
||||
|
||||
|
||||
private Integer version;
|
||||
|
||||
}
|
||||
|
||||
@ -179,4 +179,11 @@ public class HseSafetyInspectionVo implements Serializable {
|
||||
@Translation(type = TransConstant.USER_ID_TO_NICKNAME, mapper = "createBy")
|
||||
private String creatorName;
|
||||
|
||||
/**
|
||||
* 任务号
|
||||
*/
|
||||
private String jobKey;
|
||||
|
||||
|
||||
private Integer version;
|
||||
}
|
||||
|
||||
@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.quality.domain.vo.qualityinspection.QltQualityInspectionVo;
|
||||
import org.dromara.safety.domain.HseSafetyInspection;
|
||||
import org.dromara.safety.domain.dto.safetyinspection.*;
|
||||
import org.dromara.safety.domain.vo.safetyinspection.HseSafetyInspectionListGisVo;
|
||||
@ -126,4 +127,10 @@ public interface IHseSafetyInspectionService extends IService<HseSafetyInspectio
|
||||
* @return 是否添加成功
|
||||
*/
|
||||
Boolean insertReview(HseSafetyInspectionReviewReq req);
|
||||
|
||||
|
||||
/**
|
||||
* 根据任务号获取整改记录
|
||||
*/
|
||||
List<HseSafetyInspectionVo> getRecord(String jobKey);
|
||||
}
|
||||
|
||||
@ -31,6 +31,7 @@ import org.dromara.project.domain.BusProjectTeamMember;
|
||||
import org.dromara.project.service.IBusProjectService;
|
||||
import org.dromara.project.service.IBusProjectTeamMemberService;
|
||||
import org.dromara.project.service.IBusProjectTeamService;
|
||||
import org.dromara.quality.domain.QltQualityInspection;
|
||||
import org.dromara.safety.constant.HseSafetyConstant;
|
||||
import org.dromara.safety.domain.HseSafetyInspection;
|
||||
import org.dromara.safety.domain.HseTeamMeeting;
|
||||
@ -221,6 +222,7 @@ public class HseSafetyInspectionServiceImpl extends ServiceImpl<HseSafetyInspect
|
||||
// 数据校验
|
||||
validEntityBeforeSave(safetyInspection);
|
||||
// 写入数据库
|
||||
safetyInspection.setJobKey(UUID.randomUUID().toString().replace("-", "").substring(0, 16).toUpperCase());
|
||||
boolean save = this.save(safetyInspection);
|
||||
if (!save) {
|
||||
throw new ServiceException("新增安全巡检工单信息失败,数据库异常", HttpStatus.ERROR);
|
||||
@ -510,10 +512,35 @@ public class HseSafetyInspectionServiceImpl extends ServiceImpl<HseSafetyInspect
|
||||
updateRecord.setId(id);
|
||||
updateRecord.setReviewTime(new Date());
|
||||
updateRecord.setStatus(HseSafetyInspectionStatusEnum.REVIEW.getValue());
|
||||
if("2".equals(req.getReviewType())){
|
||||
handleFail(req.getId());
|
||||
}
|
||||
// 操作数据库
|
||||
return this.updateById(updateRecord);
|
||||
}
|
||||
|
||||
private void handleFail(Long id) {
|
||||
HseSafetyInspection add = this.getById(id);
|
||||
|
||||
add.setId(null);
|
||||
add.setStatus("2");
|
||||
add.setRectificationTime(null);
|
||||
add.setRectificationFile(null);
|
||||
add.setMeasure(null);
|
||||
add.setVersion(add.getVersion()+1);
|
||||
save(add);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HseSafetyInspectionVo> getRecord(String jobKey) {
|
||||
List<HseSafetyInspection> list = this.list(Wrappers.lambdaQuery(HseSafetyInspection.class)
|
||||
.eq(HseSafetyInspection::getJobKey, jobKey)
|
||||
.orderByAsc(HseSafetyInspection::getCreateTime)
|
||||
);
|
||||
|
||||
return list.stream().map(this::getVo).toList();
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据实体获取Word的文本Map
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user