diff --git a/sql/archives20230914JilingLee.sql b/sql/archives20230914JilingLee.sql index 9931ed3f..e02e508b 100644 --- a/sql/archives20230914JilingLee.sql +++ b/sql/archives20230914JilingLee.sql @@ -12,6 +12,11 @@ INSERT INTO `act_re_model`(`ID_`, `REV_`, `NAME_`, `KEY_`, `CATEGORY_`, `CREATE_ 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) +-- 移交审批流程消息通知模板插入 +INSERT INTO `lyr-one`.`system_notify_template` (`id`, `name`, `code`, `nickname`, `content`, `type`, `params`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (NULL, '档案移交完成通知', 'DAYJ_PASS', '系统通知', '您发起的【{billName}】已审核完成,请悉知!', 2, '[\"billName\"]', 0, NULL, '126', '2023-08-19 23:32:29', '126', '2023-08-19 23:32:29', b'0'); +INSERT INTO `lyr-one`.`system_notify_template` (`id`, `name`, `code`, `nickname`, `content`, `type`, `params`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (NULL, '档案移交驳回通知', 'DAYJ_NOPASS', '系统通知', '您发起的【{billName}】已被驳回,请悉知!', 2, '[\"billName\"]', 0, NULL, '126', '2023-08-19 23:32:29', '126', '2023-08-19 23:45:53', b'0'); +INSERT INTO `lyr-one`.`system_notify_template` (`id`, `name`, `code`, `nickname`, `content`, `type`, `params`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (NULL, '档案移交待办', 'DAYJ_UNDEAL', '系统通知', '您有新的【{billName}】需要处理,请及时处理!', 2, '[\"billName\"]', 0, NULL, '126', '2023-08-19 23:32:29', '126', '2023-08-30 00:21:12', b'0'); + -- 档案移交表 -- ---------------------------- diff --git a/yudao-module-accounting/yudao-module-accounting-biz/src/main/java/cn/iocoder/yudao/module/accounting/controller/admin/other/OtherController.java b/yudao-module-accounting/yudao-module-accounting-biz/src/main/java/cn/iocoder/yudao/module/accounting/controller/admin/other/OtherController.java index 8407fc3d..731565dc 100644 --- a/yudao-module-accounting/yudao-module-accounting-biz/src/main/java/cn/iocoder/yudao/module/accounting/controller/admin/other/OtherController.java +++ b/yudao-module-accounting/yudao-module-accounting-biz/src/main/java/cn/iocoder/yudao/module/accounting/controller/admin/other/OtherController.java @@ -1,9 +1,15 @@ package cn.iocoder.yudao.module.accounting.controller.admin.other; import cn.hutool.core.io.IoUtil; +import cn.iocoder.yudao.module.accounting.controller.admin.voucher.vo.VoucherPageReqVO; +import cn.iocoder.yudao.module.accounting.controller.admin.voucher.vo.VoucherRespVO; +import cn.iocoder.yudao.module.accounting.convert.voucher.VoucherConvert; +import cn.iocoder.yudao.module.accounting.dal.dataobject.voucher.VoucherDO; import cn.iocoder.yudao.module.infra.controller.admin.file.vo.file.FilePageReqVO; import cn.iocoder.yudao.module.infra.dal.dataobject.file.FileDO; import cn.iocoder.yudao.module.infra.service.file.FileService; +import cn.iocoder.yudao.module.setting.service.passwords.PasswordsService; +import com.alibaba.fastjson.JSONObject; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import org.springframework.validation.annotation.Validated; @@ -44,6 +50,9 @@ public class OtherController { @Resource private FileService fileService; + @Resource + private PasswordsService passwordsService; + @PostMapping("/create") @Operation(summary = "创建其他资料") @PreAuthorize("@ss.hasPermission('accounting:other:create')") @@ -119,4 +128,14 @@ public class OtherController { ExcelUtils.write(response, "其他资料.xls", "数据", OtherExcelVO.class, datas); } + @GetMapping("/downloadXml") + @Operation(summary = "获得其他资料Xml") + @PreAuthorize("@ss.hasPermission('accounting:other:query')") + public void downloadXml(@Valid OtherPageReqVO pageVO, HttpServletResponse response) throws IOException { + PageResult pageResult = otherService.getOtherPage(pageVO); + PageResult otherRespVOPageResult = OtherConvert.INSTANCE.convertPage(pageResult); + String jsonString = JSONObject.toJSONString(otherRespVOPageResult); + passwordsService.jsonToXmlConverter(response,pageVO.getInputPassword(),jsonString); + } + } diff --git a/yudao-module-accounting/yudao-module-accounting-biz/src/main/java/cn/iocoder/yudao/module/accounting/controller/admin/other/vo/OtherPageReqVO.java b/yudao-module-accounting/yudao-module-accounting-biz/src/main/java/cn/iocoder/yudao/module/accounting/controller/admin/other/vo/OtherPageReqVO.java index 93ef9d1d..74a814f7 100644 --- a/yudao-module-accounting/yudao-module-accounting-biz/src/main/java/cn/iocoder/yudao/module/accounting/controller/admin/other/vo/OtherPageReqVO.java +++ b/yudao-module-accounting/yudao-module-accounting-biz/src/main/java/cn/iocoder/yudao/module/accounting/controller/admin/other/vo/OtherPageReqVO.java @@ -79,4 +79,7 @@ public class OtherPageReqVO extends PageParam { @Schema(description = "备注", example = "你猜") private String remark; + @Schema(description = "密码", example = "1586") + private String inputPassword; + } diff --git a/yudao-module-accounting/yudao-module-accounting-biz/src/main/java/cn/iocoder/yudao/module/accounting/service/voucher/VoucherServiceImpl.java b/yudao-module-accounting/yudao-module-accounting-biz/src/main/java/cn/iocoder/yudao/module/accounting/service/voucher/VoucherServiceImpl.java index 95f6e544..0f034f25 100644 --- a/yudao-module-accounting/yudao-module-accounting-biz/src/main/java/cn/iocoder/yudao/module/accounting/service/voucher/VoucherServiceImpl.java +++ b/yudao-module-accounting/yudao-module-accounting-biz/src/main/java/cn/iocoder/yudao/module/accounting/service/voucher/VoucherServiceImpl.java @@ -1,11 +1,15 @@ package cn.iocoder.yudao.module.accounting.service.voucher; +import cn.iocoder.yudao.framework.security.core.LoginUser; +import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils; import cn.iocoder.yudao.module.setting.dal.dataobject.depot.DepotDO; import cn.iocoder.yudao.module.setting.dal.dataobject.depotcabinet.DepotCabinetDO; import cn.iocoder.yudao.module.setting.dal.dataobject.organization.OrganizationDO; import cn.iocoder.yudao.module.setting.dal.mysql.depot.DepotMapper; import cn.iocoder.yudao.module.setting.dal.mysql.depotcabinet.DepotCabinetMapper; import cn.iocoder.yudao.module.setting.dal.mysql.organization.OrganizationMapper; +import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO; +import cn.iocoder.yudao.module.system.dal.mysql.user.AdminUserMapper; import org.springframework.stereotype.Service; import javax.annotation.Resource; import org.springframework.validation.annotation.Validated; @@ -38,6 +42,8 @@ public class VoucherServiceImpl implements VoucherService { private DepotMapper depotMapper; @Resource private DepotCabinetMapper depotCabinetMapper; + @Resource + private AdminUserMapper userMapper; @Override public Long createVoucher(VoucherCreateReqVO createReqVO) { @@ -64,6 +70,10 @@ public class VoucherServiceImpl implements VoucherService { } } voucher.setPosition(position); + //制单人 + LoginUser loginUser = SecurityFrameworkUtils.getLoginUser(); + AdminUserDO adminUserDO = userMapper.selectById(loginUser.getId()); + voucher.setCreateBy(adminUserDO.getUsername()); voucherMapper.insert(voucher); // 返回 return voucher.getId(); diff --git a/yudao-module-accounting/yudao-module-accounting-biz/src/main/java/cn/iocoder/yudao/module/accounting/service/voucherdetails/VoucherDetailsServiceImpl.java b/yudao-module-accounting/yudao-module-accounting-biz/src/main/java/cn/iocoder/yudao/module/accounting/service/voucherdetails/VoucherDetailsServiceImpl.java index 9dbd9eea..86d7cfc7 100644 --- a/yudao-module-accounting/yudao-module-accounting-biz/src/main/java/cn/iocoder/yudao/module/accounting/service/voucherdetails/VoucherDetailsServiceImpl.java +++ b/yudao-module-accounting/yudao-module-accounting-biz/src/main/java/cn/iocoder/yudao/module/accounting/service/voucherdetails/VoucherDetailsServiceImpl.java @@ -1,5 +1,8 @@ package cn.iocoder.yudao.module.accounting.service.voucherdetails; +import cn.iocoder.yudao.module.accounting.controller.admin.voucher.vo.VoucherExportReqVO; +import cn.iocoder.yudao.module.accounting.dal.dataobject.voucher.VoucherDO; +import cn.iocoder.yudao.module.accounting.dal.mysql.voucher.VoucherMapper; import org.springframework.stereotype.Service; import javax.annotation.Resource; @@ -31,10 +34,24 @@ public class VoucherDetailsServiceImpl implements VoucherDetailsService { @Resource private VoucherDetailsMapper voucherDetailsMapper; + @Resource + private VoucherMapper voucherMapper; + + @Override public Long createVoucherDetails(VoucherDetailsCreateReqVO createReqVO) { // 插入 VoucherDetailsDO voucherDetails = VoucherDetailsConvert.INSTANCE.convert(createReqVO); + //寻找凭证id通过voucherNum + if (createReqVO.getVoucherNum() != null) { + String voucherNum = createReqVO.getVoucherNum(); + VoucherExportReqVO voucherExportReqVO = new VoucherExportReqVO(); + voucherExportReqVO.setVoucherNum(voucherNum); + List voucherDOS = voucherMapper.selectList(voucherExportReqVO); + if (voucherDOS.size()>0){ + voucherDetails.setVoucherId(voucherDOS.get(0).getId()); + } + } voucherDetailsMapper.insert(voucherDetails); // 返回 return voucherDetails.getId(); @@ -46,6 +63,16 @@ public class VoucherDetailsServiceImpl implements VoucherDetailsService { validateVoucherDetailsExists(updateReqVO.getId()); // 更新 VoucherDetailsDO updateObj = VoucherDetailsConvert.INSTANCE.convert(updateReqVO); + //寻找凭证id通过voucherNum + if (updateReqVO.getVoucherNum() != null) { + String voucherNum = updateReqVO.getVoucherNum(); + VoucherExportReqVO voucherExportReqVO = new VoucherExportReqVO(); + voucherExportReqVO.setVoucherNum(voucherNum); + List voucherDOS = voucherMapper.selectList(voucherExportReqVO); + if (voucherDOS.size()>0){ + updateReqVO.setVoucherId(voucherDOS.get(0).getId()); + } + } voucherDetailsMapper.updateById(updateObj); } diff --git a/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/controller/admin/record/RecordController.java b/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/controller/admin/record/RecordController.java index 2943656a..7e06cbec 100644 --- a/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/controller/admin/record/RecordController.java +++ b/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/controller/admin/record/RecordController.java @@ -96,7 +96,7 @@ public class RecordController { @GetMapping("/page") @Operation(summary = "获得归档分页") @PreAuthorize("@ss.hasPermission('archives:record:query')") - @DataPermission + //@DataPermission 用来限制部门数据 public CommonResult> getRecordPage(@Valid RecordPageReqVO pageVO) { PageResult pageResult = recordService.getRecordPage(pageVO); return success(RecordConvert.INSTANCE.convertPage(pageResult)); diff --git a/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/controller/admin/turnover/vo/TurnOverCreateReqVO.java b/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/controller/admin/turnover/vo/TurnOverCreateReqVO.java index 5689f107..90f832d4 100644 --- a/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/controller/admin/turnover/vo/TurnOverCreateReqVO.java +++ b/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/controller/admin/turnover/vo/TurnOverCreateReqVO.java @@ -13,9 +13,4 @@ import javax.validation.constraints.*; 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()); - } } diff --git a/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/service/turnover/TurnOverServiceImpl.java b/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/service/turnover/TurnOverServiceImpl.java index 3cb9ae22..61baaa68 100644 --- a/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/service/turnover/TurnOverServiceImpl.java +++ b/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/service/turnover/TurnOverServiceImpl.java @@ -59,6 +59,7 @@ public class TurnOverServiceImpl extends MPJBaseServiceImpl