diff --git a/sql/20231108JS.sql b/sql/20231108JS.sql index 1e5b4bbf..bcfd3289 100644 --- a/sql/20231108JS.sql +++ b/sql/20231108JS.sql @@ -10,6 +10,9 @@ ALTER TABLE archives_borrow_apply ADD COLUMN `bill_type` varchar(255) NULL DEFAU -- 借阅表新增 状态 字段 ALTER TABLE archives_borrow_apply ADD COLUMN `status` varchar(64) NULL DEFAULT NULL COMMENT '状态'; +-- 移交表新增文件名称 +ALTER TABLE archives_turn_over ADD COLUMN `file_name` varchar(255) NULL DEFAULT NULL COMMENT '文件名称'; + ALTER TABLE archives_borrow_apply ADD COLUMN `status` varchar(64) NULL DEFAULT NULL COMMENT '状态'; alter table archives_borrow_apply alter column status set default 1; diff --git a/yudao-module-accounting/yudao-module-accounting-biz/src/main/java/cn/iocoder/yudao/module/accounting/controller/admin/bankslip/BankSlipController.java b/yudao-module-accounting/yudao-module-accounting-biz/src/main/java/cn/iocoder/yudao/module/accounting/controller/admin/bankslip/BankSlipController.java index 1981a38a..bdba3039 100644 --- a/yudao-module-accounting/yudao-module-accounting-biz/src/main/java/cn/iocoder/yudao/module/accounting/controller/admin/bankslip/BankSlipController.java +++ b/yudao-module-accounting/yudao-module-accounting-biz/src/main/java/cn/iocoder/yudao/module/accounting/controller/admin/bankslip/BankSlipController.java @@ -6,9 +6,11 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog; import cn.iocoder.yudao.module.accounting.controller.admin.bankslip.vo.*; +import cn.iocoder.yudao.module.accounting.controller.admin.invoices.vo.InvoicesUpdateArray; import cn.iocoder.yudao.module.accounting.convert.bankslip.BankSlipConvert; import cn.iocoder.yudao.module.accounting.dal.dataobject.bankslip.BankReceiptDO; import cn.iocoder.yudao.module.accounting.dal.dataobject.bankslip.BankSlipDO; +import cn.iocoder.yudao.module.accounting.dal.dataobject.invoices.InvoicesDO; import cn.iocoder.yudao.module.accounting.service.bankslip.BankSlipService; import cn.iocoder.yudao.module.bs.utils.BaiduOcrHandler; import cn.iocoder.yudao.module.infra.service.file.FileService; @@ -27,9 +29,7 @@ import javax.servlet.http.HttpServletResponse; import javax.validation.Valid; import java.io.DataInput; import java.io.IOException; -import java.util.Collection; -import java.util.List; -import java.util.UUID; +import java.util.*; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.error; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; @@ -63,6 +63,23 @@ public class BankSlipController { return success(true); } + @PutMapping("/update/array") + @Operation(summary = "更新发票") + @PreAuthorize("@ss.hasPermission('archives::bank-slip:update')") + public CommonResult updateInvoicesArray(@Valid @RequestBody BankSlipUpdateArray updateArray) { + List list = new LinkedList<>(); + List invoicesList = bankSlipService.getBankSlipList(Arrays.asList(updateArray.getId())); + for (BankSlipDO in : invoicesList) { + if (in.getVoucherId() !=null){ + return error(in.getVoucherId()+":该回单已被关联"); + } + in.setVoucherId(updateArray.getVoucherId()); + list.add(in); + } + bankSlipService.updateBankSlipArray(list); + return success(true); + } + @DeleteMapping("/delete") @Operation(summary = "删除银行回单") @Parameter(name = "id", description = "编号", required = true) diff --git a/yudao-module-accounting/yudao-module-accounting-biz/src/main/java/cn/iocoder/yudao/module/accounting/controller/admin/bankslip/vo/BankSlipUpdateArray.java b/yudao-module-accounting/yudao-module-accounting-biz/src/main/java/cn/iocoder/yudao/module/accounting/controller/admin/bankslip/vo/BankSlipUpdateArray.java new file mode 100644 index 00000000..f01de5db --- /dev/null +++ b/yudao-module-accounting/yudao-module-accounting-biz/src/main/java/cn/iocoder/yudao/module/accounting/controller/admin/bankslip/vo/BankSlipUpdateArray.java @@ -0,0 +1,19 @@ +package cn.iocoder.yudao.module.accounting.controller.admin.bankslip.vo; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 发票批量绑定关联凭证vo + */ +@Data +public class BankSlipUpdateArray { + + @Schema(description = "发票id", requiredMode = Schema.RequiredMode.REQUIRED, example = "5466") + private Long[] id; + + @Schema(description = "凭证id,一个凭证对应多个电子发票", requiredMode = Schema.RequiredMode.REQUIRED, example = "25675") + private Long voucherId; + +} diff --git a/yudao-module-accounting/yudao-module-accounting-biz/src/main/java/cn/iocoder/yudao/module/accounting/service/bankslip/BankSlipService.java b/yudao-module-accounting/yudao-module-accounting-biz/src/main/java/cn/iocoder/yudao/module/accounting/service/bankslip/BankSlipService.java index 83e53626..f9697a7c 100644 --- a/yudao-module-accounting/yudao-module-accounting-biz/src/main/java/cn/iocoder/yudao/module/accounting/service/bankslip/BankSlipService.java +++ b/yudao-module-accounting/yudao-module-accounting-biz/src/main/java/cn/iocoder/yudao/module/accounting/service/bankslip/BankSlipService.java @@ -89,4 +89,10 @@ public interface BankSlipService { * @param ocrResult */ BankSlipDO jsonToJavaObject(BankReceiptDO ocrResult, MultipartFile multipartFile) throws IOException; + + /** + * 银行回单多关联凭证 + * @param list + */ + void updateBankSlipArray(List list); } diff --git a/yudao-module-accounting/yudao-module-accounting-biz/src/main/java/cn/iocoder/yudao/module/accounting/service/bankslip/BankSlipServiceImpl.java b/yudao-module-accounting/yudao-module-accounting-biz/src/main/java/cn/iocoder/yudao/module/accounting/service/bankslip/BankSlipServiceImpl.java index 22947363..928b3efb 100644 --- a/yudao-module-accounting/yudao-module-accounting-biz/src/main/java/cn/iocoder/yudao/module/accounting/service/bankslip/BankSlipServiceImpl.java +++ b/yudao-module-accounting/yudao-module-accounting-biz/src/main/java/cn/iocoder/yudao/module/accounting/service/bankslip/BankSlipServiceImpl.java @@ -143,4 +143,13 @@ public class BankSlipServiceImpl implements BankSlipService { return bankSlipDO; } + /** + * 银行回单多关联凭证 + * @param list + */ + @Override + public void updateBankSlipArray(List list) { + bankSlipMapper.updateBatch(list, list.size()); + } + } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/UserController.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/UserController.java index 549982e3..bbfc7cd9 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/UserController.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/UserController.java @@ -111,9 +111,9 @@ public class UserController { @GetMapping("/list-all-simple") @Operation(summary = "获取用户精简信息列表", description = "只包含被开启的用户,主要用于前端的下拉选项") - public CommonResult> getSimpleUserList() { + public CommonResult> getSimpleUserList(UserSimpleRespVO userSimpleRespVO) { // 获用户列表,只要开启状态的 - List list = userService.getUserListByStatus(CommonStatusEnum.ENABLE.getStatus()); + List list = userService.getUserListByStatus(CommonStatusEnum.ENABLE.getStatus(),userSimpleRespVO); // 排序后,返回给前端 return success(UserConvert.INSTANCE.convertList04(list)); } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/user/AdminUserMapper.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/user/AdminUserMapper.java index 4e082721..74cf66a3 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/user/AdminUserMapper.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/user/AdminUserMapper.java @@ -1,10 +1,12 @@ package cn.iocoder.yudao.module.system.dal.mysql.user; import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.framework.common.util.string.StringUtils; import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; import cn.iocoder.yudao.module.system.controller.admin.user.vo.user.UserExportReqVO; import cn.iocoder.yudao.module.system.controller.admin.user.vo.user.UserPageReqVO; +import cn.iocoder.yudao.module.system.controller.admin.user.vo.user.UserSimpleRespVO; import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO; import org.apache.ibatis.annotations.Mapper; @@ -49,8 +51,10 @@ public interface AdminUserMapper extends BaseMapperX { return selectList(new LambdaQueryWrapperX().like(AdminUserDO::getNickname, nickname)); } - default List selectListByStatus(Integer status) { - return selectList(AdminUserDO::getStatus, status); + default List selectListByStatus(Integer status, UserSimpleRespVO userSimpleRespVO) { + LambdaQueryWrapperX wrapperX = new LambdaQueryWrapperX<>(); + wrapperX.eq(AdminUserDO::getStatus, status).likeIfPresent(AdminUserDO::getNickname,userSimpleRespVO.getNickname()); + return selectList(wrapperX); } default List selectListByDeptIds(Collection deptIds) { diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/user/AdminUserService.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/user/AdminUserService.java index e10b9e99..8e8926f4 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/user/AdminUserService.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/user/AdminUserService.java @@ -198,7 +198,7 @@ public interface AdminUserService { * @param status 状态 * @return 用户们 */ - List getUserListByStatus(Integer status); + List getUserListByStatus(Integer status,UserSimpleRespVO userSimpleRespVO); /** * 判断密码是否匹配 diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/user/AdminUserServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/user/AdminUserServiceImpl.java index bb43a89c..b19f7651 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/user/AdminUserServiceImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/user/AdminUserServiceImpl.java @@ -435,8 +435,8 @@ public class AdminUserServiceImpl implements AdminUserService { } @Override - public List getUserListByStatus(Integer status) { - return userMapper.selectListByStatus(status); + public List getUserListByStatus(Integer status,UserSimpleRespVO userSimpleRespVO) { + return userMapper.selectListByStatus(status,userSimpleRespVO); } @Override