Merge remote-tracking branch 'origin/main'

new
commit 1d5ff3f1c5

@ -0,0 +1,71 @@
--
INSERT INTO `bpm_process_definition_ext`(`id`, `process_definition_id`, `model_id`, `description`, `form_type`, `form_id`, `form_conf`, `form_fields`, `form_custom_create_path`, `form_custom_view_path`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (146, 'archives_turn_over:1:5616e48d-520c-11ee-a1f0-00a6230850b9', '00380358-520c-11ee-a1f0-00a6230850b9', NULL, 10, 1, '{\"formRef\":\"elForm\",\"formModel\":\"formData\",\"size\":\"medium\",\"labelPosition\":\"right\",\"labelWidth\":100,\"formRules\":\"rules\",\"gutter\":15,\"disabled\":false,\"span\":24,\"formBtns\":true}', '[\"{\\\"__config__\\\":{\\\"label\\\":\\\"单行文本\\\",\\\"labelWidth\\\":null,\\\"showLabel\\\":true,\\\"changeTag\\\":true,\\\"tag\\\":\\\"el-input\\\",\\\"tagIcon\\\":\\\"input\\\",\\\"required\\\":true,\\\"layout\\\":\\\"colFormItem\\\",\\\"span\\\":24,\\\"document\\\":\\\"https://element.eleme.cn/#/zh-CN/component/input\\\",\\\"regList\\\":[],\\\"formId\\\":101,\\\"renderKey\\\":\\\"1011694592250766\\\"},\\\"__slot__\\\":{\\\"prepend\\\":\\\"\\\",\\\"append\\\":\\\"\\\"},\\\"placeholder\\\":\\\"请输入单行文本\\\",\\\"style\\\":{\\\"width\\\":\\\"100%\\\"},\\\"clearable\\\":true,\\\"prefix-icon\\\":\\\"\\\",\\\"suffix-icon\\\":\\\"\\\",\\\"maxlength\\\":null,\\\"show-word-limit\\\":false,\\\"readonly\\\":false,\\\"disabled\\\":false,\\\"__vModel__\\\":\\\"field101\\\"}\"]', NULL, NULL, '', '2023-09-13 16:05:43', '', '2023-09-13 16:05:43', b'0', 1);
INSERT INTO `bpm_process_definition_ext`(`id`, `process_definition_id`, `model_id`, `description`, `form_type`, `form_id`, `form_conf`, `form_fields`, `form_custom_create_path`, `form_custom_view_path`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (147, 'archives_turn_over:2:010b6e11-520e-11ee-a1f0-00a6230850b9', '00380358-520c-11ee-a1f0-00a6230850b9', NULL, 10, 1, '{\"formRef\":\"elForm\",\"formModel\":\"formData\",\"size\":\"medium\",\"labelPosition\":\"right\",\"labelWidth\":100,\"formRules\":\"rules\",\"gutter\":15,\"disabled\":false,\"span\":24,\"formBtns\":true}', '[\"{\\\"__config__\\\":{\\\"label\\\":\\\"单行文本\\\",\\\"labelWidth\\\":null,\\\"showLabel\\\":true,\\\"changeTag\\\":true,\\\"tag\\\":\\\"el-input\\\",\\\"tagIcon\\\":\\\"input\\\",\\\"required\\\":true,\\\"layout\\\":\\\"colFormItem\\\",\\\"span\\\":24,\\\"document\\\":\\\"https://element.eleme.cn/#/zh-CN/component/input\\\",\\\"regList\\\":[],\\\"formId\\\":101,\\\"renderKey\\\":\\\"1011694592250766\\\"},\\\"__slot__\\\":{\\\"prepend\\\":\\\"\\\",\\\"append\\\":\\\"\\\"},\\\"placeholder\\\":\\\"请输入单行文本\\\",\\\"style\\\":{\\\"width\\\":\\\"100%\\\"},\\\"clearable\\\":true,\\\"prefix-icon\\\":\\\"\\\",\\\"suffix-icon\\\":\\\"\\\",\\\"maxlength\\\":null,\\\"show-word-limit\\\":false,\\\"readonly\\\":false,\\\"disabled\\\":false,\\\"__vModel__\\\":\\\"field101\\\"}\"]', NULL, NULL, '', '2023-09-13 16:17:40', '', '2023-09-13 16:17:40', b'0', 1);
INSERT INTO `bpm_task_assign_rule`(`id`, `model_id`, `process_definition_id`, `task_definition_key`, `type`, `options`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (293, '00380358-520c-11ee-a1f0-00a6230850b9', '', 'Activity_1du9v0u', 30, '[1]', '', '2023-09-13 16:05:36', '', '2023-09-13 16:05:36', b'0', 1);
INSERT INTO `bpm_task_assign_rule`(`id`, `model_id`, `process_definition_id`, `task_definition_key`, `type`, `options`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (294, '00380358-520c-11ee-a1f0-00a6230850b9', 'archives_turn_over:1:5616e48d-520c-11ee-a1f0-00a6230850b9', 'Activity_1du9v0u', 30, '[1]', '', '2023-09-13 16:05:43', '', '2023-09-13 16:05:43', b'0', 1);
INSERT INTO `bpm_task_assign_rule`(`id`, `model_id`, `process_definition_id`, `task_definition_key`, `type`, `options`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (295, '00380358-520c-11ee-a1f0-00a6230850b9', '', 'audit1', 30, '[1]', '', '2023-09-13 16:17:33', '', '2023-09-13 16:17:33', b'0', 1);
INSERT INTO `bpm_task_assign_rule`(`id`, `model_id`, `process_definition_id`, `task_definition_key`, `type`, `options`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (296, '00380358-520c-11ee-a1f0-00a6230850b9', 'archives_turn_over:2:010b6e11-520e-11ee-a1f0-00a6230850b9', 'audit1', 30, '[1]', '', '2023-09-13 16:17:40', '', '2023-09-13 16:17:40', b'0', 1);
INSERT INTO `act_re_deployment`(`ID_`, `NAME_`, `CATEGORY_`, `KEY_`, `TENANT_ID_`, `DEPLOY_TIME_`, `DERIVED_FROM_`, `DERIVED_FROM_ROOT_`, `PARENT_DEPLOYMENT_ID_`, `ENGINE_VERSION_`) VALUES ('00fe75be-520e-11ee-a1f0-00a6230850b9', '', '1', 'archives_turn_over', '1', '2023-09-13 16:17:39.476', NULL, NULL, '00fe75be-520e-11ee-a1f0-00a6230850b9', NULL);
INSERT INTO `act_ge_bytearray`(`ID_`, `REV_`, `NAME_`, `DEPLOYMENT_ID_`, `BYTES_`, `GENERATED_`) VALUES ('4306ac99-520c-11ee-a1f0-00a6230850b9', 3, 'source', NULL, 0x3C3F786D6C2076657273696F6E3D22312E302220656E636F64696E673D225554462D38223F3E0A3C62706D6E323A646566696E6974696F6E7320786D6C6E733A7873693D22687474703A2F2F7777772E77332E6F72672F323030312F584D4C536368656D612D696E7374616E63652220786D6C6E733A62706D6E323D22687474703A2F2F7777772E6F6D672E6F72672F737065632F42504D4E2F32303130303532342F4D4F44454C2220786D6C6E733A62706D6E64693D22687474703A2F2F7777772E6F6D672E6F72672F737065632F42504D4E2F32303130303532342F44492220786D6C6E733A64633D22687474703A2F2F7777772E6F6D672E6F72672F737065632F44442F32303130303532342F44432220786D6C6E733A64693D22687474703A2F2F7777772E6F6D672E6F72672F737065632F44442F32303130303532342F4449222069643D226469616772616D5F50726F636573735F3136393435393232393336373722207461726765744E616D6573706163653D22687474703A2F2F666C6F7761626C652E6F72672F62706D6E223E3C62706D6E323A70726F636573732069643D2261726368697665735F7475726E5F6F76657222206E616D653D22E6A1A3E6A188E7A7BBE4BAA4E794B3E8AFB7E58D952220697345786563757461626C653D2274727565223E3C62706D6E323A73746172744576656E742069643D224576656E745F30746C62383763223E3C62706D6E323A6F7574676F696E673E466C6F775F3173756A6579793C2F62706D6E323A6F7574676F696E673E3C2F62706D6E323A73746172744576656E743E3C62706D6E323A757365725461736B2069643D2261756469743122206E616D653D22E88A8BE98193223E3C62706D6E323A696E636F6D696E673E466C6F775F3173756A6579793C2F62706D6E323A696E636F6D696E673E3C62706D6E323A6F7574676F696E673E466C6F775F303665367636793C2F62706D6E323A6F7574676F696E673E3C2F62706D6E323A757365725461736B3E3C62706D6E323A73657175656E6365466C6F772069643D22466C6F775F3173756A6579792220736F757263655265663D224576656E745F30746C6238376322207461726765745265663D2261756469743122202F3E3C62706D6E323A656E644576656E742069643D224576656E745F3076616465646E223E3C62706D6E323A696E636F6D696E673E466C6F775F303665367636793C2F62706D6E323A696E636F6D696E673E3C2F62706D6E323A656E644576656E743E3C62706D6E323A73657175656E6365466C6F772069643D22466C6F775F303665367636792220736F757263655265663D2261756469743122207461726765745265663D224576656E745F3076616465646E22202F3E3C2F62706D6E323A70726F636573733E3C62706D6E64693A42504D4E4469616772616D2069643D2242504D4E4469616772616D5F31223E3C62706D6E64693A42504D4E506C616E652069643D2261726368697665735F7475726E5F6F7665725F6469222062706D6E456C656D656E743D2261726368697665735F7475726E5F6F766572223E3C62706D6E64693A42504D4E456467652069643D22466C6F775F303665367636795F6469222062706D6E456C656D656E743D22466C6F775F30366536763679223E3C64693A776179706F696E7420783D223533302220793D2232373022202F3E3C64693A776179706F696E7420783D223630322220793D2232373022202F3E3C2F62706D6E64693A42504D4E456467653E3C62706D6E64693A42504D4E456467652069643D22466C6F775F3173756A6579795F6469222062706D6E456C656D656E743D22466C6F775F3173756A657979223E3C64693A776179706F696E7420783D223335382220793D2232373022202F3E3C64693A776179706F696E7420783D223433302220793D2232373022202F3E3C2F62706D6E64693A42504D4E456467653E3C62706D6E64693A42504D4E53686170652069643D224576656E745F30746C623837635F6469222062706D6E456C656D656E743D224576656E745F30746C62383763223E3C64633A426F756E647320783D223332322220793D22323532222077696474683D22333622206865696768743D22333622202F3E3C2F62706D6E64693A42504D4E53686170653E3C62706D6E64693A42504D4E53686170652069643D226175646974315F6469222062706D6E456C656D656E743D22617564697431223E3C64633A426F756E647320783D223433302220793D22323330222077696474683D2231303022206865696768743D22383022202F3E3C2F62706D6E64693A42504D4E53686170653E3C62706D6E64693A42504D4E53686170652069643D224576656E745F3076616465646E5F6469222062706D6E456C656D656E743D224576656E745F3076616465646E223E3C64633A426F756E647320783D223630322220793D22323532222077696474683D22333622206865696768743D22333622202F3E3C2F62706D6E64693A42504D4E53686170653E3C2F62706D6E64693A42504D4E506C616E653E3C2F62706D6E64693A42504D4E4469616772616D3E3C2F62706D6E323A646566696E6974696F6E733E, NULL);
INSERT INTO `act_re_deployment`(`ID_`, `NAME_`, `CATEGORY_`, `KEY_`, `TENANT_ID_`, `DEPLOY_TIME_`, `DERIVED_FROM_`, `DERIVED_FROM_ROOT_`, `PARENT_DEPLOYMENT_ID_`, `ENGINE_VERSION_`) VALUES ('560187ca-520c-11ee-a1f0-00a6230850b9', '', '1', 'archives_turn_over', '1', '2023-09-13 16:05:43.109', NULL, NULL, '560187ca-520c-11ee-a1f0-00a6230850b9', NULL);
INSERT INTO `act_re_model`(`ID_`, `REV_`, `NAME_`, `KEY_`, `CATEGORY_`, `CREATE_TIME_`, `LAST_UPDATE_TIME_`, `VERSION_`, `META_INFO_`, `DEPLOYMENT_ID_`, `EDITOR_SOURCE_VALUE_ID_`, `EDITOR_SOURCE_EXTRA_VALUE_ID_`, `TENANT_ID_`) VALUES ('00380358-520c-11ee-a1f0-00a6230850b9', 8, '', 'archives_turn_over', '1', '2023-09-13 16:03:19.182', '2023-09-13 16:17:39.588', 1, '{\"description\":null,\"formType\":10,\"formId\":1,\"formCustomCreatePath\":null,\"formCustomViewPath\":null}', '00fe75be-520e-11ee-a1f0-00a6230850b9', '4306ac99-520c-11ee-a1f0-00a6230850b9', NULL, '1');
INSERT INTO `bpm_form`(`id`, `name`, `status`, `conf`, `fields`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (1, 'ddx', 0, '{\"formRef\":\"elForm\",\"formModel\":\"formData\",\"size\":\"medium\",\"labelPosition\":\"right\",\"labelWidth\":100,\"formRules\":\"rules\",\"gutter\":15,\"disabled\":false,\"span\":24,\"formBtns\":true}', '[\"{\\\"__config__\\\":{\\\"label\\\":\\\"单行文本\\\",\\\"labelWidth\\\":null,\\\"showLabel\\\":true,\\\"changeTag\\\":true,\\\"tag\\\":\\\"el-input\\\",\\\"tagIcon\\\":\\\"input\\\",\\\"required\\\":true,\\\"layout\\\":\\\"colFormItem\\\",\\\"span\\\":24,\\\"document\\\":\\\"https://element.eleme.cn/#/zh-CN/component/input\\\",\\\"regList\\\":[],\\\"formId\\\":101,\\\"renderKey\\\":\\\"1011694592250766\\\"},\\\"__slot__\\\":{\\\"prepend\\\":\\\"\\\",\\\"append\\\":\\\"\\\"},\\\"placeholder\\\":\\\"请输入单行文本\\\",\\\"style\\\":{\\\"width\\\":\\\"100%\\\"},\\\"clearable\\\":true,\\\"prefix-icon\\\":\\\"\\\",\\\"suffix-icon\\\":\\\"\\\",\\\"maxlength\\\":null,\\\"show-word-limit\\\":false,\\\"readonly\\\":false,\\\"disabled\\\":false,\\\"__vModel__\\\":\\\"field101\\\"}\"]', NULL, '', '2023-09-13 16:04:19', '', '2023-09-13 16:04:19', b'0', 1);
INSERT INTO `bpm_task_assign_rule`(`id`, `model_id`, `process_definition_id`, `task_definition_key`, `type`, `options`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (297, 'f939dc13-521a-11ee-adcb-00a6230850b9', '', 'Activity_0b7iisg', 30, '[1]', '', '2023-09-13 17:55:26', '', '2023-09-13 17:55:26', b'0', 1);
INSERT INTO bpm_task_assign_rule (model_id, process_definition_id, task_definition_key, type, options, create_time, update_time, tenant_id) VALUES ('00380358-520c-11ee-a1f0-00a6230850b9', 'archives_turn_over:1:564e23d3-52d4-11ee-94c1-00a6230850b9', 'audit1', 30, '[1]', '2023-09-14 15:57:23.024', '2023-09-14 15:57:23.024', 1)
--
-- ----------------------------
-- Table structure for archives_turn_over
-- ----------------------------
DROP TABLE IF EXISTS `archives_turn_over`;
CREATE TABLE `archives_turn_over` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID',
`apply_no` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '',
`turn_date` datetime(0) NULL DEFAULT NULL COMMENT '',
`turn_explain` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '',
`output_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '',
`output_name_id` bigint(20) NULL DEFAULT NULL COMMENT 'ID',
`input_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '',
`input_name_id` bigint(20) NULL DEFAULT NULL COMMENT 'ID',
`user_id` bigint(20) NULL DEFAULT NULL COMMENT 'ID',
`deleted` bit(1) NULL DEFAULT b'0' COMMENT '',
`updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '',
`update_time` datetime(0) NULL DEFAULT NULL COMMENT '',
`dept_id` bigint(20) NULL DEFAULT NULL COMMENT 'ID',
`dept_name` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '',
`company_id` bigint(20) NULL DEFAULT NULL COMMENT 'ID',
`company` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '',
`remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '',
`tenant_id` bigint(20) NOT NULL COMMENT '/',
`create_by` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '',
`from_organization_id` bigint(20) NULL DEFAULT NULL COMMENT 'ID',
`from_depot_id` bigint(20) NULL DEFAULT NULL COMMENT 'ID',
`from_cabinet_id` bigint(20) NULL DEFAULT NULL COMMENT 'ID',
`to_organization_id` bigint(20) NULL DEFAULT NULL COMMENT 'ID',
`to_depot_id` bigint(20) NULL DEFAULT NULL COMMENT 'ID',
`to_cabinet_id` bigint(20) NULL DEFAULT NULL COMMENT 'ID',
`attr1` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '1',
`attr2` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '2',
`attr3` int(11) NULL DEFAULT NULL COMMENT '3',
`attr4` int(11) NULL DEFAULT NULL COMMENT '4',
`create_by_id` bigint(20) NOT NULL COMMENT 'id',
`amount` int(11) NULL DEFAULT NULL COMMENT '',
`create_time` datetime(0) NULL DEFAULT NULL COMMENT '',
`process_instance_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '',
`bill_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '',
`status` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 5 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '' ROW_FORMAT = Dynamic;
SET FOREIGN_KEY_CHECKS = 1;
--
SELECT * FROM system_menu WHERE name='';
SET @menuId = LAST_INSERT_ID();
INSERT INTO `lyr-one`.`system_menu`(`name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES ('', '', 2, 0, @menuId, 'turn-over', '', 'archives/turnOver/index', 'TurnOver', 0, b'1', b'1', b'1', '', '2023-09-13 14:05:07', '', '2023-09-13 14:10:33', b'0');
SET @menuId2 = LAST_INSERT_ID();
INSERT INTO `lyr-one`.`system_menu`(`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (NULL, '', 'archives:turn-over:query', 3, 1, @menuId2, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2023-09-13 14:05:07', '', '2023-09-13 14:05:07', b'0');
INSERT INTO `lyr-one`.`system_menu`(`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (NULL, '', 'archives:turn-over:create', 3, 2, @menuId2, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2023-09-13 14:05:07', '', '2023-09-13 14:05:07', b'0');
INSERT INTO `lyr-one`.`system_menu`(`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (NULL, '', 'archives:turn-over:update', 3, 3, @menuId2, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2023-09-13 14:05:07', '', '2023-09-13 14:05:07', b'0');
INSERT INTO `lyr-one`.`system_menu`(`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (NULL, '', 'archives:turn-over:delete', 3, 4, @menuId2, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2023-09-13 14:05:07', '', '2023-09-13 14:05:07', b'0');
INSERT INTO `lyr-one`.`system_menu`(`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (NULL, '', 'archives:turn-over:export', 3, 5, @menuId2, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2023-09-13 14:05:07', '', '2023-09-13 14:05:07', b'0');

@ -0,0 +1,30 @@
package cn.iocoder.yudao.module.archives.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
*
*/
@AllArgsConstructor
@Getter
public enum ArchivesStatusEnum {
NOSUBMIT("0", "未提交"),
PROCESS("1", "待审核"),
APPROVE("2", "通过"),
REJECT("3", "驳回"),
CANCEL("4", "取消");
/**
*
*/
private final String value;
/**
*
*/
private final String name;
}

@ -0,0 +1,33 @@
package cn.iocoder.yudao.module.archives.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
*
*/
@AllArgsConstructor
@Getter
public enum BillTypeEnum {
DAYJ("DAYJ", "档案移交申请单"),
;
/**
*
*/
private final String value;
/**
*
*/
private final String name;
public static String getNameByValue(String targetValue) {
for (BillTypeEnum billTypeEnum : BillTypeEnum.values()) {
if (billTypeEnum.getValue().equals(targetValue)) {
return billTypeEnum.getName();
}
}
return null;
}
}

@ -4,6 +4,7 @@ import cn.iocoder.yudao.framework.common.exception.ErrorCode;
public interface ErrorCodeConstants {
ErrorCode RECORD_NOT_EXISTS = new ErrorCode(200100, "归档不存在");
ErrorCode CODE_RULE_NOT_EXISTS = new ErrorCode(300100, "编码不存在");
ErrorCode TURN_OVER_NOT_EXISTS = new ErrorCode(400100, "移交管理不存在");
ErrorCode BORROW_APPLY_NOT_EXISTS = new ErrorCode(300200,"借阅申请不存在");

@ -18,6 +18,13 @@
</description>
<dependencies>
<dependency>
<groupId>cn.iocoder.boot</groupId>
<artifactId>yudao-module-bpm-api</artifactId>
<version>${revision}</version>
</dependency>
<dependency>
<groupId>cn.iocoder.boot</groupId>
<artifactId>yudao-spring-boot-starter-biz-tenant</artifactId>
@ -83,6 +90,12 @@
<version>1.7.3-snapshot</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>cn.iocoder.boot</groupId>
<artifactId>yudao-module-bpm-biz</artifactId>
<version>1.7.3-snapshot</version>
<scope>compile</scope>
</dependency>
</dependencies>
</project>

@ -0,0 +1,137 @@
package cn.iocoder.yudao.module.archives.controller.admin.turnover;
import cn.hutool.core.collection.CollUtil;
import cn.iocoder.yudao.module.bpm.controller.admin.task.vo.task.BpmTaskRespVO;
import cn.iocoder.yudao.module.bpm.service.task.BpmTaskService;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.security.access.prepost.PreAuthorize;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Operation;
import javax.validation.constraints.*;
import javax.validation.*;
import javax.servlet.http.*;
import java.util.*;
import java.io.IOException;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.*;
import cn.iocoder.yudao.module.archives.controller.admin.turnover.vo.*;
import cn.iocoder.yudao.module.archives.dal.dataobject.turnover.TurnOverDO;
import cn.iocoder.yudao.module.archives.convert.turnover.TurnOverConvert;
import cn.iocoder.yudao.module.archives.service.turnover.TurnOverService;
@Tag(name = "管理后台 - 移交")
@RestController
@RequestMapping("/archives/turn-over")
@Validated
public class TurnOverController {
@Resource
private TurnOverService turnOverService;
@Resource
private BpmTaskService taskService;
@PostMapping("/create")
@Operation(summary = "创建移交")
@PreAuthorize("@ss.hasPermission('archives:turn-over:create')")
public CommonResult createTurnOver(@Valid @RequestBody TurnOverCreateReqVO createReqVO) {
return turnOverService.createTurnOver(createReqVO);
}
@PutMapping("/update")
@Operation(summary = "更新移交")
@PreAuthorize("@ss.hasPermission('archives:turn-over:update')")
public CommonResult<Boolean> updateTurnOver(@Valid @RequestBody TurnOverUpdateReqVO updateReqVO) {
turnOverService.updateTurnOver(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除移交")
@Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('archives:turn-over:delete')")
public CommonResult<Boolean> deleteTurnOver(@RequestParam("id") Long id) {
turnOverService.deleteTurnOver(id);
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获得移交")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('archives:turn-over:query')")
public CommonResult<TurnOverRespVO> getTurnOver(@RequestParam("id") Long id) {
TurnOverDO turnOver = turnOverService.getTurnOver(id);
return success(TurnOverConvert.INSTANCE.convert(turnOver));
}
@GetMapping("/list")
@Operation(summary = "获得移交列表")
@Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048")
@PreAuthorize("@ss.hasPermission('archives:turn-over:query')")
public CommonResult<List<TurnOverRespVO>> getTurnOverList(@RequestParam("ids") Collection<Long> ids) {
List<TurnOverDO> list = turnOverService.getTurnOverList(ids);
return success(TurnOverConvert.INSTANCE.convertList(list));
}
@GetMapping("/page")
@Operation(summary = "获得移交分页")
@PreAuthorize("@ss.hasPermission('archives:turn-over:query')")
public CommonResult<PageResult<TurnOverRespVO>> getTurnOverPage(@Valid TurnOverPageReqVO pageVO) {
PageResult<TurnOverDO> pageResult = turnOverService.getTurnOverPage(pageVO);
List<TurnOverDO> list = pageResult.getList();
if (CollUtil.isNotEmpty(list)) {
for (TurnOverDO t : list) {
if (t.getProcessInstanceId() != null) {
List<BpmTaskRespVO> taskListByProcessInstanceId = taskService.getTaskListByProcessInstanceId(t.getProcessInstanceId());
Optional<BpmTaskRespVO> latestTask = taskListByProcessInstanceId.stream()
.filter(task -> task.getEndTime() != null)
.sorted(Comparator.comparing(BpmTaskRespVO::getEndTime).reversed())
.findFirst();
if (latestTask.isPresent()) {
BpmTaskRespVO latest = latestTask.get();
// 找到了endTime最新的任务
TurnOverUpdateReqVO updateReqVO = new TurnOverUpdateReqVO();
updateReqVO.setId(t.getId());
if (!latest.getResult().toString().equals(t.getStatus())) {
updateReqVO.setStatus(latest.getResult().toString());
turnOverService.updateTurnOver(updateReqVO);
}
}
}
}
PageResult<TurnOverDO> pageResult2 = turnOverService.getTurnOverPage(pageVO);
return success(TurnOverConvert.INSTANCE.convertPage(pageResult2));
}
return success(TurnOverConvert.INSTANCE.convertPage(pageResult));
}
@GetMapping("/export-excel")
@Operation(summary = "导出移交 Excel")
@PreAuthorize("@ss.hasPermission('archives:turn-over:export')")
@OperateLog(type = EXPORT)
public void exportTurnOverExcel(@Valid TurnOverExportReqVO exportReqVO,
HttpServletResponse response) throws IOException {
List<TurnOverDO> list = turnOverService.getTurnOverList(exportReqVO);
// 导出 Excel
List<TurnOverExcelVO> datas = TurnOverConvert.INSTANCE.convertList02(list);
ExcelUtils.write(response, "移交.xls", "数据", TurnOverExcelVO.class, datas);
}
}

@ -0,0 +1,97 @@
package cn.iocoder.yudao.module.archives.controller.admin.turnover.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import javax.validation.constraints.*;
import org.springframework.format.annotation.DateTimeFormat;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
/**
* Base VO VO 使
* VO Swagger
*/
@Data
public class TurnOverBaseVO {
@Schema(description = "移交单号")
private String applyNo;
@Schema(description = "移交日期")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime turnDate;
@Schema(description = "移交说明")
private String turnExplain;
@Schema(description = "移交人", example = "张三")
private String outputName;
@Schema(description = "移交人ID", example = "24105")
private Long outputNameId;
@Schema(description = "签收人", example = "李四")
private String inputName;
@Schema(description = "签收人ID", example = "28017")
private Long inputNameId;
@Schema(description = "用户ID", example = "23669")
private Long userId;
@Schema(description = "所属部门ID", example = "27304")
private Long deptId;
@Schema(description = "所属部门", example = "张三")
private String deptName;
@Schema(description = "业务实体ID", example = "13936")
private Long companyId;
@Schema(description = "业务实体")
private String company;
@Schema(description = "备注", example = "随便")
private String remark;
@Schema(description = "制单人")
private String createBy;
@Schema(description = "从立档单位ID", example = "12461")
private Long fromOrganizationId;
@Schema(description = "从库房ID", example = "31262")
private Long fromDepotId;
@Schema(description = "从档案柜ID", example = "19367")
private Long fromCabinetId;
@Schema(description = "到立档单位ID", example = "18409")
private Long toOrganizationId;
@Schema(description = "到库房ID", example = "17779")
private Long toDepotId;
@Schema(description = "到档案柜ID", example = "24097")
private Long toCabinetId;
@Schema(description = "制单人id", requiredMode = Schema.RequiredMode.REQUIRED, example = "24299")
private Long createById;
@Schema(description = "案卷数量")
private Integer amount;
@Schema(description = "流程实例的编号", example = "705")
private String processInstanceId;
@Schema(description = "申请类型", example = "2")
private String billType;
@Schema(description = "状态", example = "1")
private String status;
}

@ -0,0 +1,21 @@
package cn.iocoder.yudao.module.archives.controller.admin.turnover.vo;
import cn.iocoder.yudao.module.archives.enums.ArchivesStatusEnum;
import lombok.*;
import java.util.*;
import io.swagger.v3.oas.annotations.media.Schema;
import javax.validation.constraints.*;
@Schema(description = "管理后台 - 移交创建 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class TurnOverCreateReqVO extends TurnOverBaseVO {
@Schema(description = "id")
private Long id;
@AssertTrue(message = "状态只能是0或者1提交")
public boolean isStatusValid() {
//只能传未提交和待审核
return getStatus().equals(ArchivesStatusEnum.NOSUBMIT.getValue()) || getStatus().equals(ArchivesStatusEnum.PROCESS.getValue());
}
}

@ -0,0 +1,101 @@
package cn.iocoder.yudao.module.archives.controller.admin.turnover.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import com.alibaba.excel.annotation.ExcelProperty;
/**
* Excel VO
*
* @author
*/
@Data
public class TurnOverExcelVO {
@ExcelProperty("主键ID")
private Long id;
@ExcelProperty("移交单号")
private String applyNo;
@ExcelProperty("移交日期")
private LocalDateTime turnDate;
@ExcelProperty("移交说明")
private String turnExplain;
@ExcelProperty("移交人")
private String outputName;
@ExcelProperty("移交人ID")
private Long outputNameId;
@ExcelProperty("签收人")
private String inputName;
@ExcelProperty("签收人ID")
private Long inputNameId;
@ExcelProperty("用户ID")
private Long userId;
@ExcelProperty("所属部门ID")
private Long deptId;
@ExcelProperty("所属部门")
private String deptName;
@ExcelProperty("业务实体ID")
private Long companyId;
@ExcelProperty("业务实体")
private String company;
@ExcelProperty("备注")
private String remark;
@ExcelProperty("制单人")
private String createBy;
@ExcelProperty("从立档单位ID")
private Long fromOrganizationId;
@ExcelProperty("从库房ID")
private Long fromDepotId;
@ExcelProperty("从档案柜ID")
private Long fromCabinetId;
@ExcelProperty("到立档单位ID")
private Long toOrganizationId;
@ExcelProperty("到库房ID")
private Long toDepotId;
@ExcelProperty("到档案柜ID")
private Long toCabinetId;
@ExcelProperty("制单人id")
private Long createById;
@ExcelProperty("案卷数量")
private Integer amount;
@ExcelProperty("创建时间")
private LocalDateTime createTime;
@ExcelProperty("流程实例的编号")
private String processInstanceId;
@ExcelProperty("申请类型")
private String billType;
@ExcelProperty("状态")
private String status;
}

@ -0,0 +1,96 @@
package cn.iocoder.yudao.module.archives.controller.admin.turnover.vo;
import lombok.*;
import java.util.*;
import io.swagger.v3.oas.annotations.media.Schema;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import java.time.LocalDateTime;
import org.springframework.format.annotation.DateTimeFormat;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@Schema(description = "管理后台 - 移交 Excel 导出 Request VO参数和 TurnOverPageReqVO 是一致的")
@Data
public class TurnOverExportReqVO {
@Schema(description = "移交单号")
private String applyNo;
@Schema(description = "移交日期")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] turnDate;
@Schema(description = "移交说明")
private String turnExplain;
@Schema(description = "移交人", example = "张三")
private String outputName;
@Schema(description = "移交人ID", example = "24105")
private Long outputNameId;
@Schema(description = "签收人", example = "李四")
private String inputName;
@Schema(description = "签收人ID", example = "28017")
private Long inputNameId;
@Schema(description = "用户ID", example = "23669")
private Long userId;
@Schema(description = "所属部门ID", example = "27304")
private Long deptId;
@Schema(description = "所属部门", example = "张三")
private String deptName;
@Schema(description = "业务实体ID", example = "13936")
private Long companyId;
@Schema(description = "业务实体")
private String company;
@Schema(description = "备注", example = "随便")
private String remark;
@Schema(description = "制单人")
private String createBy;
@Schema(description = "从立档单位ID", example = "12461")
private Long fromOrganizationId;
@Schema(description = "从库房ID", example = "31262")
private Long fromDepotId;
@Schema(description = "从档案柜ID", example = "19367")
private Long fromCabinetId;
@Schema(description = "到立档单位ID", example = "18409")
private Long toOrganizationId;
@Schema(description = "到库房ID", example = "17779")
private Long toDepotId;
@Schema(description = "到档案柜ID", example = "24097")
private Long toCabinetId;
@Schema(description = "制单人id", example = "24299")
private Long createById;
@Schema(description = "案卷数量")
private Integer amount;
@Schema(description = "创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;
@Schema(description = "流程实例的编号", example = "705")
private String processInstanceId;
@Schema(description = "申请类型", example = "2")
private String billType;
@Schema(description = "状态", example = "1")
private String status;
}

@ -0,0 +1,98 @@
package cn.iocoder.yudao.module.archives.controller.admin.turnover.vo;
import lombok.*;
import java.util.*;
import io.swagger.v3.oas.annotations.media.Schema;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@Schema(description = "管理后台 - 移交分页 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class TurnOverPageReqVO extends PageParam {
@Schema(description = "移交单号")
private String applyNo;
@Schema(description = "移交日期")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] turnDate;
@Schema(description = "移交说明")
private String turnExplain;
@Schema(description = "移交人", example = "张三")
private String outputName;
@Schema(description = "移交人ID", example = "24105")
private Long outputNameId;
@Schema(description = "签收人", example = "李四")
private String inputName;
@Schema(description = "签收人ID", example = "28017")
private Long inputNameId;
@Schema(description = "用户ID", example = "23669")
private Long userId;
@Schema(description = "所属部门ID", example = "27304")
private Long deptId;
@Schema(description = "所属部门", example = "张三")
private String deptName;
@Schema(description = "业务实体ID", example = "13936")
private Long companyId;
@Schema(description = "业务实体")
private String company;
@Schema(description = "备注", example = "随便")
private String remark;
@Schema(description = "制单人")
private String createBy;
@Schema(description = "从立档单位ID", example = "12461")
private Long fromOrganizationId;
@Schema(description = "从库房ID", example = "31262")
private Long fromDepotId;
@Schema(description = "从档案柜ID", example = "19367")
private Long fromCabinetId;
@Schema(description = "到立档单位ID", example = "18409")
private Long toOrganizationId;
@Schema(description = "到库房ID", example = "17779")
private Long toDepotId;
@Schema(description = "到档案柜ID", example = "24097")
private Long toCabinetId;
@Schema(description = "制单人id", example = "24299")
private Long createById;
@Schema(description = "案卷数量")
private Integer amount;
@Schema(description = "创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;
@Schema(description = "流程实例的编号", example = "705")
private String processInstanceId;
@Schema(description = "申请类型", example = "2")
private String billType;
@Schema(description = "状态", example = "1")
private String status;
}

@ -0,0 +1,19 @@
package cn.iocoder.yudao.module.archives.controller.admin.turnover.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.time.LocalDateTime;
@Schema(description = "管理后台 - 移交 Response VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class TurnOverRespVO extends TurnOverBaseVO {
@Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "17036")
private Long id;
@Schema(description = "创建时间")
private LocalDateTime createTime;
}

@ -0,0 +1,20 @@
package cn.iocoder.yudao.module.archives.controller.admin.turnover.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import javax.validation.constraints.*;
@Schema(description = "管理后台 - 移交更新 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class TurnOverUpdateReqVO extends TurnOverBaseVO {
@Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "17036")
@NotNull(message = "主键ID不能为空")
private Long id;
private String status;
}

@ -0,0 +1,34 @@
package cn.iocoder.yudao.module.archives.convert.turnover;
import java.util.*;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;
import cn.iocoder.yudao.module.archives.controller.admin.turnover.vo.*;
import cn.iocoder.yudao.module.archives.dal.dataobject.turnover.TurnOverDO;
/**
* Convert
*
* @author
*/
@Mapper
public interface TurnOverConvert {
TurnOverConvert INSTANCE = Mappers.getMapper(TurnOverConvert.class);
TurnOverDO convert(TurnOverCreateReqVO bean);
TurnOverDO convert(TurnOverUpdateReqVO bean);
TurnOverRespVO convert(TurnOverDO bean);
List<TurnOverRespVO> convertList(List<TurnOverDO> list);
PageResult<TurnOverRespVO> convertPage(PageResult<TurnOverDO> page);
List<TurnOverExcelVO> convertList02(List<TurnOverDO> list);
}

@ -0,0 +1,148 @@
package cn.iocoder.yudao.module.archives.dal.dataobject.turnover;
import lombok.*;
import java.util.*;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.*;
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
/**
* DO
*
* @author
*/
@TableName("archives_turn_over")
@KeySequence("archives_turn_over_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class TurnOverDO extends BaseDO {
/**
* ID
*/
@TableId
private Long id;
/**
*
*/
private String applyNo;
/**
*
*/
private LocalDateTime turnDate;
/**
*
*/
private String turnExplain;
/**
*
*/
private String outputName;
/**
* ID
*/
private Long outputNameId;
/**
*
*/
private String inputName;
/**
* ID
*/
private Long inputNameId;
/**
* ID
*/
private Long userId;
/**
* ID
*/
private Long deptId;
/**
*
*/
private String deptName;
/**
* ID
*/
private Long companyId;
/**
*
*/
private String company;
/**
*
*/
private String remark;
/**
*
*/
private String createBy;
/**
* ID
*/
private Long fromOrganizationId;
/**
* ID
*/
private Long fromDepotId;
/**
* ID
*/
private Long fromCabinetId;
/**
* ID
*/
private Long toOrganizationId;
/**
* ID
*/
private Long toDepotId;
/**
* ID
*/
private Long toCabinetId;
/**
* 1
*/
private String attr1;
/**
* 2
*/
private String attr2;
/**
* 3
*/
private Integer attr3;
/**
* 4
*/
private Integer attr4;
/**
* id
*/
private Long createById;
/**
*
*/
private Integer amount;
/**
*
*/
private String processInstanceId;
/**
*
*/
private String billType;
/**
*
*/
private String status;
}

@ -0,0 +1,82 @@
package cn.iocoder.yudao.module.archives.dal.mysql.turnover;
import java.util.*;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.archives.dal.dataobject.turnover.TurnOverDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.archives.controller.admin.turnover.vo.*;
/**
* Mapper
*
* @author
*/
@Mapper
public interface TurnOverMapper extends BaseMapperX<TurnOverDO> {
default PageResult<TurnOverDO> selectPage(TurnOverPageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<TurnOverDO>()
.eqIfPresent(TurnOverDO::getApplyNo, reqVO.getApplyNo())
.betweenIfPresent(TurnOverDO::getTurnDate, reqVO.getTurnDate())
.eqIfPresent(TurnOverDO::getTurnExplain, reqVO.getTurnExplain())
.likeIfPresent(TurnOverDO::getOutputName, reqVO.getOutputName())
.eqIfPresent(TurnOverDO::getOutputNameId, reqVO.getOutputNameId())
.likeIfPresent(TurnOverDO::getInputName, reqVO.getInputName())
.eqIfPresent(TurnOverDO::getInputNameId, reqVO.getInputNameId())
.eqIfPresent(TurnOverDO::getUserId, reqVO.getUserId())
.eqIfPresent(TurnOverDO::getDeptId, reqVO.getDeptId())
.likeIfPresent(TurnOverDO::getDeptName, reqVO.getDeptName())
.eqIfPresent(TurnOverDO::getCompanyId, reqVO.getCompanyId())
.eqIfPresent(TurnOverDO::getCompany, reqVO.getCompany())
.eqIfPresent(TurnOverDO::getRemark, reqVO.getRemark())
.eqIfPresent(TurnOverDO::getCreateBy, reqVO.getCreateBy())
.eqIfPresent(TurnOverDO::getFromOrganizationId, reqVO.getFromOrganizationId())
.eqIfPresent(TurnOverDO::getFromDepotId, reqVO.getFromDepotId())
.eqIfPresent(TurnOverDO::getFromCabinetId, reqVO.getFromCabinetId())
.eqIfPresent(TurnOverDO::getToOrganizationId, reqVO.getToOrganizationId())
.eqIfPresent(TurnOverDO::getToDepotId, reqVO.getToDepotId())
.eqIfPresent(TurnOverDO::getToCabinetId, reqVO.getToCabinetId())
.eqIfPresent(TurnOverDO::getCreateById, reqVO.getCreateById())
.eqIfPresent(TurnOverDO::getAmount, reqVO.getAmount())
.betweenIfPresent(TurnOverDO::getCreateTime, reqVO.getCreateTime())
.eqIfPresent(TurnOverDO::getProcessInstanceId, reqVO.getProcessInstanceId())
.eqIfPresent(TurnOverDO::getBillType, reqVO.getBillType())
.eqIfPresent(TurnOverDO::getStatus, reqVO.getStatus())
.orderByDesc(TurnOverDO::getId));
}
default List<TurnOverDO> selectList(TurnOverExportReqVO reqVO) {
return selectList(new LambdaQueryWrapperX<TurnOverDO>()
.eqIfPresent(TurnOverDO::getApplyNo, reqVO.getApplyNo())
.betweenIfPresent(TurnOverDO::getTurnDate, reqVO.getTurnDate())
.eqIfPresent(TurnOverDO::getTurnExplain, reqVO.getTurnExplain())
.likeIfPresent(TurnOverDO::getOutputName, reqVO.getOutputName())
.eqIfPresent(TurnOverDO::getOutputNameId, reqVO.getOutputNameId())
.likeIfPresent(TurnOverDO::getInputName, reqVO.getInputName())
.eqIfPresent(TurnOverDO::getInputNameId, reqVO.getInputNameId())
.eqIfPresent(TurnOverDO::getUserId, reqVO.getUserId())
.eqIfPresent(TurnOverDO::getDeptId, reqVO.getDeptId())
.likeIfPresent(TurnOverDO::getDeptName, reqVO.getDeptName())
.eqIfPresent(TurnOverDO::getCompanyId, reqVO.getCompanyId())
.eqIfPresent(TurnOverDO::getCompany, reqVO.getCompany())
.eqIfPresent(TurnOverDO::getRemark, reqVO.getRemark())
.eqIfPresent(TurnOverDO::getCreateBy, reqVO.getCreateBy())
.eqIfPresent(TurnOverDO::getFromOrganizationId, reqVO.getFromOrganizationId())
.eqIfPresent(TurnOverDO::getFromDepotId, reqVO.getFromDepotId())
.eqIfPresent(TurnOverDO::getFromCabinetId, reqVO.getFromCabinetId())
.eqIfPresent(TurnOverDO::getToOrganizationId, reqVO.getToOrganizationId())
.eqIfPresent(TurnOverDO::getToDepotId, reqVO.getToDepotId())
.eqIfPresent(TurnOverDO::getToCabinetId, reqVO.getToCabinetId())
.eqIfPresent(TurnOverDO::getCreateById, reqVO.getCreateById())
.eqIfPresent(TurnOverDO::getAmount, reqVO.getAmount())
.betweenIfPresent(TurnOverDO::getCreateTime, reqVO.getCreateTime())
.eqIfPresent(TurnOverDO::getProcessInstanceId, reqVO.getProcessInstanceId())
.eqIfPresent(TurnOverDO::getBillType, reqVO.getBillType())
.eqIfPresent(TurnOverDO::getStatus, reqVO.getStatus())
.orderByDesc(TurnOverDO::getId));
}
}

@ -0,0 +1,72 @@
package cn.iocoder.yudao.module.archives.service.turnover;
import java.util.*;
import javax.validation.*;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.module.archives.controller.admin.turnover.vo.*;
import cn.iocoder.yudao.module.archives.dal.dataobject.turnover.TurnOverDO;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
/**
* Service
*
* @author
*/
public interface TurnOverService {
/**
*
*
* @param createReqVO
* @return
*/
CommonResult createTurnOver(@Valid TurnOverCreateReqVO createReqVO);
/**
*
*
* @param updateReqVO
*/
void updateTurnOver(@Valid TurnOverUpdateReqVO updateReqVO);
/**
*
*
* @param id
*/
void deleteTurnOver(Long id);
/**
*
*
* @param id
* @return
*/
TurnOverDO getTurnOver(Long id);
/**
*
*
* @param ids
* @return
*/
List<TurnOverDO> getTurnOverList(Collection<Long> ids);
/**
*
*
* @param pageReqVO
* @return
*/
PageResult<TurnOverDO> getTurnOverPage(TurnOverPageReqVO pageReqVO);
/**
* , Excel
*
* @param exportReqVO
* @return
*/
List<TurnOverDO> getTurnOverList(TurnOverExportReqVO exportReqVO);
}

@ -0,0 +1,124 @@
package cn.iocoder.yudao.module.archives.service.turnover;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.security.core.LoginUser;
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
import cn.iocoder.yudao.module.archives.convert.record.RecordConvert;
import cn.iocoder.yudao.module.archives.dal.dataobject.record.RecordDO;
import cn.iocoder.yudao.module.archives.enums.ArchivesStatusEnum;
import cn.iocoder.yudao.module.archives.enums.BillTypeEnum;
import cn.iocoder.yudao.module.bpm.api.task.BpmProcessInstanceApi;
import cn.iocoder.yudao.module.bpm.api.task.dto.BpmProcessInstanceCreateReqDTO;
import cn.iocoder.yudao.module.system.api.dept.DeptApi;
import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
import com.github.yulichang.base.MPJBaseServiceImpl;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import javax.validation.Validator;
import org.springframework.validation.annotation.Validated;
import java.util.*;
import cn.iocoder.yudao.module.archives.controller.admin.turnover.vo.*;
import cn.iocoder.yudao.module.archives.dal.dataobject.turnover.TurnOverDO;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.archives.convert.turnover.TurnOverConvert;
import cn.iocoder.yudao.module.archives.dal.mysql.turnover.TurnOverMapper;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.module.archives.enums.ErrorCodeConstants.*;
/**
* Service
*
* @author
*/
@Service
@Validated
public class TurnOverServiceImpl extends MPJBaseServiceImpl<TurnOverMapper, TurnOverDO> implements TurnOverService {
public static final String PROCESS_KEY = "archives_turn_over";
@Resource
private TurnOverMapper turnOverMapper;
@Resource
private Validator validator;
@Resource
private AdminUserApi adminUserApi;
@Resource
private DeptApi deptApi;
@Resource
private BpmProcessInstanceApi processInstanceApi;
@Override
public CommonResult createTurnOver(TurnOverCreateReqVO createReqVO) {
// 插入
TurnOverDO turnOver = TurnOverConvert.INSTANCE.convert(createReqVO);
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
turnOver.setDeleted(false);
turnOver.setBillType("DAYJ");
//添加数据userid
turnOver.setUserId(loginUser.getId());
turnOverMapper.insert(turnOver);
if (turnOver.getStatus().equals(ArchivesStatusEnum.PROCESS.getValue())) {
Map<String, Object> variables = new HashMap<>();
variables.put("billType", turnOver.getBillType());
variables.put("billId", turnOver.getId());
variables.put("billName", BillTypeEnum.getNameByValue(turnOver.getBillType()));
variables.put("amount", turnOver.getAmount());
variables.put("deptId", turnOver.getDeptId());
String processInstanceId = processInstanceApi.createProcessInstance(turnOver.getUserId(),
new BpmProcessInstanceCreateReqDTO().setProcessDefinitionKey(PROCESS_KEY)
.setVariables(variables).setBusinessKey(String.valueOf(turnOver.getId())));
updateById(new TurnOverDO().setId(turnOver.getId()).setProcessInstanceId(processInstanceId));
}
// 返回
return CommonResult.success();
}
@Override
public void updateTurnOver(TurnOverUpdateReqVO updateReqVO) {
// 校验存在
validateTurnOverExists(updateReqVO.getId());
// 更新
TurnOverDO updateObj = TurnOverConvert.INSTANCE.convert(updateReqVO);
turnOverMapper.updateById(updateObj);
}
@Override
public void deleteTurnOver(Long id) {
// 校验存在
validateTurnOverExists(id);
// 删除
turnOverMapper.deleteById(id);
}
private void validateTurnOverExists(Long id) {
if (turnOverMapper.selectById(id) == null) {
throw exception(TURN_OVER_NOT_EXISTS);
}
}
@Override
public TurnOverDO getTurnOver(Long id) {
return turnOverMapper.selectById(id);
}
@Override
public List<TurnOverDO> getTurnOverList(Collection<Long> ids) {
return turnOverMapper.selectBatchIds(ids);
}
@Override
public PageResult<TurnOverDO> getTurnOverPage(TurnOverPageReqVO pageReqVO) {
return turnOverMapper.selectPage(pageReqVO);
}
@Override
public List<TurnOverDO> getTurnOverList(TurnOverExportReqVO exportReqVO) {
return turnOverMapper.selectList(exportReqVO);
}
}

@ -0,0 +1,12 @@
<?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="cn.iocoder.yudao.module.archives.dal.mysql.turnover.TurnOverMapper">
<!--
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
文档可见https://www.iocoder.cn/MyBatis/x-plugins/
-->
</mapper>

@ -0,0 +1,352 @@
package cn.iocoder.yudao.module.archives.service.turnover;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.mock.mockito.MockBean;
import javax.annotation.Resource;
import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest;
import cn.iocoder.yudao.module.archives.controller.admin.turnover.vo.*;
import cn.iocoder.yudao.module.archives.dal.dataobject.turnover.TurnOverDO;
import cn.iocoder.yudao.module.archives.dal.mysql.turnover.TurnOverMapper;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import javax.annotation.Resource;
import org.springframework.context.annotation.Import;
import java.util.*;
import java.time.LocalDateTime;
import static cn.hutool.core.util.RandomUtil.*;
import static cn.iocoder.yudao.module.archives.enums.ErrorCodeConstants.*;
import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.*;
import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.*;
import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.*;
import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.*;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.*;
import static org.junit.jupiter.api.Assertions.*;
import static org.mockito.Mockito.*;
/**
* {@link TurnOverServiceImpl}
*
* @author
*/
@Import(TurnOverServiceImpl.class)
public class TurnOverServiceImplTest extends BaseDbUnitTest {
@Resource
private TurnOverServiceImpl turnOverService;
@Resource
private TurnOverMapper turnOverMapper;
@Test
public void testCreateTurnOver_success() {
// 准备参数
TurnOverCreateReqVO reqVO = randomPojo(TurnOverCreateReqVO.class);
// 调用
CommonResult turnOverId = turnOverService.createTurnOver(reqVO);
// 断言
assertNotNull(turnOverId);
// 校验记录的属性是否正确
TurnOverDO turnOver = turnOverMapper.selectById(turnOverId);
assertPojoEquals(reqVO, turnOver);
}
@Test
public void testUpdateTurnOver_success() {
// mock 数据
TurnOverDO dbTurnOver = randomPojo(TurnOverDO.class);
turnOverMapper.insert(dbTurnOver);// @Sql: 先插入出一条存在的数据
// 准备参数
TurnOverUpdateReqVO reqVO = randomPojo(TurnOverUpdateReqVO.class, o -> {
o.setId(dbTurnOver.getId()); // 设置更新的 ID
});
// 调用
turnOverService.updateTurnOver(reqVO);
// 校验是否更新正确
TurnOverDO turnOver = turnOverMapper.selectById(reqVO.getId()); // 获取最新的
assertPojoEquals(reqVO, turnOver);
}
@Test
public void testUpdateTurnOver_notExists() {
// 准备参数
TurnOverUpdateReqVO reqVO = randomPojo(TurnOverUpdateReqVO.class);
// 调用, 并断言异常
assertServiceException(() -> turnOverService.updateTurnOver(reqVO), TURN_OVER_NOT_EXISTS);
}
@Test
public void testDeleteTurnOver_success() {
// mock 数据
TurnOverDO dbTurnOver = randomPojo(TurnOverDO.class);
turnOverMapper.insert(dbTurnOver);// @Sql: 先插入出一条存在的数据
// 准备参数
Long id = dbTurnOver.getId();
// 调用
turnOverService.deleteTurnOver(id);
// 校验数据不存在了
assertNull(turnOverMapper.selectById(id));
}
@Test
public void testDeleteTurnOver_notExists() {
// 准备参数
Long id = randomLongId();
// 调用, 并断言异常
assertServiceException(() -> turnOverService.deleteTurnOver(id), TURN_OVER_NOT_EXISTS);
}
@Test
@Disabled // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解
public void testGetTurnOverPage() {
// mock 数据
TurnOverDO dbTurnOver = randomPojo(TurnOverDO.class, o -> { // 等会查询到
o.setApplyNo(null);
o.setTurnDate(null);
o.setTurnExplain(null);
o.setOutputName(null);
o.setOutputNameId(null);
o.setInputName(null);
o.setInputNameId(null);
o.setUserId(null);
o.setDeptId(null);
o.setDeptName(null);
o.setCompanyId(null);
o.setCompany(null);
o.setRemark(null);
o.setCreateBy(null);
o.setFromOrganizationId(null);
o.setFromDepotId(null);
o.setFromCabinetId(null);
o.setToOrganizationId(null);
o.setToDepotId(null);
o.setToCabinetId(null);
o.setCreateById(null);
o.setAmount(null);
o.setCreateTime(null);
o.setProcessInstanceId(null);
o.setBillType(null);
o.setStatus(null);
});
turnOverMapper.insert(dbTurnOver);
// 测试 applyNo 不匹配
turnOverMapper.insert(cloneIgnoreId(dbTurnOver, o -> o.setApplyNo(null)));
// 测试 turnDate 不匹配
turnOverMapper.insert(cloneIgnoreId(dbTurnOver, o -> o.setTurnDate(null)));
// 测试 turnExplain 不匹配
turnOverMapper.insert(cloneIgnoreId(dbTurnOver, o -> o.setTurnExplain(null)));
// 测试 outputName 不匹配
turnOverMapper.insert(cloneIgnoreId(dbTurnOver, o -> o.setOutputName(null)));
// 测试 outputNameId 不匹配
turnOverMapper.insert(cloneIgnoreId(dbTurnOver, o -> o.setOutputNameId(null)));
// 测试 inputName 不匹配
turnOverMapper.insert(cloneIgnoreId(dbTurnOver, o -> o.setInputName(null)));
// 测试 inputNameId 不匹配
turnOverMapper.insert(cloneIgnoreId(dbTurnOver, o -> o.setInputNameId(null)));
// 测试 userId 不匹配
turnOverMapper.insert(cloneIgnoreId(dbTurnOver, o -> o.setUserId(null)));
// 测试 deptId 不匹配
turnOverMapper.insert(cloneIgnoreId(dbTurnOver, o -> o.setDeptId(null)));
// 测试 deptName 不匹配
turnOverMapper.insert(cloneIgnoreId(dbTurnOver, o -> o.setDeptName(null)));
// 测试 companyId 不匹配
turnOverMapper.insert(cloneIgnoreId(dbTurnOver, o -> o.setCompanyId(null)));
// 测试 company 不匹配
turnOverMapper.insert(cloneIgnoreId(dbTurnOver, o -> o.setCompany(null)));
// 测试 remark 不匹配
turnOverMapper.insert(cloneIgnoreId(dbTurnOver, o -> o.setRemark(null)));
// 测试 createBy 不匹配
turnOverMapper.insert(cloneIgnoreId(dbTurnOver, o -> o.setCreateBy(null)));
// 测试 fromOrganizationId 不匹配
turnOverMapper.insert(cloneIgnoreId(dbTurnOver, o -> o.setFromOrganizationId(null)));
// 测试 fromDepotId 不匹配
turnOverMapper.insert(cloneIgnoreId(dbTurnOver, o -> o.setFromDepotId(null)));
// 测试 fromCabinetId 不匹配
turnOverMapper.insert(cloneIgnoreId(dbTurnOver, o -> o.setFromCabinetId(null)));
// 测试 toOrganizationId 不匹配
turnOverMapper.insert(cloneIgnoreId(dbTurnOver, o -> o.setToOrganizationId(null)));
// 测试 toDepotId 不匹配
turnOverMapper.insert(cloneIgnoreId(dbTurnOver, o -> o.setToDepotId(null)));
// 测试 toCabinetId 不匹配
turnOverMapper.insert(cloneIgnoreId(dbTurnOver, o -> o.setToCabinetId(null)));
// 测试 createById 不匹配
turnOverMapper.insert(cloneIgnoreId(dbTurnOver, o -> o.setCreateById(null)));
// 测试 amount 不匹配
turnOverMapper.insert(cloneIgnoreId(dbTurnOver, o -> o.setAmount(null)));
// 测试 createTime 不匹配
turnOverMapper.insert(cloneIgnoreId(dbTurnOver, o -> o.setCreateTime(null)));
// 测试 processInstanceId 不匹配
turnOverMapper.insert(cloneIgnoreId(dbTurnOver, o -> o.setProcessInstanceId(null)));
// 测试 billType 不匹配
turnOverMapper.insert(cloneIgnoreId(dbTurnOver, o -> o.setBillType(null)));
// 测试 status 不匹配
turnOverMapper.insert(cloneIgnoreId(dbTurnOver, o -> o.setStatus(null)));
// 准备参数
TurnOverPageReqVO reqVO = new TurnOverPageReqVO();
reqVO.setApplyNo(null);
reqVO.setTurnDate(buildBetweenTime(2023, 2, 1, 2023, 2, 28));
reqVO.setTurnExplain(null);
reqVO.setOutputName(null);
reqVO.setOutputNameId(null);
reqVO.setInputName(null);
reqVO.setInputNameId(null);
reqVO.setUserId(null);
reqVO.setDeptId(null);
reqVO.setDeptName(null);
reqVO.setCompanyId(null);
reqVO.setCompany(null);
reqVO.setRemark(null);
reqVO.setCreateBy(null);
reqVO.setFromOrganizationId(null);
reqVO.setFromDepotId(null);
reqVO.setFromCabinetId(null);
reqVO.setToOrganizationId(null);
reqVO.setToDepotId(null);
reqVO.setToCabinetId(null);
reqVO.setCreateById(null);
reqVO.setAmount(null);
reqVO.setCreateTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28));
reqVO.setProcessInstanceId(null);
reqVO.setBillType(null);
reqVO.setStatus(null);
// 调用
PageResult<TurnOverDO> pageResult = turnOverService.getTurnOverPage(reqVO);
// 断言
assertEquals(1, pageResult.getTotal());
assertEquals(1, pageResult.getList().size());
assertPojoEquals(dbTurnOver, pageResult.getList().get(0));
}
@Test
@Disabled // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解
public void testGetTurnOverList() {
// mock 数据
TurnOverDO dbTurnOver = randomPojo(TurnOverDO.class, o -> { // 等会查询到
o.setApplyNo(null);
o.setTurnDate(null);
o.setTurnExplain(null);
o.setOutputName(null);
o.setOutputNameId(null);
o.setInputName(null);
o.setInputNameId(null);
o.setUserId(null);
o.setDeptId(null);
o.setDeptName(null);
o.setCompanyId(null);
o.setCompany(null);
o.setRemark(null);
o.setCreateBy(null);
o.setFromOrganizationId(null);
o.setFromDepotId(null);
o.setFromCabinetId(null);
o.setToOrganizationId(null);
o.setToDepotId(null);
o.setToCabinetId(null);
o.setCreateById(null);
o.setAmount(null);
o.setCreateTime(null);
o.setProcessInstanceId(null);
o.setBillType(null);
o.setStatus(null);
});
turnOverMapper.insert(dbTurnOver);
// 测试 applyNo 不匹配
turnOverMapper.insert(cloneIgnoreId(dbTurnOver, o -> o.setApplyNo(null)));
// 测试 turnDate 不匹配
turnOverMapper.insert(cloneIgnoreId(dbTurnOver, o -> o.setTurnDate(null)));
// 测试 turnExplain 不匹配
turnOverMapper.insert(cloneIgnoreId(dbTurnOver, o -> o.setTurnExplain(null)));
// 测试 outputName 不匹配
turnOverMapper.insert(cloneIgnoreId(dbTurnOver, o -> o.setOutputName(null)));
// 测试 outputNameId 不匹配
turnOverMapper.insert(cloneIgnoreId(dbTurnOver, o -> o.setOutputNameId(null)));
// 测试 inputName 不匹配
turnOverMapper.insert(cloneIgnoreId(dbTurnOver, o -> o.setInputName(null)));
// 测试 inputNameId 不匹配
turnOverMapper.insert(cloneIgnoreId(dbTurnOver, o -> o.setInputNameId(null)));
// 测试 userId 不匹配
turnOverMapper.insert(cloneIgnoreId(dbTurnOver, o -> o.setUserId(null)));
// 测试 deptId 不匹配
turnOverMapper.insert(cloneIgnoreId(dbTurnOver, o -> o.setDeptId(null)));
// 测试 deptName 不匹配
turnOverMapper.insert(cloneIgnoreId(dbTurnOver, o -> o.setDeptName(null)));
// 测试 companyId 不匹配
turnOverMapper.insert(cloneIgnoreId(dbTurnOver, o -> o.setCompanyId(null)));
// 测试 company 不匹配
turnOverMapper.insert(cloneIgnoreId(dbTurnOver, o -> o.setCompany(null)));
// 测试 remark 不匹配
turnOverMapper.insert(cloneIgnoreId(dbTurnOver, o -> o.setRemark(null)));
// 测试 createBy 不匹配
turnOverMapper.insert(cloneIgnoreId(dbTurnOver, o -> o.setCreateBy(null)));
// 测试 fromOrganizationId 不匹配
turnOverMapper.insert(cloneIgnoreId(dbTurnOver, o -> o.setFromOrganizationId(null)));
// 测试 fromDepotId 不匹配
turnOverMapper.insert(cloneIgnoreId(dbTurnOver, o -> o.setFromDepotId(null)));
// 测试 fromCabinetId 不匹配
turnOverMapper.insert(cloneIgnoreId(dbTurnOver, o -> o.setFromCabinetId(null)));
// 测试 toOrganizationId 不匹配
turnOverMapper.insert(cloneIgnoreId(dbTurnOver, o -> o.setToOrganizationId(null)));
// 测试 toDepotId 不匹配
turnOverMapper.insert(cloneIgnoreId(dbTurnOver, o -> o.setToDepotId(null)));
// 测试 toCabinetId 不匹配
turnOverMapper.insert(cloneIgnoreId(dbTurnOver, o -> o.setToCabinetId(null)));
// 测试 createById 不匹配
turnOverMapper.insert(cloneIgnoreId(dbTurnOver, o -> o.setCreateById(null)));
// 测试 amount 不匹配
turnOverMapper.insert(cloneIgnoreId(dbTurnOver, o -> o.setAmount(null)));
// 测试 createTime 不匹配
turnOverMapper.insert(cloneIgnoreId(dbTurnOver, o -> o.setCreateTime(null)));
// 测试 processInstanceId 不匹配
turnOverMapper.insert(cloneIgnoreId(dbTurnOver, o -> o.setProcessInstanceId(null)));
// 测试 billType 不匹配
turnOverMapper.insert(cloneIgnoreId(dbTurnOver, o -> o.setBillType(null)));
// 测试 status 不匹配
turnOverMapper.insert(cloneIgnoreId(dbTurnOver, o -> o.setStatus(null)));
// 准备参数
TurnOverExportReqVO reqVO = new TurnOverExportReqVO();
reqVO.setApplyNo(null);
reqVO.setTurnDate(buildBetweenTime(2023, 2, 1, 2023, 2, 28));
reqVO.setTurnExplain(null);
reqVO.setOutputName(null);
reqVO.setOutputNameId(null);
reqVO.setInputName(null);
reqVO.setInputNameId(null);
reqVO.setUserId(null);
reqVO.setDeptId(null);
reqVO.setDeptName(null);
reqVO.setCompanyId(null);
reqVO.setCompany(null);
reqVO.setRemark(null);
reqVO.setCreateBy(null);
reqVO.setFromOrganizationId(null);
reqVO.setFromDepotId(null);
reqVO.setFromCabinetId(null);
reqVO.setToOrganizationId(null);
reqVO.setToDepotId(null);
reqVO.setToCabinetId(null);
reqVO.setCreateById(null);
reqVO.setAmount(null);
reqVO.setCreateTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28));
reqVO.setProcessInstanceId(null);
reqVO.setBillType(null);
reqVO.setStatus(null);
// 调用
List<TurnOverDO> list = turnOverService.getTurnOverList(reqVO);
// 断言
assertEquals(1, list.size());
assertPojoEquals(dbTurnOver, list.get(0));
}
}
Loading…
Cancel
Save