功能优化:
1. 新增HTTP状态码枚举QUERY_DATA_NULL(404, "查询数据为空") 2. 档案模块优化: - 添加Lombok注解@EqualsAndHashCode和@Accessors - 新增档案字段archivesValue - 扩展档案查询方法(selectInfoListByNameAndLevel) - 新增根据文档名称和info值查询节点ID方法 3. 新增工程档案上传功能: - 实现工程PDF文件上传接口 - 工程新增时自动创建档案分类节点 - 支持领料单/退料单/业务联系单PDF上传 4. 其他优化: - 添加文件大小格式化方法 - 优化档案名称重复检查逻辑 - 完善异常处理和日志记录
This commit is contained in:
parent
b95f57390e
commit
e62d952468
|
|
@ -12,6 +12,8 @@ public enum HttpCodeEnum {
|
||||||
SUCCESS(200, "操作成功"),
|
SUCCESS(200, "操作成功"),
|
||||||
//失败
|
//失败
|
||||||
FAIL(400, "操作失败,请联系管理员"),
|
FAIL(400, "操作失败,请联系管理员"),
|
||||||
|
// SQL查询数据为空
|
||||||
|
QUERY_DATA_NULL(404, "查询数据为空"),
|
||||||
// 登录
|
// 登录
|
||||||
NEED_LOGIN(401, "需要登录后操作"),
|
NEED_LOGIN(401, "需要登录后操作"),
|
||||||
TO_PARAM_NULL(1007, "参数为空"),
|
TO_PARAM_NULL(1007, "参数为空"),
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,8 @@ import com.bonus.common.core.web.domain.BaseEntity;
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
|
|
@ -12,7 +14,9 @@ import java.util.Date;
|
||||||
* @Author ma_sh
|
* @Author ma_sh
|
||||||
* @create 2024/12/26 13:49
|
* @create 2024/12/26 13:49
|
||||||
*/
|
*/
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@Data
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
public class ArchivesDetails extends BaseEntity {
|
public class ArchivesDetails extends BaseEntity {
|
||||||
|
|
||||||
@ApiModelProperty(value = "id")
|
@ApiModelProperty(value = "id")
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ package com.bonus.material.archives.domain;
|
||||||
import com.bonus.common.core.web.domain.BaseEntity;
|
import com.bonus.common.core.web.domain.BaseEntity;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 档案分类表
|
* 档案分类表
|
||||||
|
|
@ -10,6 +11,7 @@ import lombok.Data;
|
||||||
* @create 2024/12/26 9:29
|
* @create 2024/12/26 9:29
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
public class ArchivesInfo extends BaseEntity {
|
public class ArchivesInfo extends BaseEntity {
|
||||||
|
|
||||||
@ApiModelProperty(value = "infoId")
|
@ApiModelProperty(value = "infoId")
|
||||||
|
|
@ -18,6 +20,9 @@ public class ArchivesInfo extends BaseEntity {
|
||||||
@ApiModelProperty(value = "档案名称")
|
@ApiModelProperty(value = "档案名称")
|
||||||
private String archivesName;
|
private String archivesName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "档案所属唯一键值")
|
||||||
|
private String archivesValue;
|
||||||
|
|
||||||
@ApiModelProperty(value = "父级id")
|
@ApiModelProperty(value = "父级id")
|
||||||
private Long parentId;
|
private Long parentId;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,4 +19,7 @@ public class ArchivesVo {
|
||||||
private List<Long> detailsIdList;
|
private List<Long> detailsIdList;
|
||||||
|
|
||||||
private String ids;
|
private String ids;
|
||||||
|
|
||||||
|
// 是否检查名称是否重复
|
||||||
|
private boolean enableCheckNameExist = true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -22,12 +22,29 @@ public interface ArchivesMapper {
|
||||||
List<TreeNode> getTypeList(ArchivesInfo archiveInfo);
|
List<TreeNode> getTypeList(ArchivesInfo archiveInfo);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据名称查询电子档案分类
|
* 根据(名称及父级id)查询电子档案分类
|
||||||
* @param archiveInfo
|
* @param archiveInfo
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
ArchivesInfo selectByName(ArchivesInfo archiveInfo);
|
ArchivesInfo selectByName(ArchivesInfo archiveInfo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据(名称及level级别)查询电子档案分类
|
||||||
|
* @param name 节点名称
|
||||||
|
* @param level 节点层级
|
||||||
|
* @return list列表
|
||||||
|
*/
|
||||||
|
ArchivesInfo selectInfoListByNameAndLevel(@Param("name") String name, @Param("level") Integer level);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据档案details表文件夹类型的节点id(档案文件名 + 档案level + 档案所属info的value)
|
||||||
|
* @param name 档案文件名
|
||||||
|
* @param value 档案所属info表的value(同类型同层级唯一键值)
|
||||||
|
* @return 档案details表主键
|
||||||
|
*/
|
||||||
|
Integer selectDetailsNodeIdByDocNameAndInfoValue(@Param("name") String name, @Param("level") Integer level, @Param("value") Integer value);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增电子档案分类
|
* 新增电子档案分类
|
||||||
* @param archiveInfo
|
* @param archiveInfo
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,8 @@ import com.bonus.material.archives.domain.ArchivesDetails;
|
||||||
import com.bonus.material.archives.domain.ArchivesInfo;
|
import com.bonus.material.archives.domain.ArchivesInfo;
|
||||||
import com.bonus.material.archives.domain.ArchivesVo;
|
import com.bonus.material.archives.domain.ArchivesVo;
|
||||||
import com.bonus.material.archives.domain.ElcSignatureInfo;
|
import com.bonus.material.archives.domain.ElcSignatureInfo;
|
||||||
|
import com.bonus.material.basic.domain.BmProject;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
@ -17,6 +19,27 @@ import java.util.List;
|
||||||
*/
|
*/
|
||||||
public interface ArchivesService {
|
public interface ArchivesService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 上传档案工程信息类型的附件
|
||||||
|
* @param fromProjectFileType 上传文件所属工程文件类型(领料单、退料单、业务联系单)
|
||||||
|
* @param fileName 文件名称
|
||||||
|
* @param filePath 文件地址
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
AjaxResult uploadArchivesProjectPdf(String fromProjectFileType, String fileName, String filePath, Integer projectId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取文件大小(MB格式返回)
|
||||||
|
* @param multipartFile 文件
|
||||||
|
* @return 示例(返回1.2)
|
||||||
|
*/
|
||||||
|
String getFileSizeInMb(MultipartFile multipartFile);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工程新增事件--处理档案库对应数据
|
||||||
|
*/
|
||||||
|
AjaxResult projectAddEventCope(BmProject projectInfo);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取电子档案分类树
|
* 获取电子档案分类树
|
||||||
* @param archiveInfo
|
* @param archiveInfo
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
package com.bonus.material.archives.service.impl;
|
package com.bonus.material.archives.service.impl;
|
||||||
|
|
||||||
import cn.hutool.core.collection.CollectionUtil;
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import com.bonus.common.biz.config.DateTimeHelper;
|
import com.bonus.common.biz.config.DateTimeHelper;
|
||||||
import com.bonus.common.biz.config.FileCompressor;
|
import com.bonus.common.biz.config.FileCompressor;
|
||||||
import com.bonus.common.biz.domain.FileInfo;
|
import com.bonus.common.biz.domain.FileInfo;
|
||||||
|
|
@ -19,11 +20,13 @@ import com.bonus.material.archives.domain.ArchivesVo;
|
||||||
import com.bonus.material.archives.domain.ElcSignatureInfo;
|
import com.bonus.material.archives.domain.ElcSignatureInfo;
|
||||||
import com.bonus.material.archives.mapper.ArchivesMapper;
|
import com.bonus.material.archives.mapper.ArchivesMapper;
|
||||||
import com.bonus.material.archives.service.ArchivesService;
|
import com.bonus.material.archives.service.ArchivesService;
|
||||||
|
import com.bonus.material.basic.domain.BmProject;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.apache.tomcat.util.http.fileupload.IOUtils;
|
import org.apache.tomcat.util.http.fileupload.IOUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import javax.servlet.ServletOutputStream;
|
import javax.servlet.ServletOutputStream;
|
||||||
|
|
@ -35,8 +38,11 @@ import java.nio.charset.StandardCharsets;
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
import java.nio.file.Paths;
|
import java.nio.file.Paths;
|
||||||
|
import java.text.DecimalFormat;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
import java.util.zip.ZipEntry;
|
import java.util.zip.ZipEntry;
|
||||||
import java.util.zip.ZipOutputStream;
|
import java.util.zip.ZipOutputStream;
|
||||||
|
|
@ -50,9 +56,95 @@ import java.util.zip.ZipOutputStream;
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class ArchivesServiceImpl implements ArchivesService {
|
public class ArchivesServiceImpl implements ArchivesService {
|
||||||
|
|
||||||
|
// 工程档案等级及档案类型名称
|
||||||
|
public static final Integer PROJECT_TYPE_ARCHIVES_LEVEL = 1;
|
||||||
|
public static final Long PROJECT_YEAR_ARCHIVES_LEVEL = 2L;
|
||||||
|
public static final String PROJECT_TYPE_ARCHIVES_NAME = "工程项目材料";
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private ArchivesMapper archivesMapper;
|
private ArchivesMapper archivesMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 上传档案工程信息类型的附件
|
||||||
|
*
|
||||||
|
* @param fromProjectFileType 上传文件所属工程文件类型(领料单、退料单、业务联系单)
|
||||||
|
* @param fileName 文件名称
|
||||||
|
* @param filePath 文件地址
|
||||||
|
* @param projectId 工程id(表内唯一键值key)
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public AjaxResult uploadArchivesProjectPdf(String fromProjectFileType, String fileName, String filePath, Integer projectId) {
|
||||||
|
Integer leaseFolderNodeId = archivesMapper.selectDetailsNodeIdByDocNameAndInfoValue(fromProjectFileType, PROJECT_YEAR_ARCHIVES_LEVEL.intValue(), projectId);
|
||||||
|
if (null == leaseFolderNodeId || 0 == leaseFolderNodeId) {
|
||||||
|
return AjaxResult.error("未查询到工程所属档案文件夹信息");
|
||||||
|
}
|
||||||
|
ArchivesDetails archivesDetails = new ArchivesDetails();
|
||||||
|
archivesDetails.setInfoId(Long.valueOf(projectId));
|
||||||
|
archivesDetails.setParentId(Long.valueOf(leaseFolderNodeId));
|
||||||
|
archivesDetails.setLevel(Long.toString(PROJECT_YEAR_ARCHIVES_LEVEL));
|
||||||
|
archivesDetails.setDocName(fileName);
|
||||||
|
archivesDetails.setDocType("pdf");
|
||||||
|
archivesDetails.setDocUrl(filePath.contains("http") ? filePath : "https://xiyunwangcn.oss-cn-hangzhou.aliyuncs.com/" + filePath);
|
||||||
|
archivesDetails.setDelFlag("0");
|
||||||
|
archivesDetails.setCreateTime(DateUtils.getNowDate());
|
||||||
|
archivesDetails.setCreateBy(SecurityUtils.getUsername());
|
||||||
|
int insertArchivesDetailsResult = archivesMapper.insertDetails(archivesDetails);
|
||||||
|
return 0 < insertArchivesDetailsResult ? AjaxResult.success(HttpCodeEnum.SUCCESS.getMsg()) : AjaxResult.error(HttpCodeEnum.FAIL.getMsg());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工程新增事件--处理档案库对应数据
|
||||||
|
*
|
||||||
|
* @param projectInfo 新建的工程信息
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public AjaxResult projectAddEventCope(BmProject projectInfo) {
|
||||||
|
if (Objects.isNull(projectInfo) || Objects.isNull(projectInfo.getProId()) || Objects.isNull(projectInfo.getProName())) {
|
||||||
|
log.error("工程新增事件--处理档案库对应数据-工程信息不能为空");
|
||||||
|
return AjaxResult.error(HttpCodeEnum.TO_PARAM_NULL.getCode(), HttpCodeEnum.TO_PARAM_NULL.getMsg());
|
||||||
|
}
|
||||||
|
// 查询工程类型的档案信息
|
||||||
|
ArchivesInfo projectTypeNodeInfo = archivesMapper.selectInfoListByNameAndLevel(PROJECT_TYPE_ARCHIVES_NAME,PROJECT_TYPE_ARCHIVES_LEVEL);
|
||||||
|
if (Objects.isNull(projectTypeNodeInfo) || Objects.isNull(projectTypeNodeInfo.getInfoId())) {
|
||||||
|
log.error("工程新增事件--处理档案库对应数据-工程档案类型信息不存在");
|
||||||
|
return AjaxResult.error(HttpCodeEnum.QUERY_DATA_NULL.getCode(), "工程档案类型信息不存在");
|
||||||
|
}
|
||||||
|
// 获取当前年份
|
||||||
|
String currentYear = DateUtils.getCurrentYear();
|
||||||
|
ArchivesInfo currentYearArchivesNodeInfo = archivesMapper.selectByName(new ArchivesInfo().setArchivesName(currentYear).setParentId(projectTypeNodeInfo.getInfoId()));
|
||||||
|
// 判断当前年份的工程档案节点是否存在
|
||||||
|
if (Objects.isNull(currentYearArchivesNodeInfo) || Objects.isNull(currentYearArchivesNodeInfo.getInfoId())) {
|
||||||
|
log.error("工程新增事件--处理档案库对应数据-工程档案当前年份节点不存在");
|
||||||
|
return AjaxResult.error(HttpCodeEnum.QUERY_DATA_NULL.getCode(), "工程档案当前年份节点不存在");
|
||||||
|
}
|
||||||
|
|
||||||
|
ArchivesInfo currentProjectNodeInfo = new ArchivesInfo().setArchivesName(projectInfo.getProName()).setParentId(currentYearArchivesNodeInfo.getInfoId()).setLevel(Long.toString(PROJECT_YEAR_ARCHIVES_LEVEL));
|
||||||
|
currentProjectNodeInfo.setArchivesValue(String.valueOf(projectInfo.getProId()));
|
||||||
|
currentProjectNodeInfo.setCreateTime(DateUtils.getNowDate());
|
||||||
|
currentProjectNodeInfo.setCreateBy(SecurityUtils.getUsername());
|
||||||
|
int insertCurrentProjectNodeResult = archivesMapper.insertInfo(currentProjectNodeInfo);
|
||||||
|
//AjaxResult insertNodeInfoResult = this.add(currentProjectNodeInfo);
|
||||||
|
if (insertCurrentProjectNodeResult > 0) {
|
||||||
|
// 判断新增的工程节点信息是否完善
|
||||||
|
if (ObjectUtil.isEmpty(currentProjectNodeInfo) || ObjectUtil.isEmpty(currentProjectNodeInfo.getInfoId())) {
|
||||||
|
return AjaxResult.error(HttpCodeEnum.FAIL.getCode(), HttpCodeEnum.FAIL.getMsg());
|
||||||
|
}
|
||||||
|
// 增加详情节点
|
||||||
|
ArchivesDetails details1 = new ArchivesDetails().setInfoId(currentProjectNodeInfo.getInfoId()).setParentId(0L).setLevel("1").setDocName("领料单").setDocType("文件夹");
|
||||||
|
ArchivesDetails details2 = new ArchivesDetails().setInfoId(currentProjectNodeInfo.getInfoId()).setParentId(0L).setLevel("1").setDocName("退料单").setDocType("文件夹");
|
||||||
|
ArchivesDetails details3 = new ArchivesDetails().setInfoId(currentProjectNodeInfo.getInfoId()).setParentId(0L).setLevel("1").setDocName("业务联系单").setDocType("文件夹");
|
||||||
|
List<ArchivesDetails> archivesNodeDetailsList = new ArrayList<>(Arrays.asList(details1, details2, details3));
|
||||||
|
ArchivesVo archivesVo = new ArchivesVo();
|
||||||
|
archivesVo.setArchivesDetailsList(archivesNodeDetailsList);
|
||||||
|
archivesVo.setEnableCheckNameExist(false);
|
||||||
|
return this.addDetails(archivesVo);
|
||||||
|
} else {
|
||||||
|
return AjaxResult.error(HttpCodeEnum.FAIL.getCode(), HttpCodeEnum.FAIL.getMsg());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取电子档案分类树
|
* 获取电子档案分类树
|
||||||
* @param archiveInfo
|
* @param archiveInfo
|
||||||
|
|
@ -61,7 +153,7 @@ public class ArchivesServiceImpl implements ArchivesService {
|
||||||
@Override
|
@Override
|
||||||
public AjaxResult getTypeList(ArchivesInfo archiveInfo) {
|
public AjaxResult getTypeList(ArchivesInfo archiveInfo) {
|
||||||
List<TreeNode> groupList = new ArrayList<>();
|
List<TreeNode> groupList = new ArrayList<>();
|
||||||
List<TreeNode> list = new ArrayList<>();
|
List<TreeNode> list;
|
||||||
try {
|
try {
|
||||||
list = archivesMapper.getTypeList(archiveInfo);
|
list = archivesMapper.getTypeList(archiveInfo);
|
||||||
if (CollectionUtils.isNotEmpty(list)) {
|
if (CollectionUtils.isNotEmpty(list)) {
|
||||||
|
|
@ -94,7 +186,7 @@ public class ArchivesServiceImpl implements ArchivesService {
|
||||||
archiveInfo.setParentId(archiveInfo.getInfoId() != null ? archiveInfo.getInfoId() : 0L);
|
archiveInfo.setParentId(archiveInfo.getInfoId() != null ? archiveInfo.getInfoId() : 0L);
|
||||||
archiveInfo.setLevel((StringUtils.isNotBlank(archiveInfo.getLevel())) ? String.valueOf(Integer.parseInt(archiveInfo.getLevel()) + 1) : "1");
|
archiveInfo.setLevel((StringUtils.isNotBlank(archiveInfo.getLevel())) ? String.valueOf(Integer.parseInt(archiveInfo.getLevel()) + 1) : "1");
|
||||||
int result = archivesMapper.insertInfo(archiveInfo);
|
int result = archivesMapper.insertInfo(archiveInfo);
|
||||||
if (result > 0) {
|
if (0 < result) {
|
||||||
return AjaxResult.success(HttpCodeEnum.SUCCESS.getMsg(), result);
|
return AjaxResult.success(HttpCodeEnum.SUCCESS.getMsg(), result);
|
||||||
}
|
}
|
||||||
return AjaxResult.error(HttpCodeEnum.FAIL.getCode(), HttpCodeEnum.FAIL.getMsg());
|
return AjaxResult.error(HttpCodeEnum.FAIL.getCode(), HttpCodeEnum.FAIL.getMsg());
|
||||||
|
|
@ -158,6 +250,27 @@ public class ArchivesServiceImpl implements ArchivesService {
|
||||||
return archivesMapper.selectDetailsList(archivesDetails);
|
return archivesMapper.selectDetailsList(archivesDetails);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取文件大小
|
||||||
|
* @param multipartFile 文件
|
||||||
|
* @return MB格式(例如: 18.23)
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public String getFileSizeInMb(MultipartFile multipartFile) {
|
||||||
|
if (null == multipartFile || multipartFile.isEmpty()) {
|
||||||
|
return "0";
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
long fileSizeInBytes = multipartFile.getSize();
|
||||||
|
double fileSizeInMb = (double) fileSizeInBytes / (1024 * 1024);
|
||||||
|
DecimalFormat df = new DecimalFormat("#.00");
|
||||||
|
return df.format(fileSizeInMb);
|
||||||
|
} catch (Exception e) {
|
||||||
|
return "0";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增电子档案右侧类型
|
* 新增电子档案右侧类型
|
||||||
* @param archivesVo
|
* @param archivesVo
|
||||||
|
|
@ -184,12 +297,14 @@ public class ArchivesServiceImpl implements ArchivesService {
|
||||||
}
|
}
|
||||||
// 如果有多条数据
|
// 如果有多条数据
|
||||||
if (CollectionUtils.isNotEmpty(archivesVo.getArchivesDetailsList())) {
|
if (CollectionUtils.isNotEmpty(archivesVo.getArchivesDetailsList())) {
|
||||||
|
if (archivesVo.isEnableCheckNameExist()) {
|
||||||
// 检查是否有重复名称
|
// 检查是否有重复名称
|
||||||
for (ArchivesDetails archivesDetails : archivesVo.getArchivesDetailsList()) {
|
for (ArchivesDetails archivesDetails : archivesVo.getArchivesDetailsList()) {
|
||||||
if (isNameDuplicate(archivesDetails)) {
|
if (isNameDuplicate(archivesDetails)) {
|
||||||
return AjaxResult.error(HttpCodeEnum.NAME_DUPLICATE.getCode(), HttpCodeEnum.NAME_DUPLICATE.getMsg());
|
return AjaxResult.error(HttpCodeEnum.NAME_DUPLICATE.getCode(), HttpCodeEnum.NAME_DUPLICATE.getMsg());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
// 插入所有不重复的档案详情
|
// 插入所有不重复的档案详情
|
||||||
for (ArchivesDetails archivesDetails : archivesVo.getArchivesDetailsList()) {
|
for (ArchivesDetails archivesDetails : archivesVo.getArchivesDetailsList()) {
|
||||||
prepareArchivesDetails(archivesDetails);
|
prepareArchivesDetails(archivesDetails);
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,8 @@ package com.bonus.material.back.controller;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import javax.annotation.Resource;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import javax.validation.Valid;
|
import javax.validation.Valid;
|
||||||
import javax.validation.constraints.NotNull;
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
@ -10,6 +12,7 @@ import cn.hutool.core.convert.Convert;
|
||||||
import com.bonus.common.biz.config.ListPagingUtil;
|
import com.bonus.common.biz.config.ListPagingUtil;
|
||||||
import com.bonus.common.core.utils.ServletUtils;
|
import com.bonus.common.core.utils.ServletUtils;
|
||||||
import com.bonus.common.log.enums.OperaType;
|
import com.bonus.common.log.enums.OperaType;
|
||||||
|
import com.bonus.material.archives.service.ArchivesService;
|
||||||
import com.bonus.material.back.domain.BackApplyDetails;
|
import com.bonus.material.back.domain.BackApplyDetails;
|
||||||
import com.bonus.material.back.domain.MaCode;
|
import com.bonus.material.back.domain.MaCode;
|
||||||
import com.bonus.material.back.domain.vo.BackAppRequestVo;
|
import com.bonus.material.back.domain.vo.BackAppRequestVo;
|
||||||
|
|
@ -17,6 +20,7 @@ import com.bonus.material.back.domain.vo.BackApplyInfoVo;
|
||||||
import com.bonus.material.back.domain.vo.BackApplyRequestVo;
|
import com.bonus.material.back.domain.vo.BackApplyRequestVo;
|
||||||
import com.bonus.material.back.domain.vo.BackApplyVo;
|
import com.bonus.material.back.domain.vo.BackApplyVo;
|
||||||
import com.bonus.material.common.annotation.PreventRepeatSubmit;
|
import com.bonus.material.common.annotation.PreventRepeatSubmit;
|
||||||
|
import com.bonus.system.api.RemoteFileService;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|
@ -28,6 +32,7 @@ import com.bonus.material.back.service.IBackApplyInfoService;
|
||||||
import com.bonus.common.core.web.controller.BaseController;
|
import com.bonus.common.core.web.controller.BaseController;
|
||||||
import com.bonus.common.core.web.domain.AjaxResult;
|
import com.bonus.common.core.web.domain.AjaxResult;
|
||||||
import com.bonus.common.core.utils.poi.ExcelUtil;
|
import com.bonus.common.core.utils.poi.ExcelUtil;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 退料任务Controller
|
* 退料任务Controller
|
||||||
|
|
@ -39,9 +44,16 @@ import com.bonus.common.core.utils.poi.ExcelUtil;
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/back_apply_info")
|
@RequestMapping("/back_apply_info")
|
||||||
public class BackApplyInfoController extends BaseController {
|
public class BackApplyInfoController extends BaseController {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private IBackApplyInfoService backApplyInfoService;
|
private IBackApplyInfoService backApplyInfoService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private RemoteFileService sysFileService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ArchivesService archivesService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询退料任务列表
|
* 查询退料任务列表
|
||||||
*/
|
*/
|
||||||
|
|
@ -56,6 +68,30 @@ public class BackApplyInfoController extends BaseController {
|
||||||
return AjaxResult.success(ListPagingUtil.paging(pageIndex, pageSize, list));
|
return AjaxResult.success(ListPagingUtil.paging(pageIndex, pageSize, list));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 上传退料单PDF文件
|
||||||
|
*/
|
||||||
|
@PostMapping("/uploadPdf")
|
||||||
|
@SysLog(title = "上传退料单PDF", businessType = OperaType.INSERT, module = "仓储管理->上传退料单PDF")
|
||||||
|
public AjaxResult uploadPdf(@RequestParam("file") MultipartFile file, @RequestParam("id") Long id) {
|
||||||
|
try {
|
||||||
|
AjaxResult result = sysFileService.upload(file);
|
||||||
|
if (!result.isSuccess()) {
|
||||||
|
return AjaxResult.error("SysFile文件服务上传失败:" + result.get("msg"));
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
Map<String, Object> jsonObject = (Map<String, Object>) result.get("data");
|
||||||
|
String fileName = file.getOriginalFilename();
|
||||||
|
String filePath = jsonObject.get("url").toString();
|
||||||
|
|
||||||
|
return archivesService.uploadArchivesProjectPdf("退料单", fileName, filePath, Math.toIntExact(id));
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error("上传退料单PDF文件失败", e);
|
||||||
|
return AjaxResult.error("领料单档案保存失败:" + e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询修试查询-退料查询列表
|
* 查询修试查询-退料查询列表
|
||||||
* @param dto
|
* @param dto
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@ import com.bonus.common.core.utils.DateUtils;
|
||||||
import com.bonus.common.core.utils.encryption.Sm4Utils;
|
import com.bonus.common.core.utils.encryption.Sm4Utils;
|
||||||
import com.bonus.common.core.web.domain.AjaxResult;
|
import com.bonus.common.core.web.domain.AjaxResult;
|
||||||
import com.bonus.common.security.utils.SecurityUtils;
|
import com.bonus.common.security.utils.SecurityUtils;
|
||||||
|
import com.bonus.material.archives.service.ArchivesService;
|
||||||
import com.bonus.material.basic.domain.BmAgreementInfo;
|
import com.bonus.material.basic.domain.BmAgreementInfo;
|
||||||
import com.bonus.material.basic.mapper.BmAgreementInfoMapper;
|
import com.bonus.material.basic.mapper.BmAgreementInfoMapper;
|
||||||
import com.bonus.material.purchase.config.RemoteConfig;
|
import com.bonus.material.purchase.config.RemoteConfig;
|
||||||
|
|
@ -48,12 +49,16 @@ public class BmProjectServiceImpl implements IBmProjectService
|
||||||
@Resource
|
@Resource
|
||||||
private RemoteDeptService remoteDeptService;
|
private RemoteDeptService remoteDeptService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ArchivesService archivesService;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private RemoteConfig remoteConfig;
|
private RemoteConfig remoteConfig;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private BmAgreementInfoMapper bmAgreementInfoMapper;
|
private BmAgreementInfoMapper bmAgreementInfoMapper;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询标段工程管理
|
* 查询标段工程管理
|
||||||
*
|
*
|
||||||
|
|
@ -113,6 +118,7 @@ public class BmProjectServiceImpl implements IBmProjectService
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (NumberFormatException e) {
|
} catch (NumberFormatException e) {
|
||||||
|
project.setTelphone("");
|
||||||
log.error("远程调用查询失败:", e.getMessage());
|
log.error("远程调用查询失败:", e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -128,9 +134,7 @@ public class BmProjectServiceImpl implements IBmProjectService
|
||||||
{
|
{
|
||||||
List<BmProject> list = bmProjectMapper.selectBmProjectList(bmProject);
|
List<BmProject> list = bmProjectMapper.selectBmProjectList(bmProject);
|
||||||
if (CollectionUtils.isNotEmpty(list)) {
|
if (CollectionUtils.isNotEmpty(list)) {
|
||||||
list.forEach(item -> {
|
list.forEach(this::extractedImpUnit);
|
||||||
extractedImpUnit(item);
|
|
||||||
});
|
|
||||||
extracted(list);
|
extracted(list);
|
||||||
}
|
}
|
||||||
return list;
|
return list;
|
||||||
|
|
@ -199,6 +203,15 @@ public class BmProjectServiceImpl implements IBmProjectService
|
||||||
bmProject.setTelphone(telPhone);
|
bmProject.setTelphone(telPhone);
|
||||||
int result = bmProjectMapper.insertBmProject(bmProject);
|
int result = bmProjectMapper.insertBmProject(bmProject);
|
||||||
if (result > 0) {
|
if (result > 0) {
|
||||||
|
// 工程标段添加成功
|
||||||
|
try {
|
||||||
|
AjaxResult projectAddEventCopeResult = archivesService.projectAddEventCope(bmProject);
|
||||||
|
if (projectAddEventCopeResult.isSuccess()) {
|
||||||
|
log.info("工程标段添加成功,且档案事件处理成功");
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("工程标段添加成功,但档案事件处理失败,触发异常:" + e.getMessage());
|
||||||
|
}
|
||||||
return AjaxResult.success(HttpCodeEnum.SUCCESS.getMsg(), result);
|
return AjaxResult.success(HttpCodeEnum.SUCCESS.getMsg(), result);
|
||||||
}
|
}
|
||||||
return AjaxResult.error(HttpCodeEnum.FAIL.getCode(), HttpCodeEnum.FAIL.getMsg());
|
return AjaxResult.error(HttpCodeEnum.FAIL.getCode(), HttpCodeEnum.FAIL.getMsg());
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
package com.bonus.material.lease.controller;
|
package com.bonus.material.lease.controller;
|
||||||
|
|
||||||
import cn.hutool.core.convert.Convert;
|
import cn.hutool.core.convert.Convert;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.bonus.common.biz.annotation.StoreLog;
|
import com.bonus.common.biz.annotation.StoreLog;
|
||||||
import com.bonus.common.biz.config.ListPagingUtil;
|
import com.bonus.common.biz.config.ListPagingUtil;
|
||||||
import com.bonus.common.biz.domain.lease.LeaseOutDetails;
|
import com.bonus.common.biz.domain.lease.LeaseOutDetails;
|
||||||
|
|
@ -9,7 +10,9 @@ import com.bonus.common.core.utils.poi.ExcelUtil;
|
||||||
import com.bonus.common.core.web.controller.BaseController;
|
import com.bonus.common.core.web.controller.BaseController;
|
||||||
import com.bonus.common.core.web.domain.AjaxResult;
|
import com.bonus.common.core.web.domain.AjaxResult;
|
||||||
import com.bonus.common.log.annotation.SysLog;
|
import com.bonus.common.log.annotation.SysLog;
|
||||||
|
import com.bonus.common.log.enums.BusinessType;
|
||||||
import com.bonus.common.log.enums.OperaType;
|
import com.bonus.common.log.enums.OperaType;
|
||||||
|
import com.bonus.material.archives.service.ArchivesService;
|
||||||
import com.bonus.material.basic.domain.BmQrcodeInfo;
|
import com.bonus.material.basic.domain.BmQrcodeInfo;
|
||||||
import com.bonus.material.common.annotation.PreventRepeatSubmit;
|
import com.bonus.material.common.annotation.PreventRepeatSubmit;
|
||||||
import com.bonus.common.biz.domain.lease.LeaseApplyInfo;
|
import com.bonus.common.biz.domain.lease.LeaseApplyInfo;
|
||||||
|
|
@ -17,13 +20,19 @@ import com.bonus.material.lease.domain.LeaseApplyDetails;
|
||||||
import com.bonus.material.lease.domain.vo.LeaseApplyRequestVo;
|
import com.bonus.material.lease.domain.vo.LeaseApplyRequestVo;
|
||||||
import com.bonus.common.biz.domain.lease.LeaseOutRequestVo;
|
import com.bonus.common.biz.domain.lease.LeaseOutRequestVo;
|
||||||
import com.bonus.material.lease.service.ILeaseApplyInfoService;
|
import com.bonus.material.lease.service.ILeaseApplyInfoService;
|
||||||
|
import com.bonus.system.api.RemoteFileService;
|
||||||
|
import com.bonus.system.api.domain.SysFile;
|
||||||
|
import com.google.gson.JsonObject;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import javax.validation.constraints.NotNull;
|
import javax.validation.constraints.NotNull;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 领料任务Controller
|
* 领料任务Controller
|
||||||
|
|
@ -39,6 +48,12 @@ public class LeaseApplyInfoController extends BaseController {
|
||||||
@Resource
|
@Resource
|
||||||
private ILeaseApplyInfoService leaseApplyInfoService;
|
private ILeaseApplyInfoService leaseApplyInfoService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private RemoteFileService sysFileService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ArchivesService archivesService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询领料任务列表
|
* 查询领料任务列表
|
||||||
*/
|
*/
|
||||||
|
|
@ -52,6 +67,29 @@ public class LeaseApplyInfoController extends BaseController {
|
||||||
return AjaxResult.success(ListPagingUtil.paging(pageIndex, pageSize, list));
|
return AjaxResult.success(ListPagingUtil.paging(pageIndex, pageSize, list));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 上传领料单PDF文件
|
||||||
|
*/
|
||||||
|
@PostMapping("/uploadPdf")
|
||||||
|
@SysLog(title = "上传领料单PDF", businessType = OperaType.INSERT, module = "仓储管理->上传领料单PDF")
|
||||||
|
public AjaxResult uploadPdf(@RequestParam("file") MultipartFile file, @RequestParam("id") Long id) {
|
||||||
|
try {
|
||||||
|
AjaxResult result = sysFileService.upload(file);
|
||||||
|
if (!result.isSuccess()) {
|
||||||
|
return AjaxResult.error("SysFile文件服务上传失败:" + result.get("msg"));
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
Map<String, Object> jsonObject = (Map<String, Object>) result.get("data");
|
||||||
|
String fileName = file.getOriginalFilename();
|
||||||
|
String filePath = jsonObject.get("url").toString();
|
||||||
|
return archivesService.uploadArchivesProjectPdf("领料单", fileName, filePath, Math.toIntExact(id));
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error("上传领料单PDF文件失败", e);
|
||||||
|
return AjaxResult.error("上传领料单PDF文件失败:" + e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导出领料任务列表
|
* 导出领料任务列表
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ import com.bonus.common.core.web.controller.BaseController;
|
||||||
import com.bonus.common.core.web.domain.AjaxResult;
|
import com.bonus.common.core.web.domain.AjaxResult;
|
||||||
import com.bonus.common.log.annotation.SysLog;
|
import com.bonus.common.log.annotation.SysLog;
|
||||||
import com.bonus.common.log.enums.OperaType;
|
import com.bonus.common.log.enums.OperaType;
|
||||||
|
import com.bonus.material.archives.service.ArchivesService;
|
||||||
import com.bonus.material.common.annotation.PreventRepeatSubmit;
|
import com.bonus.material.common.annotation.PreventRepeatSubmit;
|
||||||
import com.bonus.material.lease.domain.LeaseApplyDetails;
|
import com.bonus.material.lease.domain.LeaseApplyDetails;
|
||||||
import com.bonus.material.lease.domain.LeasePublishDetails;
|
import com.bonus.material.lease.domain.LeasePublishDetails;
|
||||||
|
|
@ -53,6 +54,9 @@ public class LeaseTaskController extends BaseController {
|
||||||
@Resource
|
@Resource
|
||||||
private RemoteFileService sysFileService;
|
private RemoteFileService sysFileService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ArchivesService archivesService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增领用任务
|
* 新增领用任务
|
||||||
*/
|
*/
|
||||||
|
|
@ -92,6 +96,30 @@ public class LeaseTaskController extends BaseController {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 上传业务联系单PDF文件
|
||||||
|
*/
|
||||||
|
@PostMapping("/uploadPdf")
|
||||||
|
@SysLog(title = "上传业务联系单PDF", businessType = OperaType.INSERT, module = "仓储管理->上传业务联系单PDF")
|
||||||
|
public AjaxResult uploadPdf(@RequestParam("file") MultipartFile file, @RequestParam("id") Long id) {
|
||||||
|
try {
|
||||||
|
AjaxResult result = sysFileService.upload(file);
|
||||||
|
if (!result.isSuccess()) {
|
||||||
|
return AjaxResult.error("SysFile文件服务上传失败:" + result.get("msg"));
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
Map<String, Object> jsonObject = (Map<String, Object>) result.get("data");
|
||||||
|
String fileName = file.getOriginalFilename();
|
||||||
|
String filePath = jsonObject.get("url").toString();
|
||||||
|
|
||||||
|
return archivesService.uploadArchivesProjectPdf("业务联系单", fileName, filePath, Math.toIntExact(id));
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error("上传业务联系单PDF文件失败", e);
|
||||||
|
return AjaxResult.error("上传业务联系单PDF文件失败:" + e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导出领料记录查询
|
* 导出领料记录查询
|
||||||
* @param response
|
* @param response
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,7 @@ import javax.servlet.http.HttpServletResponse;
|
||||||
* @date 2024-10-16
|
* @date 2024-10-16
|
||||||
*/
|
*/
|
||||||
public interface ILeaseApplyInfoService {
|
public interface ILeaseApplyInfoService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询领料任务
|
* 查询领料任务
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -164,10 +164,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
where user_id = #{userId}
|
where user_id = #{userId}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<insert id="insertInfo">
|
<insert id="insertInfo" useGeneratedKeys="true" keyProperty="infoId">
|
||||||
insert into archives_record_info
|
insert into archives_record_info
|
||||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
<if test="archivesName != null and archivesName != ''">archives_name,</if>
|
<if test="archivesName != null and archivesName != ''">archives_name,</if>
|
||||||
|
<if test="archivesValue != null and archivesValue != ''">archives_value,</if>
|
||||||
<if test="parentId != null">parent_id,</if>
|
<if test="parentId != null">parent_id,</if>
|
||||||
<if test="level != null and level != ''">level,</if>
|
<if test="level != null and level != ''">level,</if>
|
||||||
<if test="createBy != null">create_by,</if>
|
<if test="createBy != null">create_by,</if>
|
||||||
|
|
@ -176,6 +177,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</trim>
|
</trim>
|
||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
<if test="archivesName != null and archivesName != ''">#{archivesName},</if>
|
<if test="archivesName != null and archivesName != ''">#{archivesName},</if>
|
||||||
|
<if test="archivesValue != null and archivesValue != ''">#{archivesValue},</if>
|
||||||
<if test="parentId != null">#{parentId},</if>
|
<if test="parentId != null">#{parentId},</if>
|
||||||
<if test="level != null and level != ''">#{level},</if>
|
<if test="level != null and level != ''">#{level},</if>
|
||||||
<if test="createBy != null">#{createBy},</if>
|
<if test="createBy != null">#{createBy},</if>
|
||||||
|
|
@ -261,4 +263,33 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
set del_flag = '1'
|
set del_flag = '1'
|
||||||
where details_id = #{detailsId}
|
where details_id = #{detailsId}
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
|
<select id="selectInfoListByNameAndLevel" resultType="com.bonus.material.archives.domain.ArchivesInfo">
|
||||||
|
select
|
||||||
|
info_id as infoId,
|
||||||
|
archives_name as archivesName,
|
||||||
|
parent_id as parentId,
|
||||||
|
level as level
|
||||||
|
from
|
||||||
|
archives_record_info
|
||||||
|
where
|
||||||
|
archives_name = #{name}
|
||||||
|
and level = #{level}
|
||||||
|
and del_flag = '0'
|
||||||
|
limit 1
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectDetailsNodeIdByDocNameAndInfoValue" resultType="java.lang.Integer">
|
||||||
|
SELECT
|
||||||
|
ard.details_id
|
||||||
|
FROM
|
||||||
|
archives_record_info ari
|
||||||
|
LEFT JOIN
|
||||||
|
archives_record_details ard ON ari.info_id = ard.info_id AND ard.`level` = '1'
|
||||||
|
WHERE
|
||||||
|
ari.`level` = #{level}
|
||||||
|
AND ari.archives_value = #{value}
|
||||||
|
AND ard.doc_name = #{name}
|
||||||
|
AND ard.doc_type = '文件夹'
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
@ -106,7 +106,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<insert id="insertBmProject" parameterType="com.bonus.material.basic.domain.BmProject">
|
<insert id="insertBmProject" parameterType="com.bonus.material.basic.domain.BmProject" useGeneratedKeys="true" keyProperty="proId">
|
||||||
insert into bm_project
|
insert into bm_project
|
||||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
<if test="proId != null">pro_id,</if>
|
<if test="proId != null">pro_id,</if>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue