parent
06eeaf07b6
commit
54bebfc937
|
|
@ -113,7 +113,7 @@ public class ProcessController {
|
|||
@DeleteMapping(value = "delProcessById")
|
||||
@DecryptAndVerify(decryptedClass = ProcessDto.class)//加解密统一管理
|
||||
@LogAnnotation(operModul = "工序管理", operation = "删除工序", operDesc = "系统级事件",operType="删除")
|
||||
// @PreAuthorize("@pms.hasPermission('sys:process:update')" )
|
||||
// @PreAuthorize("@pms.hasPermission('sys:process:del')" )
|
||||
public ServerResponse delProcessById(EncryptedReq<ProcessDto> data) {
|
||||
try {
|
||||
ProcessDto bean = data.getData();
|
||||
|
|
|
|||
|
|
@ -0,0 +1,102 @@
|
|||
package com.bonus.imgTool.imgUpload.controller;
|
||||
|
||||
import com.bonus.imgTool.annotation.DecryptAndVerify;
|
||||
import com.bonus.imgTool.annotation.LogAnnotation;
|
||||
import com.bonus.imgTool.imgUpload.service.QualityInspectionService;
|
||||
import com.bonus.imgTool.imgUpload.service.SafetyViolationService;
|
||||
import com.bonus.imgTool.imgUpload.vo.SafetyViolationVo;
|
||||
import com.bonus.imgTool.imgUpload.vo.dto.SafetyViolationDto;
|
||||
import com.bonus.imgTool.system.vo.EncryptedReq;
|
||||
import com.bonus.imgTool.utils.ServerResponse;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author fly
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/imgUpload/qualityInspection/")
|
||||
@Slf4j
|
||||
public class QualityInspectionController {
|
||||
|
||||
@Resource
|
||||
private QualityInspectionService service;
|
||||
|
||||
@GetMapping(value = "getList")
|
||||
@DecryptAndVerify(decryptedClass = SafetyViolationDto.class)//加解密统一管理
|
||||
@LogAnnotation(operModul = "安全违章", operation = "查询列表", operDesc = "系统级事件",operType="查询")
|
||||
// @PreAuthorize("@pms.hasPermission('sys:qualityInspection:query')" )
|
||||
public ServerResponse getList(EncryptedReq<SafetyViolationDto> data) {
|
||||
PageHelper.startPage(data.getData().getPage(), data.getData().getLimit());
|
||||
try {
|
||||
List<SafetyViolationVo> list = service.getList(data.getData());
|
||||
PageInfo<SafetyViolationVo> pageInfo = new PageInfo<>(list);
|
||||
return ServerResponse.createSuccessPage(pageInfo,data.getData().getPage(),data.getData().getLimit());
|
||||
}catch (Exception e){
|
||||
log.error(e.toString(),e);
|
||||
}
|
||||
return ServerResponse.createErrorPage(data.getData().getPage(),data.getData().getLimit());
|
||||
}
|
||||
|
||||
@PostMapping(value = "insertQualityInspection")
|
||||
@DecryptAndVerify(decryptedClass = SafetyViolationDto.class)//加解密统一管理
|
||||
@LogAnnotation(operModul = "安全违章", operation = "新增数据", operDesc = "系统级事件",operType="新增")
|
||||
// @PreAuthorize("@pms.hasPermission('sys:qualityInspection:add')" )
|
||||
public ServerResponse insertQualityInspection(EncryptedReq<SafetyViolationDto> data) {
|
||||
try {
|
||||
SafetyViolationDto bean = data.getData();
|
||||
return service.insertQualityInspection(bean);
|
||||
}catch (Exception e){
|
||||
log.error(e.toString(),e);
|
||||
}
|
||||
return ServerResponse.createErroe("操作失败");
|
||||
}
|
||||
|
||||
@GetMapping(value = "getQualityInspectionById")
|
||||
@DecryptAndVerify(decryptedClass = SafetyViolationDto.class)//加解密统一管理
|
||||
@LogAnnotation(operModul = "安全违章", operation = "查询单个数据", operDesc = "系统级事件",operType="查询")
|
||||
// @PreAuthorize("@pms.hasPermission('sys:qualityInspection:query')" )
|
||||
public ServerResponse getQualityInspectionById(EncryptedReq<SafetyViolationDto> data) {
|
||||
try {
|
||||
SafetyViolationVo safetyViolation = service.getQualityInspectionById(data.getData().getId());
|
||||
return ServerResponse.createSuccess(safetyViolation);
|
||||
}catch (Exception e){
|
||||
log.error(e.toString(),e);
|
||||
}
|
||||
return ServerResponse.createErroe("操作失败");
|
||||
}
|
||||
|
||||
@PostMapping(value = "updateQualityInspectionById")
|
||||
@DecryptAndVerify(decryptedClass = SafetyViolationDto.class)//加解密统一管理
|
||||
@LogAnnotation(operModul = "安全违章", operation = "修改单个数据", operDesc = "系统级事件",operType="修改")
|
||||
// @PreAuthorize("@pms.hasPermission('sys:qualityInspection:update')" )
|
||||
public ServerResponse updateQualityInspectionById(EncryptedReq<SafetyViolationDto> data) {
|
||||
try {
|
||||
SafetyViolationDto bean = data.getData();
|
||||
return service.updateQualityInspectionById(bean);
|
||||
}catch (Exception e){
|
||||
log.error(e.toString(),e);
|
||||
}
|
||||
return ServerResponse.createErroe("操作失败");
|
||||
}
|
||||
|
||||
@DeleteMapping(value = "delQualityInspectionById")
|
||||
@DecryptAndVerify(decryptedClass = SafetyViolationDto.class)//加解密统一管理
|
||||
@LogAnnotation(operModul = "安全违章", operation = "删除违章", operDesc = "系统级事件",operType="删除")
|
||||
// @PreAuthorize("@pms.hasPermission('sys:qualityInspection:del')" )
|
||||
public ServerResponse delQualityInspectionById(EncryptedReq<SafetyViolationDto> data) {
|
||||
try {
|
||||
SafetyViolationDto bean = data.getData();
|
||||
return service.delQualityInspectionById(bean);
|
||||
}catch (Exception e){
|
||||
log.error(e.toString(),e);
|
||||
}
|
||||
return ServerResponse.createErroe("操作失败");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -13,10 +13,7 @@ import com.bonus.imgTool.utils.ServerResponse;
|
|||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
|
|
@ -52,7 +49,7 @@ public class SafetyViolationController {
|
|||
@PostMapping(value = "insertSafetyViolation")
|
||||
@DecryptAndVerify(decryptedClass = SafetyViolationDto.class)//加解密统一管理
|
||||
@LogAnnotation(operModul = "安全违章", operation = "新增数据", operDesc = "系统级事件",operType="新增")
|
||||
// @PreAuthorize("@pms.hasPermission('sys:safetyViolation:query')" )
|
||||
// @PreAuthorize("@pms.hasPermission('sys:safetyViolation:add')" )
|
||||
public ServerResponse insertSafetyViolation(EncryptedReq<SafetyViolationDto> data) {
|
||||
try {
|
||||
SafetyViolationDto bean = data.getData();
|
||||
|
|
@ -80,7 +77,7 @@ public class SafetyViolationController {
|
|||
@PostMapping(value = "updateSafetyViolationById")
|
||||
@DecryptAndVerify(decryptedClass = SafetyViolationDto.class)//加解密统一管理
|
||||
@LogAnnotation(operModul = "安全违章", operation = "修改单个数据", operDesc = "系统级事件",operType="修改")
|
||||
// @PreAuthorize("@pms.hasPermission('sys:safetyViolation:query')" )
|
||||
// @PreAuthorize("@pms.hasPermission('sys:safetyViolation:update')" )
|
||||
public ServerResponse updateSafetyViolationById(EncryptedReq<SafetyViolationDto> data) {
|
||||
try {
|
||||
SafetyViolationDto bean = data.getData();
|
||||
|
|
@ -91,4 +88,18 @@ public class SafetyViolationController {
|
|||
return ServerResponse.createErroe("操作失败");
|
||||
}
|
||||
|
||||
@DeleteMapping(value = "delSafetyViolationById")
|
||||
@DecryptAndVerify(decryptedClass = SafetyViolationDto.class)//加解密统一管理
|
||||
@LogAnnotation(operModul = "安全违章", operation = "删除违章", operDesc = "系统级事件",operType="删除")
|
||||
// @PreAuthorize("@pms.hasPermission('sys:safetyViolation:del')" )
|
||||
public ServerResponse delSafetyViolationById(EncryptedReq<SafetyViolationDto> data) {
|
||||
try {
|
||||
SafetyViolationDto bean = data.getData();
|
||||
return service.delSafetyViolationById(bean);
|
||||
}catch (Exception e){
|
||||
log.error(e.toString(),e);
|
||||
}
|
||||
return ServerResponse.createErroe("操作失败");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,22 @@
|
|||
package com.bonus.imgTool.imgUpload.dao;
|
||||
|
||||
import com.bonus.imgTool.imgUpload.vo.SafetyViolationVo;
|
||||
import com.bonus.imgTool.imgUpload.vo.dto.SafetyViolationDto;
|
||||
import com.bonus.imgTool.system.vo.dto.FileStorageDto;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface QualityInspectionDao {
|
||||
|
||||
List<SafetyViolationVo> getList(SafetyViolationDto data);
|
||||
|
||||
int insertQualityInspection(SafetyViolationDto bean);
|
||||
|
||||
SafetyViolationVo getQualityInspectionById(Long id);
|
||||
|
||||
int updateQualityInspectionById(SafetyViolationDto bean);
|
||||
|
||||
int delQualityInspectionById(SafetyViolationDto bean);
|
||||
}
|
||||
|
|
@ -24,4 +24,8 @@ public interface SafetyViolationDao {
|
|||
int updateSafetyViolationById(SafetyViolationDto bean);
|
||||
|
||||
int delImgPhoto(List<FileStorageDto> delFileList);
|
||||
|
||||
int delImgPhotoBySourceId(FileStorageDto file);
|
||||
|
||||
int delSafetyViolationById(SafetyViolationDto bean);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,22 @@
|
|||
package com.bonus.imgTool.imgUpload.service;
|
||||
|
||||
|
||||
|
||||
import com.bonus.imgTool.imgUpload.vo.SafetyViolationVo;
|
||||
import com.bonus.imgTool.imgUpload.vo.dto.SafetyViolationDto;
|
||||
import com.bonus.imgTool.utils.ServerResponse;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface QualityInspectionService {
|
||||
|
||||
List<SafetyViolationVo> getList(SafetyViolationDto data);
|
||||
|
||||
ServerResponse insertQualityInspection(SafetyViolationDto bean);
|
||||
|
||||
SafetyViolationVo getQualityInspectionById(Long id);
|
||||
|
||||
ServerResponse updateQualityInspectionById(SafetyViolationDto bean);
|
||||
|
||||
ServerResponse delQualityInspectionById(SafetyViolationDto bean);
|
||||
}
|
||||
|
|
@ -18,4 +18,6 @@ public interface SafetyViolationService {
|
|||
SafetyViolationVo getSafetyViolationById(Long id);
|
||||
|
||||
ServerResponse updateSafetyViolationById(SafetyViolationDto bean);
|
||||
|
||||
ServerResponse delSafetyViolationById(SafetyViolationDto bean);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,147 @@
|
|||
package com.bonus.imgTool.imgUpload.service.impl;
|
||||
|
||||
import com.bonus.imgTool.backstage.entity.ComprehensiveQueryVo;
|
||||
import com.bonus.imgTool.backstage.service.SynthesisQueryService;
|
||||
import com.bonus.imgTool.imgUpload.dao.QualityInspectionDao;
|
||||
import com.bonus.imgTool.imgUpload.dao.SafetyViolationDao;
|
||||
import com.bonus.imgTool.imgUpload.service.QualityInspectionService;
|
||||
import com.bonus.imgTool.imgUpload.service.SafetyViolationService;
|
||||
import com.bonus.imgTool.imgUpload.vo.SafetyViolationVo;
|
||||
import com.bonus.imgTool.imgUpload.vo.dto.SafetyViolationDto;
|
||||
import com.bonus.imgTool.system.vo.LoginUser;
|
||||
import com.bonus.imgTool.system.vo.dto.FileStorageDto;
|
||||
import com.bonus.imgTool.utils.ServerResponse;
|
||||
import com.bonus.imgTool.utils.UserUtil;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@Service
|
||||
public class QualityInspectionServiceImpl implements QualityInspectionService {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger("SafetyViolationServiceImpl");
|
||||
|
||||
@Resource
|
||||
private QualityInspectionDao dao;
|
||||
|
||||
@Resource
|
||||
private SafetyViolationDao safetyViolationDao;
|
||||
|
||||
@Resource
|
||||
private SynthesisQueryService synthesisQueryService;
|
||||
|
||||
@Override
|
||||
public List<SafetyViolationVo> getList(SafetyViolationDto data) {
|
||||
return dao.getList(data);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public ServerResponse insertQualityInspection(SafetyViolationDto bean) {
|
||||
LoginUser loginUser = UserUtil.getLoginUser();
|
||||
bean.setCreateUserId(loginUser.getId());
|
||||
bean.setCreateUserName(loginUser.getUsername());
|
||||
//基础数据存入库
|
||||
int i = dao.insertQualityInspection(bean);
|
||||
if (i > 0) {
|
||||
List<FileStorageDto> fileList = bean.getFileList();
|
||||
//照片入库
|
||||
if (fileList != null && !fileList.isEmpty()) {
|
||||
fileList.forEach(item -> {
|
||||
item.setSourceId(bean.getId());
|
||||
item.setCreateUser(bean.getCreateUserId());
|
||||
item.setCreateUserName(bean.getCreateUserName());
|
||||
});
|
||||
int j = safetyViolationDao.insertImgPhoto(bean.getFileList());
|
||||
}
|
||||
//存入总库 TODO
|
||||
ComprehensiveQueryVo comprehensiveQueryVo = new ComprehensiveQueryVo();
|
||||
BeanUtils.copyProperties(bean,comprehensiveQueryVo);
|
||||
synthesisQueryService.addComprehensiveQuery(comprehensiveQueryVo);
|
||||
return ServerResponse.createSuccess("新增成功");
|
||||
}
|
||||
return ServerResponse.createErroe("新增失败");
|
||||
}
|
||||
|
||||
@Override
|
||||
public SafetyViolationVo getQualityInspectionById(Long id) {
|
||||
SafetyViolationVo bean = dao.getQualityInspectionById(id);
|
||||
if(bean != null){
|
||||
//照片查询
|
||||
FileStorageDto fileStorageDto = new FileStorageDto();
|
||||
fileStorageDto.setSourceId(id);
|
||||
fileStorageDto.setSourceType("3");
|
||||
bean.setVioPhotoList(safetyViolationDao.getImgPhotoList(fileStorageDto));
|
||||
fileStorageDto.setSourceType("4");
|
||||
bean.setRectPhotoList(safetyViolationDao.getImgPhotoList(fileStorageDto));
|
||||
}
|
||||
return bean;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ServerResponse updateQualityInspectionById(SafetyViolationDto bean) {
|
||||
LoginUser loginUser = UserUtil.getLoginUser();
|
||||
bean.setUpdateUserId(loginUser.getId());
|
||||
bean.setUpdateUserName(loginUser.getUsername());
|
||||
int num = dao.updateQualityInspectionById(bean);
|
||||
if (num > 0) {
|
||||
List<FileStorageDto> fileList = bean.getFileList();
|
||||
List<FileStorageDto> delFileList = bean.getDelFileList();
|
||||
|
||||
//照片入库
|
||||
if (fileList != null && !fileList.isEmpty()) {
|
||||
fileList.forEach(item -> {
|
||||
item.setSourceId(bean.getId());
|
||||
item.setCreateUser(bean.getUpdateUserId());
|
||||
item.setCreateUserName(bean.getUpdateUserName());
|
||||
});
|
||||
int j = safetyViolationDao.insertImgPhoto(bean.getFileList());
|
||||
}
|
||||
//照片删除
|
||||
if (delFileList != null && !delFileList.isEmpty()) {
|
||||
delFileList.forEach(item -> {
|
||||
item.setSourceId(bean.getId());
|
||||
item.setCreateUser(bean.getUpdateUserId());
|
||||
item.setCreateUserName(bean.getUpdateUserName());
|
||||
});
|
||||
int j = safetyViolationDao.delImgPhoto(bean.getDelFileList());
|
||||
}
|
||||
//总库修改 TODO
|
||||
ComprehensiveQueryVo comprehensiveQueryVo = new ComprehensiveQueryVo();
|
||||
BeanUtils.copyProperties(bean,comprehensiveQueryVo);
|
||||
synthesisQueryService.updateComprehensiveQuery(comprehensiveQueryVo);
|
||||
return ServerResponse.createSuccess("修改成功");
|
||||
} else {
|
||||
|
||||
return ServerResponse.createErroe("修改失败");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ServerResponse delQualityInspectionById(SafetyViolationDto bean) {
|
||||
LoginUser loginUser = UserUtil.getLoginUser();
|
||||
bean.setUpdateUserId(loginUser.getId());
|
||||
bean.setUpdateUserName(loginUser.getUsername());
|
||||
int num= dao.delQualityInspectionById(bean);
|
||||
if(num>0){
|
||||
//照片删除
|
||||
FileStorageDto file = new FileStorageDto();
|
||||
file.setSourceId(bean.getId());
|
||||
file.setUploadType("2");
|
||||
int j = safetyViolationDao.delImgPhotoBySourceId(file);
|
||||
//总库删除 TODO
|
||||
|
||||
return ServerResponse.createSuccess("删除成功",num);
|
||||
}else{
|
||||
return ServerResponse.createErroe("删除失败");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1,5 +1,7 @@
|
|||
package com.bonus.imgTool.imgUpload.service.impl;
|
||||
|
||||
import com.bonus.imgTool.backstage.entity.ComprehensiveQueryVo;
|
||||
import com.bonus.imgTool.backstage.service.SynthesisQueryService;
|
||||
import com.bonus.imgTool.basic.vo.dto.ProDto;
|
||||
import com.bonus.imgTool.imgUpload.dao.SafetyViolationDao;
|
||||
import com.bonus.imgTool.imgUpload.service.SafetyViolationService;
|
||||
|
|
@ -12,6 +14,7 @@ import com.bonus.imgTool.utils.ServerResponse;
|
|||
import com.bonus.imgTool.utils.UserUtil;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
|
|
@ -27,6 +30,9 @@ public class SafetyViolationServiceImpl implements SafetyViolationService {
|
|||
@Resource
|
||||
private SafetyViolationDao dao;
|
||||
|
||||
@Resource
|
||||
private SynthesisQueryService synthesisQueryService;
|
||||
|
||||
@Override
|
||||
public List<SafetyViolationVo> getList(SafetyViolationDto data) {
|
||||
return dao.getList(data);
|
||||
|
|
@ -43,7 +49,7 @@ public class SafetyViolationServiceImpl implements SafetyViolationService {
|
|||
if (i > 0) {
|
||||
List<FileStorageDto> fileList = bean.getFileList();
|
||||
//照片入库
|
||||
if (!fileList.isEmpty()) {
|
||||
if (fileList != null && !fileList.isEmpty()) {
|
||||
fileList.forEach(item -> {
|
||||
item.setSourceId(bean.getId());
|
||||
item.setCreateUser(bean.getCreateUserId());
|
||||
|
|
@ -52,7 +58,9 @@ public class SafetyViolationServiceImpl implements SafetyViolationService {
|
|||
int j = dao.insertImgPhoto(bean.getFileList());
|
||||
}
|
||||
//存入总库 TODO
|
||||
|
||||
ComprehensiveQueryVo comprehensiveQueryVo = new ComprehensiveQueryVo();
|
||||
BeanUtils.copyProperties(bean,comprehensiveQueryVo);
|
||||
synthesisQueryService.addComprehensiveQuery(comprehensiveQueryVo);
|
||||
return ServerResponse.createSuccess("新增成功");
|
||||
}
|
||||
return ServerResponse.createErroe("新增失败");
|
||||
|
|
@ -70,7 +78,6 @@ public class SafetyViolationServiceImpl implements SafetyViolationService {
|
|||
fileStorageDto.setSourceType("2");
|
||||
bean.setRectPhotoList(dao.getImgPhotoList(fileStorageDto));
|
||||
}
|
||||
|
||||
return bean;
|
||||
}
|
||||
|
||||
|
|
@ -85,7 +92,7 @@ public class SafetyViolationServiceImpl implements SafetyViolationService {
|
|||
List<FileStorageDto> delFileList = bean.getDelFileList();
|
||||
|
||||
//照片入库
|
||||
if (!fileList.isEmpty()) {
|
||||
if (fileList != null && !fileList.isEmpty()) {
|
||||
fileList.forEach(item -> {
|
||||
item.setSourceId(bean.getId());
|
||||
item.setCreateUser(bean.getUpdateUserId());
|
||||
|
|
@ -97,7 +104,7 @@ public class SafetyViolationServiceImpl implements SafetyViolationService {
|
|||
|
||||
|
||||
//照片删除
|
||||
if (!delFileList.isEmpty()) {
|
||||
if (delFileList != null && !delFileList.isEmpty()) {
|
||||
delFileList.forEach(item -> {
|
||||
item.setSourceId(bean.getId());
|
||||
item.setCreateUser(bean.getUpdateUserId());
|
||||
|
|
@ -106,7 +113,9 @@ public class SafetyViolationServiceImpl implements SafetyViolationService {
|
|||
int j = dao.delImgPhoto(bean.getDelFileList());
|
||||
}
|
||||
//总库修改 TODO
|
||||
|
||||
ComprehensiveQueryVo comprehensiveQueryVo = new ComprehensiveQueryVo();
|
||||
BeanUtils.copyProperties(bean,comprehensiveQueryVo);
|
||||
synthesisQueryService.updateComprehensiveQuery(comprehensiveQueryVo);
|
||||
return ServerResponse.createSuccess("修改成功");
|
||||
} else {
|
||||
|
||||
|
|
@ -114,5 +123,25 @@ public class SafetyViolationServiceImpl implements SafetyViolationService {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ServerResponse delSafetyViolationById(SafetyViolationDto bean) {
|
||||
LoginUser loginUser = UserUtil.getLoginUser();
|
||||
bean.setUpdateUserId(loginUser.getId());
|
||||
bean.setUpdateUserName(loginUser.getUsername());
|
||||
int num= dao.delSafetyViolationById(bean);
|
||||
if(num>0){
|
||||
//照片删除
|
||||
FileStorageDto file = new FileStorageDto();
|
||||
file.setSourceId(bean.getId());
|
||||
file.setUploadType("1");
|
||||
int j = dao.delImgPhotoBySourceId(file);
|
||||
//总库删除 TODO
|
||||
|
||||
return ServerResponse.createSuccess("删除成功",num);
|
||||
}else{
|
||||
return ServerResponse.createErroe("删除失败");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ public class SafetyViolationVo extends PageEntity {
|
|||
/**
|
||||
* id
|
||||
*/
|
||||
private long id;
|
||||
private Long id;
|
||||
/**
|
||||
* 是否可用 1.可用 0.不可用
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -123,5 +123,7 @@ public class SafetyViolationDto extends PageEntity {
|
|||
|
||||
private String keyWord;
|
||||
|
||||
private String proStatus;
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -88,6 +88,19 @@ public class SelectController {
|
|||
return ServerResponse.createErroe("操作失败");
|
||||
}
|
||||
|
||||
@GetMapping(value = "getDictSelectByType")
|
||||
@DecryptAndVerify(decryptedClass = SelectDto.class)//加解密统一管理
|
||||
@LogAnnotation(operModul = "字典管理", operation = "查询列表", operDesc = "系统级事件",operType="查询")
|
||||
public ServerResponse getDictSelectByType(EncryptedReq<SelectDto> data) {
|
||||
try {
|
||||
List<SelectVo> list = service.getDictSelectByType(data.getData());
|
||||
return ServerResponse.createSuccess(list);
|
||||
}catch (Exception e){
|
||||
log.error(e.toString(),e);
|
||||
}
|
||||
return ServerResponse.createErroe("操作失败");
|
||||
}
|
||||
|
||||
|
||||
private void setDictsList(Long pId, List<Dict> dictsAll, List<Dict> list) {
|
||||
for (Dict bean : dictsAll) {
|
||||
|
|
|
|||
|
|
@ -42,4 +42,6 @@ public interface SelectDao {
|
|||
* @date 2025/4/3 13:53
|
||||
*/
|
||||
List<SelectVo> getGxsSelect(QueryParamDto dto);
|
||||
|
||||
List<SelectVo> getDictSelectByType(SelectDto data);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,6 +19,8 @@ public interface SelectService {
|
|||
|
||||
List<SelectVo> getProjectSelect(SelectDto data);
|
||||
|
||||
List<SelectVo> getDictSelectByType(SelectDto data);
|
||||
|
||||
/**
|
||||
* 工程下拉选-按权限划分
|
||||
* @param data
|
||||
|
|
|
|||
|
|
@ -91,4 +91,9 @@ public class SelectServiceImpl implements SelectService {
|
|||
return ServerResponse.createErroe("查询失败");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SelectVo> getDictSelectByType(SelectDto data) {
|
||||
return dao.getDictSelectByType(data);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,189 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.bonus.imgTool.imgUpload.dao.QualityInspectionDao">
|
||||
|
||||
<insert id="insertQualityInspection" useGeneratedKeys="true" keyProperty="id" keyColumn="id">
|
||||
INSERT INTO tb_quality_inspection
|
||||
(
|
||||
pro_id,
|
||||
pro_name,
|
||||
major_id,
|
||||
major_name,
|
||||
gx_id,
|
||||
gx_name,
|
||||
check_user_name,
|
||||
check_date,
|
||||
check_place,
|
||||
check_desc,
|
||||
rect_date,
|
||||
rect_user_name,
|
||||
rect_time,
|
||||
rect_desc,
|
||||
rect_status,
|
||||
data_source,
|
||||
create_user_id,
|
||||
create_user_name,
|
||||
create_time
|
||||
)values (
|
||||
#{proId},
|
||||
#{proName},
|
||||
#{majorId},
|
||||
#{majorName},
|
||||
#{gxId},
|
||||
#{gxName},
|
||||
#{checkUserName},
|
||||
#{vioDate},
|
||||
#{vioPlace},
|
||||
#{vioDesc},
|
||||
#{rectDate},
|
||||
#{rectUserName},
|
||||
#{rectTime},
|
||||
#{rectDesc},
|
||||
#{rectStatus},
|
||||
#{dataSource},
|
||||
#{createUserId},
|
||||
#{createUserName},
|
||||
#{createTime}
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="updateQualityInspectionById">
|
||||
UPDATE tb_quality_inspection
|
||||
<set>
|
||||
<if test="proId != null">
|
||||
pro_id = #{proId},
|
||||
</if>
|
||||
<if test="proName != null">
|
||||
pro_name = #{proName},
|
||||
</if>
|
||||
<if test="majorId != null">
|
||||
major_id = #{majorId},
|
||||
</if>
|
||||
<if test="majorName != null">
|
||||
major_name = #{majorName},
|
||||
</if>
|
||||
<if test="gxId != null">
|
||||
gx_id = #{gxId},
|
||||
</if>
|
||||
<if test="gxName != null">
|
||||
gx_name = #{gxName},
|
||||
</if>
|
||||
<if test="checkUserName != null">
|
||||
check_user_name = #{checkUserName},
|
||||
</if>
|
||||
<if test="vioDate != null">
|
||||
check_date = #{vioDate},
|
||||
</if>
|
||||
<if test="vioPlace != null">
|
||||
check_place = #{vioPlace},
|
||||
</if>
|
||||
<if test="vioDesc != null">
|
||||
check_desc = #{vioDesc},
|
||||
</if>
|
||||
<if test="rectDate != null">
|
||||
rect_date = #{rectDate},
|
||||
</if>
|
||||
<if test="rectUserName != null">
|
||||
rect_user_name = #{rectUserName},
|
||||
</if>
|
||||
<if test="rectTime != null">
|
||||
rect_time = #{rectTime},
|
||||
</if>
|
||||
<if test="rectDesc != null">
|
||||
rect_desc = #{rectDesc},
|
||||
</if>
|
||||
<if test="rectStatus != null">
|
||||
rect_status = #{rectStatus},
|
||||
</if>
|
||||
<if test="dataSource != null">
|
||||
data_source = #{dataSource},
|
||||
</if>
|
||||
<if test="updateUserId != null">
|
||||
update_user_id = #{updateUserId},
|
||||
</if>
|
||||
<if test="updateUserName != null">
|
||||
update_user_name = #{updateUserName}
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="delQualityInspectionById">
|
||||
update tb_quality_inspection set is_active = '0'
|
||||
WHERE id = #{id}
|
||||
</delete>
|
||||
|
||||
<select id="getList" resultType="com.bonus.imgTool.imgUpload.vo.SafetyViolationVo">
|
||||
SELECT
|
||||
tsv.id,
|
||||
tsv.pro_id,
|
||||
tsv.pro_name,
|
||||
tsv.major_id,
|
||||
tsv.major_name,
|
||||
tsv.gx_id,
|
||||
tsv.gx_name,
|
||||
tsv.check_user_name,
|
||||
tsv.check_date as vioDate,
|
||||
tsv.check_place as vioPlace,
|
||||
tsv.check_desc as vioDesc,
|
||||
tsv.rect_date,
|
||||
tsv.rect_user_name,
|
||||
tsv.rect_time,
|
||||
tsv.rect_desc,
|
||||
tsv.rect_status,
|
||||
tsv.data_source,
|
||||
count(DISTINCT sfr.id) as vioPhotoNum,
|
||||
count(DISTINCT sfr2.id) as rectPhotoNum
|
||||
FROM
|
||||
tb_quality_inspection tsv
|
||||
LEFT JOIN sys_file_resource sfr ON sfr.source_id = tsv.id
|
||||
AND sfr.source_type = '1' and sfr.is_active = '1'
|
||||
LEFT JOIN sys_file_resource sfr2 ON sfr2.source_id = tsv.id
|
||||
AND sfr2.source_type = '2' and sfr2.is_active = '1'
|
||||
left join tb_project tp on tp.id = tsv.pro_id and tp.is_active = '1'
|
||||
<where>
|
||||
tsv.is_active = '1'
|
||||
<if test="proId != null">
|
||||
and tsv.pro_id = #{proId}
|
||||
</if>
|
||||
<if test="proType != null and proType != ''">
|
||||
and tp.pro_type = #{proType}
|
||||
</if>
|
||||
<if test="gxId != null">
|
||||
and tsv.gx_id = #{gxId}
|
||||
</if>
|
||||
<if test="proType != null and proType != ''">
|
||||
and tp.pro_type = #{proType}
|
||||
</if>
|
||||
<if test="proStatus != null and proStatus != ''">
|
||||
and tp.status = #{proStatus}
|
||||
</if>
|
||||
</where>
|
||||
GROUP BY tsv.id
|
||||
</select>
|
||||
<select id="getQualityInspectionById" resultType="com.bonus.imgTool.imgUpload.vo.SafetyViolationVo">
|
||||
SELECT
|
||||
tsv.id,
|
||||
tsv.pro_id,
|
||||
tsv.pro_name,
|
||||
tsv.major_id,
|
||||
tsv.major_name,
|
||||
tsv.gx_id,
|
||||
tsv.gx_name,
|
||||
tsv.check_user_name,
|
||||
tsv.check_date as vioDate,
|
||||
tsv.check_place as vioPlace,
|
||||
tsv.check_desc as vioDesc,
|
||||
tsv.rect_date,
|
||||
tsv.rect_user_name,
|
||||
tsv.rect_time,
|
||||
tsv.rect_desc,
|
||||
tsv.rect_status,
|
||||
tsv.data_source
|
||||
FROM
|
||||
tb_quality_inspection tsv
|
||||
WHERE tsv.id = #{id}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -142,14 +142,27 @@
|
|||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="delImgPhoto">
|
||||
update sys_file_resource set is_active = '0'
|
||||
WHERE id IN
|
||||
WHERE
|
||||
id IN
|
||||
<foreach collection="delFileList" item="item" separator=",">
|
||||
#{item.id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<delete id="delImgPhotoBySourceId">
|
||||
update sys_file_resource set is_active = '0'
|
||||
WHERE
|
||||
source_id = #{sourceId}
|
||||
AND upload_type = #{uploadType}
|
||||
</delete>
|
||||
|
||||
<delete id="delSafetyViolationById">
|
||||
update tb_safety_violations set is_active = '0'
|
||||
WHERE id = #{id}
|
||||
</delete>
|
||||
|
||||
<select id="getList" resultType="com.bonus.imgTool.imgUpload.vo.SafetyViolationVo">
|
||||
SELECT
|
||||
|
|
@ -175,12 +188,26 @@
|
|||
FROM
|
||||
tb_safety_violations tsv
|
||||
LEFT JOIN sys_file_resource sfr ON sfr.source_id = tsv.id
|
||||
AND sfr.source_type = '1'
|
||||
AND sfr.source_type = '1' and sfr.is_active = '1'
|
||||
LEFT JOIN sys_file_resource sfr2 ON sfr2.source_id = tsv.id
|
||||
AND sfr2.source_type = '2'
|
||||
AND sfr2.source_type = '2' and sfr2.is_active = '1'
|
||||
left join tb_project tp on tp.id = tsv.pro_id and tp.is_active = '1'
|
||||
<where>
|
||||
<if test="keyWord != null and keyWord != ''">
|
||||
and locate(#{keyWord},pro_name)
|
||||
tsv.is_active = '1'
|
||||
<if test="proId != null">
|
||||
and tsv.pro_id = #{proId}
|
||||
</if>
|
||||
<if test="proType != null and proType != ''">
|
||||
and tp.pro_type = #{proType}
|
||||
</if>
|
||||
<if test="gxId != null">
|
||||
and tsv.gx_id = #{gxId}
|
||||
</if>
|
||||
<if test="proType != null and proType != ''">
|
||||
and tp.pro_type = #{proType}
|
||||
</if>
|
||||
<if test="proStatus != null and proStatus != ''">
|
||||
and tp.status = #{proStatus}
|
||||
</if>
|
||||
</where>
|
||||
GROUP BY tsv.id
|
||||
|
|
|
|||
|
|
@ -24,12 +24,12 @@
|
|||
|
||||
<select id="getProfessionSelect" resultType="com.bonus.imgTool.system.vo.SelectVo">
|
||||
select
|
||||
t.id,
|
||||
t.dict_value as id,
|
||||
t.dict_name as name
|
||||
from sys_distinct t
|
||||
where p_id in (
|
||||
select id from sys_distinct where dict_code = 'profession'
|
||||
)
|
||||
) and t.del_flag = 0
|
||||
</select>
|
||||
<select id="getProcessSelect" resultType="com.bonus.imgTool.system.vo.SelectVo">
|
||||
select
|
||||
|
|
@ -37,7 +37,7 @@
|
|||
t.gx_name as name
|
||||
from tb_gx t
|
||||
<where>
|
||||
major_id = #{pid}
|
||||
major_id = #{pid} and is_active = '1'
|
||||
</where>
|
||||
</select>
|
||||
<select id="getProjectSelect" resultType="com.bonus.imgTool.system.vo.SelectVo">
|
||||
|
|
@ -78,5 +78,14 @@
|
|||
</where>
|
||||
</select>
|
||||
|
||||
<select id="getDictSelectByType" resultType="com.bonus.imgTool.system.vo.SelectVo">
|
||||
select t.dict_value as id,
|
||||
t.dict_name as name
|
||||
from sys_distinct t
|
||||
where t.del_flag = 0
|
||||
and t.p_id = (select id from sys_distinct where dict_code = #{code})
|
||||
order by t.dict_sort
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
|
|
|
|||
Loading…
Reference in New Issue