协调照片
This commit is contained in:
parent
2d0ab27e27
commit
6b9d5de37e
|
|
@ -0,0 +1,77 @@
|
|||
package com.bonus.imgTool.imageUpload.controller;
|
||||
|
||||
|
||||
import com.bonus.imgTool.annotation.DecryptAndVerify;
|
||||
import com.bonus.imgTool.annotation.LogAnnotation;
|
||||
import com.bonus.imgTool.imageUpload.dto.CoordinatePhotoReqVo;
|
||||
import com.bonus.imgTool.imageUpload.dto.CoordinatePhotoVo;
|
||||
import com.bonus.imgTool.imageUpload.service.CoordinatePhotoService;
|
||||
import com.bonus.imgTool.system.vo.EncryptedReq;
|
||||
import com.bonus.imgTool.utils.ServerResponse;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 协调照片
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/coordinatePhoto")
|
||||
public class CoordinatePhotoController {
|
||||
|
||||
|
||||
@Resource
|
||||
private CoordinatePhotoService coordinatePhotoService;
|
||||
|
||||
/**
|
||||
* 协调照片--查询
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/getCoordinatePhotoList")
|
||||
@DecryptAndVerify(decryptedClass = CoordinatePhotoReqVo.class)
|
||||
@LogAnnotation(operModul = "安全措施落实-查询", operation = "查询照片", operDesc = "系统级事件",operType="查询")
|
||||
public ServerResponse getCoordinatePhotoList(EncryptedReq<CoordinatePhotoReqVo> data) {
|
||||
return coordinatePhotoService.getCoordinatePhotoList(data.getData());
|
||||
}
|
||||
|
||||
/**
|
||||
* 协调照片--删除
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/deleteCoordinatePhoto")
|
||||
@DecryptAndVerify(decryptedClass = CoordinatePhotoReqVo.class)
|
||||
@LogAnnotation(operModul = "协调照片--删除", operation = "查询照片", operDesc = "系统级事件",operType="查询")
|
||||
public ServerResponse deleteCoordinatePhoto(EncryptedReq<CoordinatePhotoReqVo> data) {
|
||||
return coordinatePhotoService.deleteCoordinatePhoto(data.getData());
|
||||
}
|
||||
|
||||
/**
|
||||
* 协调照片--新增
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/addCoordinatePhoto")
|
||||
@DecryptAndVerify(decryptedClass = CoordinatePhotoVo.class)
|
||||
@LogAnnotation(operModul = "协调照片--新增", operation = "查询照片", operDesc = "系统级事件",operType="查询")
|
||||
public ServerResponse addCoordinatePhoto(EncryptedReq<CoordinatePhotoVo> data) {
|
||||
return coordinatePhotoService.addCoordinatePhoto(data.getData());
|
||||
}
|
||||
|
||||
/**
|
||||
* 协调照片--修改
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/updateCoordinatePhoto")
|
||||
@DecryptAndVerify(decryptedClass = CoordinatePhotoVo.class)
|
||||
@LogAnnotation(operModul = "协调照片--修改", operation = "查询照片", operDesc = "系统级事件",operType="查询")
|
||||
public ServerResponse updateCoordinatePhoto(EncryptedReq<CoordinatePhotoVo> data) {
|
||||
return coordinatePhotoService.updateCoordinatePhoto(data.getData());
|
||||
}
|
||||
}
|
||||
|
|
@ -2,7 +2,6 @@ package com.bonus.imgTool.imageUpload.controller;
|
|||
|
||||
import com.bonus.imgTool.annotation.DecryptAndVerify;
|
||||
import com.bonus.imgTool.annotation.LogAnnotation;
|
||||
import com.bonus.imgTool.backstage.entity.QueryParamDto;
|
||||
import com.bonus.imgTool.imageUpload.dto.SafetyMeasuresReqVo;
|
||||
import com.bonus.imgTool.imageUpload.dto.SafetyMeasuresVo;
|
||||
import com.bonus.imgTool.imageUpload.service.SafetyMeasuresService;
|
||||
|
|
@ -62,4 +61,15 @@ public class SafetyMeasuresController {
|
|||
public ServerResponse addSafetyMeasures(EncryptedReq<SafetyMeasuresVo> data) {
|
||||
return safetyMeasuresService.addSafetyMeasures(data.getData());
|
||||
}
|
||||
/**
|
||||
* 安全措施落实修改
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/updateSafetyMeasures")
|
||||
@DecryptAndVerify(decryptedClass = SafetyMeasuresVo.class)
|
||||
@LogAnnotation(operModul = "安全措施落实-修改", operation = "查询照片", operDesc = "系统级事件",operType="查询")
|
||||
public ServerResponse updateSafetyMeasures(EncryptedReq<SafetyMeasuresVo> data) {
|
||||
return safetyMeasuresService.updateSafetyMeasures(data.getData());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,35 @@
|
|||
package com.bonus.imgTool.imageUpload.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class CoordinatePhotoReqVo {
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 工程id
|
||||
*/
|
||||
private Long proId;
|
||||
|
||||
/**
|
||||
* 专业id
|
||||
*/
|
||||
private Long majorId;
|
||||
|
||||
/**
|
||||
* 工序id
|
||||
*/
|
||||
private Long gxId;
|
||||
|
||||
/**
|
||||
* 关键字
|
||||
*/
|
||||
private String keyWord;
|
||||
|
||||
private int pageNum = 1;
|
||||
private int pageSize = 15;
|
||||
}
|
||||
|
|
@ -0,0 +1,106 @@
|
|||
package com.bonus.imgTool.imageUpload.dto;
|
||||
|
||||
import com.bonus.imgTool.system.vo.SysFileResourceVo;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class CoordinatePhotoVo {
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 工程id
|
||||
*/
|
||||
private Long proId;
|
||||
|
||||
/**
|
||||
* 工程名称
|
||||
*/
|
||||
private String proName;
|
||||
|
||||
/**
|
||||
* 专业id
|
||||
*/
|
||||
private Long majorId;
|
||||
|
||||
/**
|
||||
* 专业名称
|
||||
*/
|
||||
private String majorName;
|
||||
|
||||
/**
|
||||
* 工序id
|
||||
*/
|
||||
private Long gxId;
|
||||
|
||||
/**
|
||||
* 工序名称
|
||||
*/
|
||||
private String gxName;
|
||||
|
||||
/**
|
||||
* 建设地点
|
||||
*/
|
||||
private String buildPlace;
|
||||
|
||||
/**
|
||||
* 建设前描述
|
||||
*/
|
||||
private String buildBeforeDesc;
|
||||
|
||||
/**
|
||||
* 建设中描述
|
||||
*/
|
||||
private String buildUnderDesc;
|
||||
|
||||
/**
|
||||
* 恢复后描述
|
||||
*/
|
||||
private String buildAfterDesc;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private Long createUserId;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 创建人姓名
|
||||
*/
|
||||
private String createUserName;
|
||||
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
private Long updateUserId;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 修改人姓名
|
||||
*/
|
||||
private String updateUserName;
|
||||
|
||||
/**
|
||||
* 数据来源 1.web 2.app
|
||||
*/
|
||||
private String dataSource;
|
||||
|
||||
/**
|
||||
* 图片信息
|
||||
*/
|
||||
private List<SysFileResourceVo> sysFileResourceList;
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
package com.bonus.imgTool.imageUpload.mapper;
|
||||
|
||||
import com.bonus.imgTool.imageUpload.dto.CoordinatePhotoReqVo;
|
||||
import com.bonus.imgTool.imageUpload.dto.CoordinatePhotoVo;
|
||||
import java.util.List;
|
||||
|
||||
public interface CoordinatePhotoMapper {
|
||||
|
||||
List<CoordinatePhotoVo> getCoordinatePhotoList(CoordinatePhotoReqVo data);
|
||||
|
||||
void deleteCoordinatePhoto(CoordinatePhotoReqVo data);
|
||||
|
||||
void addCoordinatePhoto(CoordinatePhotoVo data);
|
||||
|
||||
void updateCoordinatePhoto(CoordinatePhotoVo data);
|
||||
}
|
||||
|
|
@ -12,4 +12,6 @@ public interface SafetyMeasuresMapper {
|
|||
|
||||
|
||||
void addSafetyMeasures(SafetyMeasuresVo data);
|
||||
|
||||
void updateSafetyMeasures(SafetyMeasuresVo data);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,15 @@
|
|||
package com.bonus.imgTool.imageUpload.service;
|
||||
|
||||
import com.bonus.imgTool.imageUpload.dto.CoordinatePhotoReqVo;
|
||||
import com.bonus.imgTool.imageUpload.dto.CoordinatePhotoVo;
|
||||
import com.bonus.imgTool.utils.ServerResponse;
|
||||
|
||||
public interface CoordinatePhotoService {
|
||||
ServerResponse getCoordinatePhotoList(CoordinatePhotoReqVo data);
|
||||
|
||||
ServerResponse deleteCoordinatePhoto(CoordinatePhotoReqVo data);
|
||||
|
||||
ServerResponse addCoordinatePhoto(CoordinatePhotoVo data);
|
||||
|
||||
ServerResponse updateCoordinatePhoto(CoordinatePhotoVo data);
|
||||
}
|
||||
|
|
@ -10,4 +10,6 @@ public interface SafetyMeasuresService {
|
|||
ServerResponse deleteSafetyMeasures(SafetyMeasuresReqVo data);
|
||||
|
||||
ServerResponse addSafetyMeasures(SafetyMeasuresVo data);
|
||||
|
||||
ServerResponse updateSafetyMeasures(SafetyMeasuresVo data);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,113 @@
|
|||
package com.bonus.imgTool.imageUpload.service.impl;
|
||||
|
||||
|
||||
import com.bonus.imgTool.imageUpload.dto.CoordinatePhotoReqVo;
|
||||
import com.bonus.imgTool.imageUpload.dto.CoordinatePhotoVo;
|
||||
import com.bonus.imgTool.imageUpload.mapper.CoordinatePhotoMapper;
|
||||
import com.bonus.imgTool.imageUpload.service.CoordinatePhotoService;
|
||||
import com.bonus.imgTool.system.service.SysFileResourceService;
|
||||
import com.bonus.imgTool.system.vo.SysFileResourceVo;
|
||||
import com.bonus.imgTool.utils.ServerResponse;
|
||||
import com.bonus.imgTool.utils.UserUtil;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
@Slf4j
|
||||
@Transactional
|
||||
public class CoordinatePhotoServiceImpl implements CoordinatePhotoService {
|
||||
|
||||
@Resource
|
||||
private CoordinatePhotoMapper coordinatePhotoMapper;
|
||||
|
||||
@Resource
|
||||
private SysFileResourceService sysFileResourceService;
|
||||
|
||||
/**
|
||||
* 协调照片--查询
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public ServerResponse getCoordinatePhotoList(CoordinatePhotoReqVo data) {
|
||||
PageHelper.startPage(data.getPageNum(), data.getPageSize());
|
||||
try {
|
||||
List<CoordinatePhotoVo> list = coordinatePhotoMapper.getCoordinatePhotoList(data);
|
||||
//获取图片信息
|
||||
for (CoordinatePhotoVo coordinatePhotoVo : list) {
|
||||
List<SysFileResourceVo> sysFileResourceList = sysFileResourceService.getSysFileResourceList(coordinatePhotoVo.getId());
|
||||
coordinatePhotoVo.setSysFileResourceList(sysFileResourceList);
|
||||
}
|
||||
PageInfo<CoordinatePhotoVo> pageInfo = new PageInfo<>(list);
|
||||
return ServerResponse.createSuccess(pageInfo);
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
return ServerResponse.createErroe("查询失败");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 协调照片--删除
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public ServerResponse deleteCoordinatePhoto(CoordinatePhotoReqVo data) {
|
||||
try {
|
||||
coordinatePhotoMapper.deleteCoordinatePhoto(data);
|
||||
sysFileResourceService.deleteFileResource(data.getId());
|
||||
return ServerResponse.createSuccess();
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
return ServerResponse.createErroe("删除失败");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ServerResponse addCoordinatePhoto(CoordinatePhotoVo data) {
|
||||
try {
|
||||
//保存
|
||||
coordinatePhotoMapper.addCoordinatePhoto(data);
|
||||
//保存附件
|
||||
List<SysFileResourceVo> sysFileResourceList = data.getSysFileResourceList();
|
||||
for (SysFileResourceVo sysFileResourceVo: sysFileResourceList ) {
|
||||
Long CreateUserId = UserUtil.getLoginUser() != null ? UserUtil.getLoginUser().getId() : 0;
|
||||
String CreateUserName = UserUtil.getLoginUser() != null ? UserUtil.getLoginUser().getNewUser(): null;
|
||||
sysFileResourceService.addSysFileResource(sysFileResourceVo,data.getId(),"4",CreateUserId,CreateUserName);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
return ServerResponse.createErroe("删除失败");
|
||||
}
|
||||
return ServerResponse.createSuccess();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ServerResponse updateCoordinatePhoto(CoordinatePhotoVo data) {
|
||||
try {
|
||||
//修改
|
||||
coordinatePhotoMapper.updateCoordinatePhoto(data);
|
||||
//附件先删除,后新增
|
||||
sysFileResourceService.deleteFileResource(data.getId());
|
||||
//保存附件
|
||||
List<SysFileResourceVo> sysFileResourceList = data.getSysFileResourceList();
|
||||
for (SysFileResourceVo sysFileResourceVo: sysFileResourceList ) {
|
||||
Long CreateUserId = UserUtil.getLoginUser() != null ? UserUtil.getLoginUser().getId() : 0;
|
||||
String CreateUserName = UserUtil.getLoginUser() != null ? UserUtil.getLoginUser().getNewUser(): null;
|
||||
sysFileResourceService.addSysFileResource(sysFileResourceVo,data.getId(),"4",CreateUserId,CreateUserName);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
return ServerResponse.createErroe("修改失败");
|
||||
}
|
||||
return ServerResponse.createSuccess();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1,12 +1,11 @@
|
|||
package com.bonus.imgTool.imageUpload.service.impl;
|
||||
|
||||
import com.bonus.imgTool.Enum.FileSourceTypeEnum;
|
||||
import com.bonus.imgTool.backstage.entity.SynthesisQueryVo;
|
||||
import com.bonus.imgTool.imageUpload.dto.SafetyMeasuresReqVo;
|
||||
import com.bonus.imgTool.imageUpload.dto.SafetyMeasuresVo;
|
||||
import com.bonus.imgTool.imageUpload.mapper.SafetyMeasuresMapper;
|
||||
import com.bonus.imgTool.imageUpload.service.SafetyMeasuresService;
|
||||
import com.bonus.imgTool.system.dao.SysFileResourceDao;
|
||||
import com.bonus.imgTool.system.service.SysFileResourceService;
|
||||
import com.bonus.imgTool.system.vo.SysFileResourceVo;
|
||||
import com.bonus.imgTool.utils.ServerResponse;
|
||||
import com.bonus.imgTool.utils.UserUtil;
|
||||
|
|
@ -17,9 +16,7 @@ import org.springframework.stereotype.Service;
|
|||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
@Slf4j
|
||||
@Service
|
||||
|
|
@ -30,7 +27,7 @@ public class SafetyMeasuresServiceImpl implements SafetyMeasuresService {
|
|||
private SafetyMeasuresMapper safetyMeasuresMapper;
|
||||
|
||||
@Resource
|
||||
private SysFileResourceDao sysFileResourceDao;
|
||||
private SysFileResourceService sysFileResourceService;
|
||||
|
||||
/**
|
||||
* 安全措施落实获取列表
|
||||
|
|
@ -44,7 +41,7 @@ public class SafetyMeasuresServiceImpl implements SafetyMeasuresService {
|
|||
List<SafetyMeasuresVo> list = safetyMeasuresMapper.getSafetyMeasuresList(data);
|
||||
//获取图片信息
|
||||
for (SafetyMeasuresVo safetyMeasuresVo : list) {
|
||||
List<SysFileResourceVo> sysFileResourceList = sysFileResourceDao.getSysFileResourceList(safetyMeasuresVo.getId());
|
||||
List<SysFileResourceVo> sysFileResourceList = sysFileResourceService.getSysFileResourceList(safetyMeasuresVo.getId());
|
||||
safetyMeasuresVo.setSysFileResourceList(sysFileResourceList);
|
||||
}
|
||||
PageInfo<SafetyMeasuresVo> pageInfo = new PageInfo<>(list);
|
||||
|
|
@ -64,7 +61,7 @@ public class SafetyMeasuresServiceImpl implements SafetyMeasuresService {
|
|||
public ServerResponse deleteSafetyMeasures(SafetyMeasuresReqVo data) {
|
||||
try {
|
||||
safetyMeasuresMapper.deleteSafetyMeasures(data);
|
||||
sysFileResourceDao.deleteFileResource(data);
|
||||
sysFileResourceService.deleteFileResource(data.getId());
|
||||
return ServerResponse.createSuccess();
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
|
|
@ -85,13 +82,11 @@ public class SafetyMeasuresServiceImpl implements SafetyMeasuresService {
|
|||
//保存附件
|
||||
List<SysFileResourceVo> sysFileResourceList = data.getSysFileResourceList();
|
||||
for (SysFileResourceVo sysFileResourceVo: sysFileResourceList ) {
|
||||
sysFileResourceVo.setSourceId(data.getId());
|
||||
sysFileResourceVo.setUploadType("3");
|
||||
sysFileResourceVo.setSourceType(FileSourceTypeEnum.FILE_SOURCE_TYPE_5.getStatus());
|
||||
sysFileResourceVo.setSourceTypeName(FileSourceTypeEnum.FILE_SOURCE_TYPE_5.getStatusName());
|
||||
sysFileResourceVo.setCreateUser(UserUtil.getLoginUser() != null ? UserUtil.getLoginUser().getId() : 0);
|
||||
sysFileResourceVo.setCreateUserName(UserUtil.getLoginUser() != null ? UserUtil.getLoginUser().getNewUser():null);
|
||||
sysFileResourceDao.addSysFileResource(sysFileResourceVo);
|
||||
Long CreateUserId = UserUtil.getLoginUser() != null ? UserUtil.getLoginUser().getId() : 0;
|
||||
String CreateUserName = UserUtil.getLoginUser() != null ? UserUtil.getLoginUser().getNewUser(): null;
|
||||
sysFileResourceService.addSysFileResource(sysFileResourceVo,data.getId(),"3",CreateUserId,CreateUserName);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
|
|
@ -99,4 +94,33 @@ public class SafetyMeasuresServiceImpl implements SafetyMeasuresService {
|
|||
}
|
||||
return ServerResponse.createSuccess();
|
||||
}
|
||||
|
||||
/**
|
||||
* 安全措施落实修改
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public ServerResponse updateSafetyMeasures(SafetyMeasuresVo data) {
|
||||
|
||||
try {
|
||||
//修改
|
||||
safetyMeasuresMapper.updateSafetyMeasures(data);
|
||||
//附件先删除,后新增
|
||||
sysFileResourceService.deleteFileResource(data.getId());
|
||||
//保存附件
|
||||
List<SysFileResourceVo> sysFileResourceList = data.getSysFileResourceList();
|
||||
for (SysFileResourceVo sysFileResourceVo: sysFileResourceList ) {
|
||||
sysFileResourceVo.setSourceType(FileSourceTypeEnum.FILE_SOURCE_TYPE_5.getStatus());
|
||||
sysFileResourceVo.setSourceTypeName(FileSourceTypeEnum.FILE_SOURCE_TYPE_5.getStatusName());
|
||||
Long CreateUserId = UserUtil.getLoginUser() != null ? UserUtil.getLoginUser().getId() : 0;
|
||||
String CreateUserName = UserUtil.getLoginUser() != null ? UserUtil.getLoginUser().getNewUser(): null;
|
||||
sysFileResourceService.addSysFileResource(sysFileResourceVo,data.getId(),"3",CreateUserId,CreateUserName);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
return ServerResponse.createErroe("修改失败");
|
||||
}
|
||||
return ServerResponse.createSuccess();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
package com.bonus.imgTool.system.dao;
|
||||
|
||||
import com.bonus.imgTool.imageUpload.dto.SafetyMeasuresReqVo;
|
||||
import com.bonus.imgTool.system.vo.SysFileResourceVo;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
|
|
@ -9,7 +8,7 @@ import java.util.List;
|
|||
@Repository
|
||||
public interface SysFileResourceDao {
|
||||
|
||||
void deleteFileResource(SafetyMeasuresReqVo data);
|
||||
void deleteFileResource(Long id);
|
||||
|
||||
List<SysFileResourceVo> getSysFileResourceList(Long id);
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,15 @@
|
|||
package com.bonus.imgTool.system.service;
|
||||
|
||||
import com.bonus.imgTool.imageUpload.dto.SafetyMeasuresReqVo;
|
||||
import com.bonus.imgTool.system.vo.SysFileResourceVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface SysFileResourceService {
|
||||
List<SysFileResourceVo> getSysFileResourceList(Long id);
|
||||
|
||||
void deleteFileResource(Long id);
|
||||
|
||||
|
||||
void addSysFileResource(SysFileResourceVo sysFileResourceVo, Long id, String uploadType, Long createUserId, String createUserName);
|
||||
}
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
package com.bonus.imgTool.system.service.impl;
|
||||
|
||||
import com.bonus.imgTool.imageUpload.dto.SafetyMeasuresReqVo;
|
||||
import com.bonus.imgTool.system.dao.SysFileResourceDao;
|
||||
import com.bonus.imgTool.system.service.SysFileResourceService;
|
||||
import com.bonus.imgTool.system.vo.SysFileResourceVo;
|
||||
import com.bonus.imgTool.utils.UserUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@Service
|
||||
@Slf4j
|
||||
public class SysFileResourceServiceImpl implements SysFileResourceService {
|
||||
|
||||
@Resource
|
||||
private SysFileResourceDao sysFileResourceDao;
|
||||
|
||||
@Override
|
||||
public List<SysFileResourceVo> getSysFileResourceList(Long id) {
|
||||
return sysFileResourceDao.getSysFileResourceList(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteFileResource(Long id) {
|
||||
sysFileResourceDao.deleteFileResource(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addSysFileResource(SysFileResourceVo sysFileResourceVo, Long id, String uploadType, Long createUserId, String createUserName) {
|
||||
sysFileResourceVo.setSourceId(id);
|
||||
sysFileResourceVo.setUploadType(uploadType);
|
||||
sysFileResourceVo.setCreateUser(UserUtil.getLoginUser() != null ? UserUtil.getLoginUser().getId() : 0);
|
||||
sysFileResourceVo.setCreateUserName(UserUtil.getLoginUser() != null ? UserUtil.getLoginUser().getNewUser(): null);
|
||||
sysFileResourceDao.addSysFileResource(sysFileResourceVo);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,88 @@
|
|||
<?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.imageUpload.mapper.CoordinatePhotoMapper">
|
||||
<insert id="addCoordinatePhoto" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into tb_coordinate_photo
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="proId != null and proId != ''">pro_id,</if>
|
||||
<if test="proName != null">pro_name,</if>
|
||||
<if test="majorId != null and majorId != ''">major_id,</if>
|
||||
<if test="majorName != null">major_name,</if>
|
||||
<if test="gxId != null and gxId != ''">gx_id,</if>
|
||||
<if test="gxName != null">gx_name,</if>
|
||||
<if test="buildPlace != null">build_place,</if>
|
||||
<if test="buildBeforeDesc != null">build_before_desc,</if>
|
||||
<if test="buildUnderDesc != null">build_under_desc,</if>
|
||||
<if test="buildAfterDesc != null">build_after_desc,</if>
|
||||
<if test="createUserId != null">create_user_id,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="createUserName != null">create_user_name,</if>
|
||||
<if test="updateUserid != null">update_user_id,</if>
|
||||
<if test="updateUserName != null">update_user_name,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="dataSource != null">data_source,</if>
|
||||
is_active
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="proId != null and proId != ''">#{proId},</if>
|
||||
<if test="proName != null">#{proName},</if>
|
||||
<if test="majorId != null and majorId != ''">#{majorId},</if>
|
||||
<if test="majorName != null">#{majorName},</if>
|
||||
<if test="gxId != null and gxId != ''">#{gxId},</if>
|
||||
<if test="gxName != null and gxName != ''">#{gxName},</if>
|
||||
<if test="buildPlace != null">#{buildPlace},</if>
|
||||
<if test="buildBeforeDesc != null and buildBeforeDesc != ''">#{buildBeforeDesc},</if>
|
||||
<if test="buildUnderDesc != null">#{buildUnderDesc},</if>
|
||||
<if test="buildAfterDesc != null">#{buildAfterDesc},</if>
|
||||
<if test="createUserId != null">#{createUserId},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="createUserName != null">#{createUserName},</if>
|
||||
<if test="updateUserid != null">#{updateUserid},</if>
|
||||
<if test="updateUserName != null">#{updateUserName},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="dataSource != null">#{dataSource},</if>
|
||||
1
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateCoordinatePhoto">
|
||||
update tb_safety_measure
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<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="buildPlace != null">build_place = #{buildPlace},</if>
|
||||
<if test="buildBeforeDesc != null">build_before_desc = #{buildBeforeDesc},</if>
|
||||
<if test="buildUnderDesc != null">build_under_desc = #{buildUnderDesc},</if>
|
||||
<if test="buildAfterDesc != null">build_after_desc = #{buildAfterDesc},</if>
|
||||
<if test="updateUserId != null">update_user_id = #{updateUserId},</if>
|
||||
<if test="updateUserName != null">update_user_name = #{updateUserName},</if>
|
||||
update_time = NOW()
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteCoordinatePhoto">
|
||||
update tb_coordinate_photo set is_active ='0'
|
||||
where id = #{id}
|
||||
</delete>
|
||||
|
||||
<select id="getCoordinatePhotoList" resultType="com.bonus.imgTool.imageUpload.dto.CoordinatePhotoVo">
|
||||
select * from tb_coordinate_photo
|
||||
where is_active = '1'
|
||||
<if test="proId != '' and proId != null"> and pro_id = #{proId}</if>
|
||||
<if test="majorId != '' and majorId != null"> and major_id = #{majorId}</if>
|
||||
<if test="gxId != '' and gxId != null"> and gx_id = #{gxId}</if>
|
||||
<if test="keyWord != null and keyWord != ''">
|
||||
and (
|
||||
check_user_name like concat('%', #{keyWord}, '%') or
|
||||
check_desc like concat('%', #{keyWord}, '%') or
|
||||
check_place like concat('%', #{keyWord}, '%') or
|
||||
)
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -46,6 +46,25 @@
|
|||
</trim>
|
||||
|
||||
</insert>
|
||||
<update id="updateSafetyMeasures">
|
||||
update tb_safety_measure
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<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="checkDate != null">check_date = #{checkDate},</if>
|
||||
<if test="checkPlace != null">check_place = #{checkPlace},</if>
|
||||
<if test="checkDesc != null">check_desc = #{checkDesc},</if>
|
||||
<if test="updateUserId != null">update_user_id = #{updateUserId},</if>
|
||||
<if test="updateUserName != null">update_user_name = #{updateUserName},</if>
|
||||
update_time = NOW()
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
<delete id="deleteSafetyMeasures">
|
||||
update tb_safety_measure set is_active ='0'
|
||||
where id = #{id}
|
||||
|
|
|
|||
Loading…
Reference in New Issue