代码提交
This commit is contained in:
parent
b50ae31537
commit
7f4772f5b8
|
|
@ -3,11 +3,14 @@ package com.bonus.web.controller.archive;
|
|||
import com.bonus.common.annotation.RequiresPermissions;
|
||||
import com.bonus.common.annotation.SysLog;
|
||||
import com.bonus.common.core.controller.BaseController;
|
||||
import com.bonus.common.core.domain.AjaxResult;
|
||||
import com.bonus.common.core.page.TableDataInfo;
|
||||
import com.bonus.common.enums.OperaType;
|
||||
import com.bonus.web.domain.TransferApplyDto;
|
||||
import com.bonus.web.service.TransferApplyService;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
|
@ -24,19 +27,37 @@ import java.util.List;
|
|||
@RequestMapping("/transferRecord")
|
||||
@Slf4j
|
||||
public class FileTransferRecordController extends BaseController {
|
||||
// @ApiOperation(value = "档案移交申请列表")
|
||||
// @GetMapping("getTransferRecordList")
|
||||
// @SysLog(title = "档案移交申请列表", module = "数据/档案移交->档案移交申请", businessType = OperaType.QUERY, details = "档案移交申请列表", logType = 1)
|
||||
// @RequiresPermissions("transfer:record:list")
|
||||
// public TableDataInfo getTransferRecordList(TransferApplyDto dto) {
|
||||
// try {
|
||||
// startPage();
|
||||
// List<TransferApplyDto> list = transferApplyService.list(dto);
|
||||
// return getDataTable(list);
|
||||
// } catch (Exception e) {
|
||||
// log.error(e.toString(), e);
|
||||
// return getDataTable(new ArrayList<>());
|
||||
// }
|
||||
// }
|
||||
|
||||
@Autowired
|
||||
private TransferApplyService transferApplyService;
|
||||
@ApiOperation(value = "档案移交申请列表")
|
||||
@GetMapping("getTransferRecordList")
|
||||
@SysLog(title = "档案移交申请列表", module = "数据/档案移交->档案移交申请", businessType = OperaType.QUERY, details = "档案移交申请列表", logType = 1)
|
||||
@RequiresPermissions("transfer:record:list")
|
||||
public TableDataInfo getTransferRecordList(TransferApplyDto dto) {
|
||||
try {
|
||||
startPage();
|
||||
dto.setAuditStatus("1");
|
||||
List<TransferApplyDto> list = transferApplyService.list(dto);
|
||||
return getDataTable(list);
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
return getDataTable(new ArrayList<>());
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation(value = "档案移交申请详情")
|
||||
@GetMapping("getTransferRecordDetail")
|
||||
@SysLog(title = "档案移交申请详情", module = "数据/档案移交->档案移交申请", businessType = OperaType.QUERY, details = "档案移交申请详情", logType = 1)
|
||||
@RequiresPermissions("transfer:record:query")
|
||||
public AjaxResult getTransferApply(TransferApplyDto dto) {
|
||||
try {
|
||||
TransferApplyDto transferApply = transferApplyService.getTransferApply(dto);
|
||||
return AjaxResult.success(transferApply);
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
return AjaxResult.error("请求出错了");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import com.bonus.common.core.domain.AjaxResult;
|
|||
import com.bonus.common.core.domain.entity.SysDept;
|
||||
import com.bonus.common.core.page.TableDataInfo;
|
||||
import com.bonus.common.enums.OperaType;
|
||||
import com.bonus.web.domain.DaKyProFilesContentsDto;
|
||||
import com.bonus.web.domain.SelectDto;
|
||||
import com.bonus.web.domain.TransferApplyDto;
|
||||
import com.bonus.web.service.TransferApplyService;
|
||||
|
|
@ -135,4 +136,18 @@ public class TransferApplyController extends BaseController {
|
|||
return AjaxResult.error("请求出错了");
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation(value = "档案移交申请列表")
|
||||
@GetMapping("getTransferApplyFiles")
|
||||
@SysLog(title = "档案移交申请列表", module = "数据/档案移交->档案移交申请", businessType = OperaType.QUERY, details = "档案移交申请列表", logType = 1)
|
||||
@RequiresPermissions("transfer:apply:list")
|
||||
public AjaxResult getTransferApplyFiles(TransferApplyDto dto) {
|
||||
try {
|
||||
List<DaKyProFilesContentsDto> list = transferApplyService.getTransferApplyFiles(dto);
|
||||
return AjaxResult.success(list);
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
return AjaxResult.error();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ public class TransferApplyDto {
|
|||
* 主键ID
|
||||
*/
|
||||
private Integer id;
|
||||
private String parentId;
|
||||
|
||||
/**
|
||||
* 项目ID
|
||||
|
|
@ -109,6 +110,12 @@ public class TransferApplyDto {
|
|||
*/
|
||||
private Integer updateUserId;
|
||||
|
||||
//工程类型
|
||||
private String proType;
|
||||
|
||||
//电压等级
|
||||
private String voltageLevel;
|
||||
|
||||
/**
|
||||
* 是否删除:0.删除 1.未删除
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.bonus.web.mapper;
|
|||
|
||||
import com.bonus.common.core.domain.AjaxResult;
|
||||
import com.bonus.common.core.domain.entity.SysDept;
|
||||
import com.bonus.web.domain.DaKyProFilesContentsDto;
|
||||
import com.bonus.web.domain.SelectDto;
|
||||
import com.bonus.web.domain.TransferApplyDto;
|
||||
import com.bonus.web.domain.TransferFileDto;
|
||||
|
|
@ -37,4 +38,8 @@ public interface TransferApplyMapper {
|
|||
List<SysDept> getDeptSelect(TransferApplyDto dto);
|
||||
|
||||
List<SelectDto> getProSelect(TransferApplyDto dto);
|
||||
|
||||
List<String> getTransferApplyFilesContents(TransferApplyDto dto);
|
||||
|
||||
List<DaKyProFilesContentsDto> getTransferApplyFiles(String content);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.bonus.web.service;
|
|||
|
||||
import com.bonus.common.core.domain.AjaxResult;
|
||||
import com.bonus.common.core.domain.entity.SysDept;
|
||||
import com.bonus.web.domain.DaKyProFilesContentsDto;
|
||||
import com.bonus.web.domain.SelectDto;
|
||||
import com.bonus.web.domain.TransferApplyDto;
|
||||
|
||||
|
|
@ -27,4 +28,6 @@ public interface TransferApplyService {
|
|||
List<SysDept> getDeptSelect(TransferApplyDto dto);
|
||||
|
||||
List<SelectDto> getProSelect(TransferApplyDto dto);
|
||||
|
||||
List<DaKyProFilesContentsDto> getTransferApplyFiles(TransferApplyDto dto);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,15 +3,14 @@ package com.bonus.web.service.impl;
|
|||
import com.bonus.common.core.domain.AjaxResult;
|
||||
import com.bonus.common.core.domain.entity.SysDept;
|
||||
import com.bonus.web.controller.tool.TreeBuilder;
|
||||
import com.bonus.web.domain.ArchivalCatalogueDto;
|
||||
import com.bonus.web.domain.SelectDto;
|
||||
import com.bonus.web.domain.TransferApplyDto;
|
||||
import com.bonus.web.domain.TransferFileDto;
|
||||
import com.bonus.web.domain.*;
|
||||
import com.bonus.web.mapper.TransferApplyMapper;
|
||||
import com.bonus.web.service.TransferApplyService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static com.bonus.common.utils.SecurityUtils.getLoginUser;
|
||||
|
|
@ -31,6 +30,7 @@ public class TransferApplyServiceImpl implements TransferApplyService {
|
|||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public AjaxResult save(TransferApplyDto dto) {
|
||||
try {
|
||||
dto.setAuditStatus("0");
|
||||
|
|
@ -112,4 +112,16 @@ public class TransferApplyServiceImpl implements TransferApplyService {
|
|||
public List<SelectDto> getProSelect(TransferApplyDto dto) {
|
||||
return transferApplyMapper.getProSelect(dto);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DaKyProFilesContentsDto> getTransferApplyFiles(TransferApplyDto dto) {
|
||||
List<String> contents = transferApplyMapper.getTransferApplyFilesContents(dto);
|
||||
List<DaKyProFilesContentsDto> list = new ArrayList<>();
|
||||
for (String content : contents) {
|
||||
dto.setParentId(content);
|
||||
List<DaKyProFilesContentsDto> dtos = transferApplyMapper.getTransferApplyFiles(content);
|
||||
list.addAll(dtos);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -281,31 +281,53 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
|
||||
<select id="list" resultType="com.bonus.web.domain.TransferApplyDto">
|
||||
SELECT
|
||||
id,
|
||||
pro_id AS proId,
|
||||
pro_name AS proName,
|
||||
single_pro_name AS singleProName,
|
||||
dept_id AS deptId,
|
||||
dept_name AS deptName,
|
||||
apply_user AS applyUser,
|
||||
apply_time AS applyTime,
|
||||
audit_status AS auditStatus,
|
||||
audit_opinion AS auditOpinion,
|
||||
transfer_status AS transferStatus,
|
||||
transfer_time AS transferTime,
|
||||
create_time AS createTime,
|
||||
update_time AS updateTime,
|
||||
create_user_id AS createUserId,
|
||||
create_user_name AS createUserName,
|
||||
update_user_name AS updateUserName,
|
||||
update_user_id AS updateUserId,
|
||||
del_flag AS delFlag
|
||||
FROM da_ky_transfer_apply
|
||||
where del_flag = '1'
|
||||
dkta.id,
|
||||
dkta.pro_id AS proId,
|
||||
dkta.pro_name AS proName,
|
||||
dkta.single_pro_name AS singleProName,
|
||||
dkta.dept_id AS deptId,
|
||||
dkta.dept_name AS deptName,
|
||||
dkta.apply_user AS applyUser,
|
||||
dkta.apply_time AS applyTime,
|
||||
dkta.audit_status AS auditStatus,
|
||||
dkta.audit_opinion AS auditOpinion,
|
||||
dkta.transfer_status AS transferStatus,
|
||||
dkta.transfer_time AS transferTime,
|
||||
dkta.create_time AS createTime,
|
||||
dkta.update_time AS updateTime,
|
||||
dkta.create_user_id AS createUserId,
|
||||
dkta.create_user_name AS createUserName,
|
||||
dkta.update_user_name AS updateUserName,
|
||||
dkta.update_user_id AS updateUserId,
|
||||
dkta.del_flag AS delFlag
|
||||
FROM da_ky_transfer_apply dkta
|
||||
left join da_ky_project dkp on dkta.pro_id = dkp.id
|
||||
where dkta.del_flag = '1'
|
||||
<if test="proId != null and proId != ''">
|
||||
and pro_id = #{proId}
|
||||
and dkta.pro_id = #{proId}
|
||||
</if>
|
||||
ORDER BY create_time DESC
|
||||
<if test="proName != null and proName != ''">
|
||||
and dkta.pro_name like concat('%',#{proName},'%')
|
||||
</if>
|
||||
<if test="singleProName != null and singleProName != ''">
|
||||
and dkta.single_pro_name like concat('%',#{singleProName},'%')
|
||||
</if>
|
||||
<if test="transfertTime != null and transfertTime != ''">
|
||||
and DATE(dkta.transfer_time) = #{transfertTime}
|
||||
</if>
|
||||
<if test="deptId != null and deptId != ''">
|
||||
and dkta.dept_id = #{deptId}
|
||||
</if>
|
||||
<if test="proType != null and proType != ''">
|
||||
and dkp.pro_type = #{proType}
|
||||
</if>
|
||||
<if test="voltageLevel != null and voltageLevel != ''">
|
||||
and dkp.voltage_level = #{voltageLevel}
|
||||
</if>
|
||||
<if test="auditStatus != null and auditStatus != ''">
|
||||
and dkta.audit_status = #{auditStatus}
|
||||
</if>
|
||||
ORDER BY dkta.create_time DESC
|
||||
</select>
|
||||
<select id="getTransferApply" resultType="com.bonus.web.domain.TransferApplyDto">
|
||||
SELECT
|
||||
|
|
@ -356,5 +378,69 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
WHERE del_flag = '0'
|
||||
and status = '0'
|
||||
</select>
|
||||
<select id="getTransferApplyFilesContents" resultType="java.lang.String">
|
||||
WITH RECURSIVE sub_tree AS (
|
||||
SELECT
|
||||
id,
|
||||
pro_id,
|
||||
level
|
||||
FROM da_ky_pro_files_contents
|
||||
WHERE id = #{id}
|
||||
AND pro_id = 1
|
||||
|
||||
UNION ALL
|
||||
|
||||
SELECT
|
||||
c.id,
|
||||
c.pro_id,
|
||||
c.level
|
||||
FROM da_ky_pro_files_contents c
|
||||
INNER JOIN sub_tree st ON c.parent_id = st.id
|
||||
WHERE c.level <= 4
|
||||
AND c.pro_id = 1
|
||||
)
|
||||
SELECT DISTINCT id
|
||||
FROM sub_tree
|
||||
WHERE level = 4
|
||||
ORDER BY id
|
||||
</select>
|
||||
<select id="getTransferApplyFiles" resultType="com.bonus.web.domain.DaKyProFilesContentsDto">
|
||||
SELECT
|
||||
dkpfc.id AS id,
|
||||
dkpfc.pro_id AS proId,
|
||||
dkpfc.content_name AS contentName,
|
||||
dkpfc.parent_id AS parentId,
|
||||
dkpfc.LEVEL AS LEVEL,
|
||||
dkpfc.sort AS sort,
|
||||
dkpfc.mark_code AS markCode,
|
||||
dkpfc.term AS term,
|
||||
dkpfc.unit_name AS unitName,
|
||||
CASE
|
||||
|
||||
WHEN dkpfc.data_source = '1' THEN
|
||||
'本系统上传'
|
||||
WHEN dkpfc.data_source = '2' THEN
|
||||
'智慧现场' ELSE ''
|
||||
END AS dataSource,
|
||||
dkpfc.is_unique AS isUnique,
|
||||
dkpfc.integrity_status AS integrityStatus,
|
||||
dkfs.id AS fileId,
|
||||
dkfs.file_name AS fileName,
|
||||
dkfs.create_time AS createTime,
|
||||
dkfs.source_file_name AS sourceFileName,
|
||||
dkfs.create_user_name AS createUserName
|
||||
FROM
|
||||
da_ky_pro_files_contents dkpfc
|
||||
LEFT JOIN da_ky_sys_file_source dkfs ON dkpfc.id = dkfs.business_id
|
||||
LEFT JOIN da_ky_transfer_file fs ON dkfs.id = fs.file_source_id
|
||||
WHERE
|
||||
dkpfc.del_flag = '1'
|
||||
AND dkpfc.parent_id = #{parentId}
|
||||
AND dkpfc.pro_id = #{proId}
|
||||
AND dkpfc.LEVEL = 5
|
||||
AND NOT EXISTS ( SELECT 1 FROM da_ky_transfer_file tf WHERE tf.file_source_id = dkfs.id )
|
||||
ORDER BY
|
||||
dkpfc.create_time DESC
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
|
|
|||
Loading…
Reference in New Issue