银行回单多关联凭证,用户模块列表修改

new
parent eac740208f
commit 037824cab1

@ -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_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 ADD COLUMN `status` varchar(64) NULL DEFAULT NULL COMMENT '';
alter table archives_borrow_apply alter column status set default 1; alter table archives_borrow_apply alter column status set default 1;

@ -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.excel.core.util.ExcelUtils;
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog; 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.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.convert.bankslip.BankSlipConvert;
import cn.iocoder.yudao.module.accounting.dal.dataobject.bankslip.BankReceiptDO; 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.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.accounting.service.bankslip.BankSlipService;
import cn.iocoder.yudao.module.bs.utils.BaiduOcrHandler; import cn.iocoder.yudao.module.bs.utils.BaiduOcrHandler;
import cn.iocoder.yudao.module.infra.service.file.FileService; import cn.iocoder.yudao.module.infra.service.file.FileService;
@ -27,9 +29,7 @@ import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid; import javax.validation.Valid;
import java.io.DataInput; import java.io.DataInput;
import java.io.IOException; import java.io.IOException;
import java.util.Collection; import java.util.*;
import java.util.List;
import java.util.UUID;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.error; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.error;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
@ -63,6 +63,23 @@ public class BankSlipController {
return success(true); return success(true);
} }
@PutMapping("/update/array")
@Operation(summary = "更新发票")
@PreAuthorize("@ss.hasPermission('archives::bank-slip:update')")
public CommonResult<Boolean> updateInvoicesArray(@Valid @RequestBody BankSlipUpdateArray updateArray) {
List<BankSlipDO> list = new LinkedList<>();
List<BankSlipDO> 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") @DeleteMapping("/delete")
@Operation(summary = "删除银行回单") @Operation(summary = "删除银行回单")
@Parameter(name = "id", description = "编号", required = true) @Parameter(name = "id", description = "编号", required = true)

@ -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;
}

@ -89,4 +89,10 @@ public interface BankSlipService {
* @param ocrResult * @param ocrResult
*/ */
BankSlipDO jsonToJavaObject(BankReceiptDO ocrResult, MultipartFile multipartFile) throws IOException; BankSlipDO jsonToJavaObject(BankReceiptDO ocrResult, MultipartFile multipartFile) throws IOException;
/**
*
* @param list
*/
void updateBankSlipArray(List<BankSlipDO> list);
} }

@ -143,4 +143,13 @@ public class BankSlipServiceImpl implements BankSlipService {
return bankSlipDO; return bankSlipDO;
} }
/**
*
* @param list
*/
@Override
public void updateBankSlipArray(List<BankSlipDO> list) {
bankSlipMapper.updateBatch(list, list.size());
}
} }

@ -111,9 +111,9 @@ public class UserController {
@GetMapping("/list-all-simple") @GetMapping("/list-all-simple")
@Operation(summary = "获取用户精简信息列表", description = "只包含被开启的用户,主要用于前端的下拉选项") @Operation(summary = "获取用户精简信息列表", description = "只包含被开启的用户,主要用于前端的下拉选项")
public CommonResult<List<UserSimpleRespVO>> getSimpleUserList() { public CommonResult<List<UserSimpleRespVO>> getSimpleUserList(UserSimpleRespVO userSimpleRespVO) {
// 获用户列表,只要开启状态的 // 获用户列表,只要开启状态的
List<AdminUserDO> list = userService.getUserListByStatus(CommonStatusEnum.ENABLE.getStatus()); List<AdminUserDO> list = userService.getUserListByStatus(CommonStatusEnum.ENABLE.getStatus(),userSimpleRespVO);
// 排序后,返回给前端 // 排序后,返回给前端
return success(UserConvert.INSTANCE.convertList04(list)); return success(UserConvert.INSTANCE.convertList04(list));
} }

@ -1,10 +1,12 @@
package cn.iocoder.yudao.module.system.dal.mysql.user; package cn.iocoder.yudao.module.system.dal.mysql.user;
import cn.iocoder.yudao.framework.common.pojo.PageResult; 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.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; 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.UserExportReqVO;
import cn.iocoder.yudao.module.system.controller.admin.user.vo.user.UserPageReqVO; 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 cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
@ -49,8 +51,10 @@ public interface AdminUserMapper extends BaseMapperX<AdminUserDO> {
return selectList(new LambdaQueryWrapperX<AdminUserDO>().like(AdminUserDO::getNickname, nickname)); return selectList(new LambdaQueryWrapperX<AdminUserDO>().like(AdminUserDO::getNickname, nickname));
} }
default List<AdminUserDO> selectListByStatus(Integer status) { default List<AdminUserDO> selectListByStatus(Integer status, UserSimpleRespVO userSimpleRespVO) {
return selectList(AdminUserDO::getStatus, status); LambdaQueryWrapperX<AdminUserDO> wrapperX = new LambdaQueryWrapperX<>();
wrapperX.eq(AdminUserDO::getStatus, status).likeIfPresent(AdminUserDO::getNickname,userSimpleRespVO.getNickname());
return selectList(wrapperX);
} }
default List<AdminUserDO> selectListByDeptIds(Collection<Long> deptIds) { default List<AdminUserDO> selectListByDeptIds(Collection<Long> deptIds) {

@ -198,7 +198,7 @@ public interface AdminUserService {
* @param status * @param status
* @return * @return
*/ */
List<AdminUserDO> getUserListByStatus(Integer status); List<AdminUserDO> getUserListByStatus(Integer status,UserSimpleRespVO userSimpleRespVO);
/** /**
* *

@ -435,8 +435,8 @@ public class AdminUserServiceImpl implements AdminUserService {
} }
@Override @Override
public List<AdminUserDO> getUserListByStatus(Integer status) { public List<AdminUserDO> getUserListByStatus(Integer status,UserSimpleRespVO userSimpleRespVO) {
return userMapper.selectListByStatus(status); return userMapper.selectListByStatus(status,userSimpleRespVO);
} }
@Override @Override

Loading…
Cancel
Save