鉴定模块逻辑补全及修改sql保存期限.字典值

new
parent 48b265a850
commit d3b7f54bc6

@ -7,7 +7,7 @@ ALTER TABLE archives_borrow_apply ADD COLUMN `record_id` bigint(20) NULL DEFAULT
INSERT INTO `lyr-one`.`system_dict_type` ( `name`, `type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `deleted_time`) VALUES ( '', 'borrow_state', 0, NULL, '', '2023-10-19 14:38:49', '', '2023-10-19 14:38:49', b'0', '1970-01-01 00:00:00'); INSERT INTO `lyr-one`.`system_dict_type` ( `name`, `type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `deleted_time`) VALUES ( '', 'borrow_state', 0, NULL, '', '2023-10-19 14:38:49', '', '2023-10-19 14:38:49', b'0', '1970-01-01 00:00:00');
INSERT INTO `lyr-one`.`system_dict_data` ( `sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (0, '', '0', 'borrow_state', 0, 'default', '', NULL, '', '2023-10-19 14:40:16', '', '2023-10-19 14:40:16', b'0'); INSERT INTO `lyr-one`.`system_dict_data` ( `sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (0, '', '0', 'borrow_state', 0, 'default', '', NULL, '', '2023-10-19 14:40:16', '', '2023-10-19 14:40:16', b'0');
INSERT INTO `lyr-one`.`system_dict_data` (`sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (0, '', '1', 'borrow_state', 0, 'default', '', NULL, '', '2023-10-19 14:40:28', '', '2023-10-19 14:40:28', b'0'); INSERT INTO `lyr-one`.`system_dict_data` (`sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (0, '', '1', 'borrow_state', 0, 'default', '', NULL, '', '2023-10-19 14:40:28', '', '2023-10-19 14:40:28', b'0');
INSERT INTO `lyr-one`.`system_dict_type` ( `name`, `type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `deleted_time`) VALUES ('', 'way_type', 0, NULL, '', '2023-10-19 14:41:44', '', '2023-10-19 14:41:44', b'0', '1970-01-01 00:00:00'); INSERT INTO `lyr-one`.`system_dict_type` ( `name`, `type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `deleted_time`) VALUES ('', 'way_type', 0, NULL, '', '2023-10-19 14:41:44', '', '2023-10-19 14:41:44', b'0', '1970-01-01 00:00:00');
INSERT INTO `lyr-one`.`system_dict_data` (`sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES ( 0, '', '0', 'way_type', 0, 'default', '', NULL, '', '2023-10-19 14:41:59', '', '2023-10-19 14:41:59', b'0'); INSERT INTO `lyr-one`.`system_dict_data` (`sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES ( 0, '', '0', 'way_type', 0, 'default', '', NULL, '', '2023-10-19 14:41:59', '', '2023-10-19 14:41:59', b'0');
@ -16,3 +16,6 @@ INSERT INTO `lyr-one`.`system_dict_data` ( `sort`, `label`, `value`, `dict_type`
INSERT INTO `lyr-one`.`system_dict_type` ( `name`, `type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `deleted_time`) VALUES ('', 'media_type', 0, NULL, '', '2023-10-19 14:43:33', '', '2023-10-19 14:43:33', b'0', '1970-01-01 00:00:00'); INSERT INTO `lyr-one`.`system_dict_type` ( `name`, `type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `deleted_time`) VALUES ('', 'media_type', 0, NULL, '', '2023-10-19 14:43:33', '', '2023-10-19 14:43:33', b'0', '1970-01-01 00:00:00');
INSERT INTO `lyr-one`.`system_dict_data` (`sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES ( 0, '', '0', 'media_type', 0, 'default', '', NULL, '', '2023-10-19 14:43:49', '', '2023-10-19 14:43:49', b'0'); INSERT INTO `lyr-one`.`system_dict_data` (`sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES ( 0, '', '0', 'media_type', 0, 'default', '', NULL, '', '2023-10-19 14:43:49', '', '2023-10-19 14:43:49', b'0');
INSERT INTO `lyr-one`.`system_dict_data` (`sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (0, '', '1', 'media_type', 0, 'default', '', NULL, '', '2023-10-19 14:44:02', '', '2023-10-19 14:44:02', b'0'); INSERT INTO `lyr-one`.`system_dict_data` (`sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (0, '', '1', 'media_type', 0, 'default', '', NULL, '', '2023-10-19 14:44:02', '', '2023-10-19 14:44:02', b'0');
-- archives_authenticate
ALTER TABLE archives_authenticate MODIFY COLUMN time_limit varchar(20) DEFAULT NULL COMMENT '';

@ -1,10 +1,8 @@
package cn.iocoder.yudao.module.archives.controller.admin.authenticate; package cn.iocoder.yudao.module.archives.controller.admin.authenticate;
import cn.iocoder.yudao.module.archives.controller.admin.record.vo.RecordPageReqVO; import cn.iocoder.yudao.module.archives.controller.admin.record.vo.RecordPageReqVO;
import cn.iocoder.yudao.module.archives.controller.admin.record.vo.RecordUpdateReqVO;
import cn.iocoder.yudao.module.archives.dal.dataobject.record.RecordDO; import cn.iocoder.yudao.module.archives.dal.dataobject.record.RecordDO;
import cn.iocoder.yudao.module.archives.service.record.RecordService; import cn.iocoder.yudao.module.archives.service.record.RecordService;
import org.apache.poi.hssf.record.Record;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
@ -12,22 +10,16 @@ import org.springframework.security.access.prepost.PreAuthorize;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import javax.validation.constraints.*;
import javax.validation.*; import javax.validation.*;
import javax.servlet.http.*; import javax.servlet.http.*;
import java.util.*; import java.util.*;
import java.io.IOException; import java.io.IOException;
import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog; import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.*; import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.*;
import cn.iocoder.yudao.module.archives.controller.admin.authenticate.vo.*; import cn.iocoder.yudao.module.archives.controller.admin.authenticate.vo.*;
import cn.iocoder.yudao.module.archives.dal.dataobject.authenticate.AuthenticateDO; import cn.iocoder.yudao.module.archives.dal.dataobject.authenticate.AuthenticateDO;
import cn.iocoder.yudao.module.archives.convert.authenticate.AuthenticateConvert; import cn.iocoder.yudao.module.archives.convert.authenticate.AuthenticateConvert;
@ -66,7 +58,7 @@ public class AuthenticateController {
* @return * @return
*/ */
@PostMapping("/create/apply") @PostMapping("/create/apply")
@Operation(summary = "创建档案鉴定申请") @Operation(summary = "档案鉴定")
@PreAuthorize("@ss.hasPermission('archives:authenticate:create')") @PreAuthorize("@ss.hasPermission('archives:authenticate:create')")
public CommonResult<Long> createApply(@Valid @RequestBody List<AuthenticateCreateReqVO> createReqVO) { public CommonResult<Long> createApply(@Valid @RequestBody List<AuthenticateCreateReqVO> createReqVO) {
return success(authenticateService.createApply(createReqVO)); return success(authenticateService.createApply(createReqVO));

@ -30,8 +30,7 @@ public class AuthenticateBaseVO {
private String position; private String position;
@Schema(description = "保存期限") @Schema(description = "保存期限")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private String timeLimit;
private LocalDateTime timeLimit;
@Schema(description = "归档id", example = "4386") @Schema(description = "归档id", example = "4386")
private Integer recordId; private Integer recordId;

@ -31,7 +31,7 @@ public class AuthenticateExcelVO {
private String position; private String position;
@ExcelProperty("保存期限") @ExcelProperty("保存期限")
private LocalDateTime timeLimit; private String timeLimit;
@ExcelProperty("归档id") @ExcelProperty("归档id")
private Integer recordId; private Integer recordId;

@ -24,7 +24,7 @@ public class AuthenticateExportReqVO {
private String position; private String position;
@Schema(description = "保存期限") @Schema(description = "保存期限")
private LocalDateTime timeLimit; private String timeLimit;
@Schema(description = "归档id", example = "4386") @Schema(description = "归档id", example = "4386")
private Integer recordId; private Integer recordId;

@ -26,7 +26,7 @@ public class AuthenticatePageReqVO extends PageParam {
private String position; private String position;
@Schema(description = "保存期限") @Schema(description = "保存期限")
private LocalDateTime timeLimit; private String timeLimit;
@Schema(description = "归档id", example = "4386") @Schema(description = "归档id", example = "4386")
private Integer recordId; private Integer recordId;

@ -49,7 +49,7 @@ public class BorrowApplyController {
@Operation(summary = "更新档案借阅申请") @Operation(summary = "更新档案借阅申请")
@PreAuthorize("@ss.hasPermission('archives:borrow-apply:update')") @PreAuthorize("@ss.hasPermission('archives:borrow-apply:update')")
public CommonResult<String> updateBorrowApply(@Valid @RequestBody BorrowApplyUpdateReqVO updateReqVO) { public CommonResult<String> updateBorrowApply(@Valid @RequestBody BorrowApplyUpdateReqVO updateReqVO) {
return success(borrowApplyService.updateBorrowApply(updateReqVO); return borrowApplyService.updateBorrowApply(updateReqVO);
} }
@DeleteMapping("/delete") @DeleteMapping("/delete")

@ -1,5 +1,6 @@
package cn.iocoder.yudao.module.archives.controller.admin.record.vo; package cn.iocoder.yudao.module.archives.controller.admin.record.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import lombok.*; import lombok.*;
import java.util.*; import java.util.*;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
@ -114,4 +115,10 @@ public class RecordPageReqVO extends PageParam {
*/ */
private Long cabinetId; private Long cabinetId;
/**
*
*/
@TableField(exist = false)
private String authenticate;
} }

@ -44,7 +44,7 @@ public class AuthenticateDO extends BaseDO {
/** /**
* *
*/ */
private LocalDateTime timeLimit; private String timeLimit;
/** /**
* id * id
*/ */

@ -52,6 +52,40 @@ public interface RecordMapper extends BaseMapperX<RecordDO> {
.orderByDesc(RecordDO::getId)); .orderByDesc(RecordDO::getId));
} }
default PageResult<RecordDO> selectPageAuthenticate(RecordPageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<RecordDO>()
.eqIfPresent(RecordDO::getCompanyId, reqVO.getCompanyId())
.eqIfPresent(RecordDO::getCompany, reqVO.getCompany())
.eqIfPresent(RecordDO::getFrequency, reqVO.getFrequency())
.eqIfPresent(RecordDO::getFileType, reqVO.getFileType())
.eqIfPresent(RecordDO::getYear, reqVO.getYear())
.eqIfPresent(RecordDO::getPeriod, reqVO.getPeriod())
.eqIfPresent(RecordDO::getVouNum, reqVO.getVouNum())
.eqIfPresent(RecordDO::getCaseNum, reqVO.getCaseNum())
.eqIfPresent(RecordDO::getCatalogNum, reqVO.getCatalogNum())
.eqIfPresent(RecordDO::getFilesNum, reqVO.getFilesNum())
.eqIfPresent(RecordDO::getSite, reqVO.getSite())
.eqIfPresent(RecordDO::getFlowId, reqVO.getFlowId())
.betweenIfPresent(RecordDO::getCreateTime, reqVO.getCreateTime())
.eqIfPresent(RecordDO::getStatus, reqVO.getStatus())
.eqIfPresent(RecordDO::getNote, reqVO.getNote())
.eqIfPresent(RecordDO::getFileStatus, reqVO.getFileStatus())
.eqIfPresent(RecordDO::getBorrowStatus, reqVO.getBorrowStatus())
.eqIfPresent(RecordDO::getRemark, reqVO.getRemark())
.betweenIfPresent(RecordDO::getRecordTime, reqVO.getRecordTime())
.eqIfPresent(RecordDO::getDeptId, reqVO.getDeptId())
.likeIfPresent(RecordDO::getDeptName, reqVO.getDeptName())
.eqIfPresent(RecordDO::getAttr1, reqVO.getAttr1())
.eqIfPresent(RecordDO::getAttr2, reqVO.getAttr2())
.eqIfPresent(RecordDO::getAttr3, reqVO.getAttr3())
.eqIfPresent(RecordDO::getAttr4, reqVO.getAttr4())
.eqIfPresent(RecordDO::getUserId, reqVO.getUserId())
.eqIfPresent(RecordDO::getCreateBy, reqVO.getCreateBy())
.orderByDesc(RecordDO::getId)
.isNull(RecordDO::getIdentifyStatus));
}
default List<RecordDO> selectList(RecordExportReqVO reqVO) { default List<RecordDO> selectList(RecordExportReqVO reqVO) {
return selectList(new LambdaQueryWrapperX<RecordDO>() return selectList(new LambdaQueryWrapperX<RecordDO>()
.eqIfPresent(RecordDO::getCompanyId, reqVO.getCompanyId()) .eqIfPresent(RecordDO::getCompanyId, reqVO.getCompanyId())

@ -68,7 +68,7 @@ public interface AuthenticateService {
List<AuthenticateDO> getAuthenticateList(AuthenticateExportReqVO exportReqVO); List<AuthenticateDO> getAuthenticateList(AuthenticateExportReqVO exportReqVO);
/** /**
* *
* @param createReqVO * @param createReqVO
* @return * @return
*/ */

@ -1,8 +1,10 @@
package cn.iocoder.yudao.module.archives.service.authenticate; package cn.iocoder.yudao.module.archives.service.authenticate;
import cn.hutool.core.date.DateTime;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.archives.dal.dataobject.record.RecordDO; import cn.iocoder.yudao.module.archives.dal.dataobject.record.RecordDO;
import cn.iocoder.yudao.module.archives.dal.mysql.record.RecordMapper; import cn.iocoder.yudao.module.archives.dal.mysql.record.RecordMapper;
import com.alibaba.druid.sql.visitor.functions.Now;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.extension.conditions.update.LambdaUpdateChainWrapper; import com.baomidou.mybatisplus.extension.conditions.update.LambdaUpdateChainWrapper;
import org.apache.poi.hssf.record.Record; import org.apache.poi.hssf.record.Record;
@ -12,6 +14,7 @@ import javax.annotation.Resource;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import java.time.LocalDateTime;
import java.util.*; import java.util.*;
import cn.iocoder.yudao.module.archives.controller.admin.authenticate.vo.*; import cn.iocoder.yudao.module.archives.controller.admin.authenticate.vo.*;
import cn.iocoder.yudao.module.archives.dal.dataobject.authenticate.AuthenticateDO; import cn.iocoder.yudao.module.archives.dal.dataobject.authenticate.AuthenticateDO;
@ -108,6 +111,7 @@ public class AuthenticateServiceImpl implements AuthenticateService {
vo.setType(record.getFileType()); vo.setType(record.getFileType());
vo.setPosition(record.getSite()); vo.setPosition(record.getSite());
AuthenticateDO authenticate = AuthenticateConvert.INSTANCE.convert(vo); AuthenticateDO authenticate = AuthenticateConvert.INSTANCE.convert(vo);
authenticate.setDate(LocalDateTime.now());
//新增鉴定申请记录 //新增鉴定申请记录
authenticateMapper.insert(authenticate); authenticateMapper.insert(authenticate);
} }

@ -67,7 +67,19 @@ public class BorrowApplyServiceImpl implements BorrowApplyService {
BeanUtils.copyProperties(record,recordUpdateReqVO); BeanUtils.copyProperties(record,recordUpdateReqVO);
if (StringUtils.isNotNull(updateReqVO.getBorrowState())){ if (StringUtils.isNotNull(updateReqVO.getBorrowState())){
if (record.getBorrowStatus().equals("0")){ //驳回状态处理
if (updateReqVO.getBorrowState().equals("1")){
recordUpdateReqVO.setBorrowStatus(updateReqVO.getBorrowState());
recordService.updateRecord(recordUpdateReqVO);
// 校验存在
validateBorrowApplyExists(updateReqVO.getId());
// 更新
BorrowApplyDO updateObj = BorrowApplyConvert.INSTANCE.convert(updateReqVO);
borrowApplyMapper.updateById(updateObj);
return CommonResult.success("驳回成功");
}
//已借阅 和 归还状态 处理
if (record.getBorrowStatus().equals("0") && !updateReqVO.getBorrowState().equals("2")){
return CommonResult.error("档案已被借阅"); return CommonResult.error("档案已被借阅");
} }
if (updateReqVO.getBorrowState().equals("2")) { if (updateReqVO.getBorrowState().equals("2")) {

@ -1,5 +1,6 @@
package cn.iocoder.yudao.module.archives.service.record; package cn.iocoder.yudao.module.archives.service.record;
import cn.iocoder.yudao.framework.common.util.string.StringUtils;
import cn.iocoder.yudao.framework.datapermission.core.annotation.DataPermission; import cn.iocoder.yudao.framework.datapermission.core.annotation.DataPermission;
import cn.iocoder.yudao.framework.datapermission.core.rule.dept.DeptDataPermissionRule; import cn.iocoder.yudao.framework.datapermission.core.rule.dept.DeptDataPermissionRule;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
@ -201,6 +202,10 @@ public class RecordServiceImpl implements RecordService {
@Override @Override
public PageResult<RecordDO> getRecordPage(RecordPageReqVO pageReqVO) { public PageResult<RecordDO> getRecordPage(RecordPageReqVO pageReqVO) {
// 这里加入authenticate字段区分是归档台账的调用接口还是鉴定调用接口 鉴定接口只查询未鉴定的归档台账
if (StringUtils.isNotNull(pageReqVO.getAuthenticate())){
return recordMapper.selectPageAuthenticate(pageReqVO);
}
return recordMapper.selectPage(pageReqVO); return recordMapper.selectPage(pageReqVO);
} }

Loading…
Cancel
Save