Showing
16 changed files
with
1014 additions
and
0 deletions
.workbuddy/memory/2026-11-06.md
0 → 100644
| 1 | + | ||
| 2 | +## 2026-11-06 资金支付-供应商信息新模块(后端) | ||
| 3 | + | ||
| 4 | +- 新建模块:资金支付-供应商信息(fund_payment_supplier,utf8mb3),字段:客户名称/开户行/卡号(卡号文本、中间含空格,比对时忽略空格) | ||
| 5 | +- 位置:xingyun-sc,controller/ledger/FundPaymentSupplierController,路由 /fund/payment/supplier,权限前缀 fund-manage:payment-supplier:* | ||
| 6 | +- 完整链路:entity → vo/ledger/fundpayment → bo/ledger/fundpayment → mappers/FundPaymentSupplierMapper(+resources/mappers/ledger/XML) → service+impl/ledger → excel/ledger(导入模型/监听器/导出模型) → controller | ||
| 7 | +- 功能:分页查询(名称/开户行/卡号模糊,卡号查重忽略空格)、增/改/删(物理删除)、同步导出(GET /export 按筛选条件)、导入模板(GET /import/template)、导入(POST /import,客户名称+卡号唯一,文件内与库内均查重) | ||
| 8 | +- 参照实现:RecapitalizeController(CRUD+导入)、SupplierImportListener(导入校验模式) | ||
| 9 | +- SQL 已追加到 xingyun-api/src/main/resources/db/chujiang/base.sql 尾部(CREATE TABLE fund_payment_supplier) | ||
| 10 | +- 编译验证:mvn -o compile 仅存量 3 个文件报错(FlowTaskServiceImpl/BusinessDataHandlerServiceImpl/BusinessDataExportHandler,与历史日志一致,系本地 bpm/mq jar 版本问题),新文件无编译错误 | ||
| 11 | +- 待办:前端需新建页面与菜单权限(query/add/modify/delete/import/export);存量库执行 base.sql 尾部的建表语句 | ||
| 12 | + | ||
| 13 | +## 补充:资金支付-供应商信息模块整体迁移到 procurement 包 | ||
| 14 | + | ||
| 15 | +- 用户要求:资金支付属采购线,代码放 `com/lframework/xingyun/sc/procurement` 下 | ||
| 16 | +- 新位置:procurement/{entity,vo,mappers,service,impl,controller}/fundpayment/;Bo 在 sc/bo/procurement/(项目惯例);Excel 在 sc/excel/fundPayment/;XML 在 resources/mappers/procurement/fundpayment/ | ||
| 17 | +- 同步调整:路由改为 /procurement/fundPaymentSupplier;权限前缀改为 procure-manage:payment-supplier:*(照抄采购线惯例);表名仍为 fund_payment_supplier 未变 | ||
| 18 | +- 旧位置 14 个文件已全部删除,无残留引用;编译验证仅存量 3 文件报错(与历史一致),新代码零错误 | ||
| 19 | + | ||
| 20 | +## 补充:资金支付供应商导入查重口径改为三字段 | ||
| 21 | + | ||
| 22 | +- 规则变更:原"客户名称+卡号"两项去重 → 改为"客户名称+开户行+卡号"三项完全一致才算重复(卡号仍忽略空格比对,开户行空串与 null 视为相同) | ||
| 23 | +- 同步改动:Service 方法 getByCustomerNameAndCardNo → getDuplicate(customerName, bankName, cardNo);create/update/导入监听器三处统一走同一口径(避坑清单 #1 口径一致性) | ||
| 24 | +- 导入文件内重复提示保留行号;库内重复提示"第N行的数据系统中已存在" | ||
| 25 | + | ||
| 26 | +## 修正:资金支付供应商导入报错行号 | ||
| 27 | + | ||
| 28 | +- 问题:EasyExcel 的 context.readRowHolder().getRowIndex() 从 0 开始且含表头行,直接输出会少一行 | ||
| 29 | +- 修正:rowNum = getRowIndex() + 1,报错显示 Excel 实际行号(第1行为表头,数据从第2行始) | ||
| 30 | +- 重复提示的"与第M行重复"改用 Map<查重key, 首次出现的Excel行号>,不再用数据列表下标+1 |
| @@ -3027,3 +3027,17 @@ CREATE TABLE IF NOT EXISTS `procurement_buyout_account_order_line` | @@ -3027,3 +3027,17 @@ CREATE TABLE IF NOT EXISTS `procurement_buyout_account_order_line` | ||
| 3027 | PRIMARY KEY (`id`), | 3027 | PRIMARY KEY (`id`), |
| 3028 | KEY `idx_pbaol_order_id` (`order_id`) | 3028 | KEY `idx_pbaol_order_id` (`order_id`) |
| 3029 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='买断入库核算单-明细'; | 3029 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='买断入库核算单-明细'; |
| 3030 | + | ||
| 3031 | +CREATE TABLE `fund_payment_supplier` ( | ||
| 3032 | + `id` varchar(32) NOT NULL COMMENT 'ID', | ||
| 3033 | + `customer_name` varchar(200) NOT NULL COMMENT '客户名称', | ||
| 3034 | + `bank_name` varchar(200) DEFAULT NULL COMMENT '开户行', | ||
| 3035 | + `card_no` varchar(50) NOT NULL COMMENT '卡号(文本,中间可含空格便于阅读)', | ||
| 3036 | + `create_by_id` varchar(32) NOT NULL COMMENT '创建人ID', | ||
| 3037 | + `create_by` varchar(20) NOT NULL COMMENT '创建人', | ||
| 3038 | + `update_by_id` varchar(32) NOT NULL COMMENT '更新人ID', | ||
| 3039 | + `update_by` varchar(20) NOT NULL COMMENT '更新人', | ||
| 3040 | + `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', | ||
| 3041 | + `update_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间', | ||
| 3042 | + PRIMARY KEY (`id`) | ||
| 3043 | +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='资金支付-供应商信息'; |
xingyun-sc/src/main/java/com/lframework/xingyun/sc/bo/procurement/GetFundPaymentSupplierBo.java
0 → 100644
| 1 | +package com.lframework.xingyun.sc.bo.procurement; | ||
| 2 | + | ||
| 3 | +import com.lframework.starter.web.core.bo.BaseBo; | ||
| 4 | +import com.lframework.xingyun.sc.procurement.entity.fundpayment.FundPaymentSupplier; | ||
| 5 | +import io.swagger.annotations.ApiModelProperty; | ||
| 6 | +import java.time.LocalDateTime; | ||
| 7 | +import lombok.Data; | ||
| 8 | + | ||
| 9 | +/** | ||
| 10 | + * <p> | ||
| 11 | + * 资金支付-供应商信息 GetBo | ||
| 12 | + * </p> | ||
| 13 | + * | ||
| 14 | + */ | ||
| 15 | +@Data | ||
| 16 | +public class GetFundPaymentSupplierBo extends BaseBo<FundPaymentSupplier> { | ||
| 17 | + | ||
| 18 | + /** | ||
| 19 | + * ID | ||
| 20 | + */ | ||
| 21 | + @ApiModelProperty("ID") | ||
| 22 | + private String id; | ||
| 23 | + | ||
| 24 | + /** | ||
| 25 | + * 客户名称 | ||
| 26 | + */ | ||
| 27 | + @ApiModelProperty("客户名称") | ||
| 28 | + private String customerName; | ||
| 29 | + | ||
| 30 | + /** | ||
| 31 | + * 开户行 | ||
| 32 | + */ | ||
| 33 | + @ApiModelProperty("开户行") | ||
| 34 | + private String bankName; | ||
| 35 | + | ||
| 36 | + /** | ||
| 37 | + * 卡号 | ||
| 38 | + */ | ||
| 39 | + @ApiModelProperty("卡号") | ||
| 40 | + private String cardNo; | ||
| 41 | + | ||
| 42 | + /** | ||
| 43 | + * 创建人 | ||
| 44 | + */ | ||
| 45 | + @ApiModelProperty("创建人") | ||
| 46 | + private String createBy; | ||
| 47 | + | ||
| 48 | + /** | ||
| 49 | + * 创建时间 | ||
| 50 | + */ | ||
| 51 | + @ApiModelProperty("创建时间") | ||
| 52 | + private LocalDateTime createTime; | ||
| 53 | + | ||
| 54 | + public GetFundPaymentSupplierBo() { | ||
| 55 | + | ||
| 56 | + } | ||
| 57 | + | ||
| 58 | + public GetFundPaymentSupplierBo(FundPaymentSupplier dto) { | ||
| 59 | + | ||
| 60 | + super(dto); | ||
| 61 | + } | ||
| 62 | +} |
xingyun-sc/src/main/java/com/lframework/xingyun/sc/bo/procurement/QueryFundPaymentSupplierBo.java
0 → 100644
| 1 | +package com.lframework.xingyun.sc.bo.procurement; | ||
| 2 | + | ||
| 3 | +import com.lframework.starter.web.core.bo.BaseBo; | ||
| 4 | +import com.lframework.xingyun.sc.procurement.entity.fundpayment.FundPaymentSupplier; | ||
| 5 | +import io.swagger.annotations.ApiModelProperty; | ||
| 6 | +import java.time.LocalDateTime; | ||
| 7 | +import lombok.Data; | ||
| 8 | + | ||
| 9 | +/** | ||
| 10 | + * <p> | ||
| 11 | + * 资金支付-供应商信息 QueryBo | ||
| 12 | + * </p> | ||
| 13 | + * | ||
| 14 | + */ | ||
| 15 | +@Data | ||
| 16 | +public class QueryFundPaymentSupplierBo extends BaseBo<FundPaymentSupplier> { | ||
| 17 | + | ||
| 18 | + /** | ||
| 19 | + * ID | ||
| 20 | + */ | ||
| 21 | + @ApiModelProperty("ID") | ||
| 22 | + private String id; | ||
| 23 | + | ||
| 24 | + /** | ||
| 25 | + * 客户名称 | ||
| 26 | + */ | ||
| 27 | + @ApiModelProperty("客户名称") | ||
| 28 | + private String customerName; | ||
| 29 | + | ||
| 30 | + /** | ||
| 31 | + * 开户行 | ||
| 32 | + */ | ||
| 33 | + @ApiModelProperty("开户行") | ||
| 34 | + private String bankName; | ||
| 35 | + | ||
| 36 | + /** | ||
| 37 | + * 卡号 | ||
| 38 | + */ | ||
| 39 | + @ApiModelProperty("卡号") | ||
| 40 | + private String cardNo; | ||
| 41 | + | ||
| 42 | + /** | ||
| 43 | + * 创建人 | ||
| 44 | + */ | ||
| 45 | + @ApiModelProperty("创建人") | ||
| 46 | + private String createBy; | ||
| 47 | + | ||
| 48 | + /** | ||
| 49 | + * 创建时间 | ||
| 50 | + */ | ||
| 51 | + @ApiModelProperty("创建时间") | ||
| 52 | + private LocalDateTime createTime; | ||
| 53 | + | ||
| 54 | + public QueryFundPaymentSupplierBo() { | ||
| 55 | + | ||
| 56 | + } | ||
| 57 | + | ||
| 58 | + public QueryFundPaymentSupplierBo(FundPaymentSupplier dto) { | ||
| 59 | + | ||
| 60 | + super(dto); | ||
| 61 | + } | ||
| 62 | +} |
| 1 | +package com.lframework.xingyun.sc.excel.fundPayment; | ||
| 2 | + | ||
| 3 | +import com.alibaba.excel.annotation.ExcelProperty; | ||
| 4 | +import com.lframework.starter.web.core.components.excel.ExcelModel; | ||
| 5 | +import com.lframework.xingyun.sc.procurement.entity.fundpayment.FundPaymentSupplier; | ||
| 6 | +import lombok.Data; | ||
| 7 | + | ||
| 8 | +@Data | ||
| 9 | +public class FundPaymentSupplierExportModel implements ExcelModel { | ||
| 10 | + | ||
| 11 | + /** | ||
| 12 | + * 客户名称 | ||
| 13 | + */ | ||
| 14 | + @ExcelProperty("客户名称") | ||
| 15 | + private String customerName; | ||
| 16 | + | ||
| 17 | + /** | ||
| 18 | + * 开户行 | ||
| 19 | + */ | ||
| 20 | + @ExcelProperty("开户行") | ||
| 21 | + private String bankName; | ||
| 22 | + | ||
| 23 | + /** | ||
| 24 | + * 卡号 | ||
| 25 | + */ | ||
| 26 | + @ExcelProperty("卡号") | ||
| 27 | + private String cardNo; | ||
| 28 | + | ||
| 29 | + public FundPaymentSupplierExportModel() { | ||
| 30 | + | ||
| 31 | + } | ||
| 32 | + | ||
| 33 | + public FundPaymentSupplierExportModel(FundPaymentSupplier dto) { | ||
| 34 | + | ||
| 35 | + this.customerName = dto.getCustomerName(); | ||
| 36 | + this.bankName = dto.getBankName(); | ||
| 37 | + this.cardNo = dto.getCardNo(); | ||
| 38 | + } | ||
| 39 | +} |
| 1 | +package com.lframework.xingyun.sc.excel.fundPayment; | ||
| 2 | + | ||
| 3 | +import com.alibaba.excel.context.AnalysisContext; | ||
| 4 | +import com.lframework.starter.common.exceptions.impl.DefaultClientException; | ||
| 5 | +import com.lframework.starter.common.utils.StringUtil; | ||
| 6 | +import com.lframework.starter.web.core.components.excel.ExcelImportListener; | ||
| 7 | +import com.lframework.starter.web.core.utils.ApplicationUtil; | ||
| 8 | +import com.lframework.xingyun.sc.procurement.entity.fundpayment.FundPaymentSupplier; | ||
| 9 | +import com.lframework.xingyun.sc.procurement.service.fundpayment.FundPaymentSupplierService; | ||
| 10 | +import com.lframework.xingyun.sc.procurement.vo.fundpayment.CreateFundPaymentSupplierVo; | ||
| 11 | +import java.util.LinkedHashMap; | ||
| 12 | +import java.util.List; | ||
| 13 | +import java.util.Map; | ||
| 14 | +import lombok.extern.slf4j.Slf4j; | ||
| 15 | + | ||
| 16 | +@Slf4j | ||
| 17 | +public class FundPaymentSupplierImportListener extends ExcelImportListener<FundPaymentSupplierImportModel> { | ||
| 18 | + | ||
| 19 | + /** | ||
| 20 | + * 文件内查重用:客户名称 + 开户行 + 忽略空格后的卡号 -> 首次出现的数据所在 Excel 行号(第1行为表头,数据从第2行开始) | ||
| 21 | + */ | ||
| 22 | + private Map<String, Integer> checkMap = new LinkedHashMap<>(); | ||
| 23 | + | ||
| 24 | + @Override | ||
| 25 | + protected void doInvoke(FundPaymentSupplierImportModel data, AnalysisContext context) { | ||
| 26 | + // getRowIndex() 从 0 开始且包含表头行,+1 后即为 Excel 中看到的实际行号(第1行为表头) | ||
| 27 | + int rowNum = context.readRowHolder().getRowIndex() + 1; | ||
| 28 | + if (StringUtil.isBlank(data.getCustomerName())) { | ||
| 29 | + throw new DefaultClientException("第" + rowNum + "行“客户名称”不能为空"); | ||
| 30 | + } | ||
| 31 | + if (data.getCustomerName().length() > 200) { | ||
| 32 | + throw new DefaultClientException("第" + rowNum + "行“客户名称”最多允许200个字符"); | ||
| 33 | + } | ||
| 34 | + if (StringUtil.isBlank(data.getCardNo())) { | ||
| 35 | + throw new DefaultClientException("第" + rowNum + "行“卡号”不能为空"); | ||
| 36 | + } | ||
| 37 | + if (data.getCardNo().length() > 50) { | ||
| 38 | + throw new DefaultClientException("第" + rowNum + "行“卡号”最多允许50个字符"); | ||
| 39 | + } | ||
| 40 | + if (StringUtil.isNotBlank(data.getBankName()) && data.getBankName().length() > 200) { | ||
| 41 | + throw new DefaultClientException("第" + rowNum + "行“开户行”最多允许200个字符"); | ||
| 42 | + } | ||
| 43 | + // 客户名称、开户行、卡号三项完全一致才算重复 | ||
| 44 | + String normalizedBankName = StringUtil.isBlank(data.getBankName()) ? "" : data.getBankName().trim(); | ||
| 45 | + String checkKey = data.getCustomerName().trim() + "_" + normalizedBankName + "_" | ||
| 46 | + + data.getCardNo().replace(" ", ""); | ||
| 47 | + if (checkMap.containsKey(checkKey)) { | ||
| 48 | + throw new DefaultClientException( | ||
| 49 | + "第" + rowNum + "行与第" + checkMap.get(checkKey) + "行重复"); | ||
| 50 | + } | ||
| 51 | + checkMap.put(checkKey, rowNum); | ||
| 52 | + | ||
| 53 | + FundPaymentSupplierService fundPaymentSupplierService = ApplicationUtil | ||
| 54 | + .getBean(FundPaymentSupplierService.class); | ||
| 55 | + FundPaymentSupplier existed = fundPaymentSupplierService | ||
| 56 | + .getDuplicate(data.getCustomerName().trim(), data.getBankName(), data.getCardNo().trim()); | ||
| 57 | + if (existed != null) { | ||
| 58 | + throw new DefaultClientException("第" + rowNum + "行的数据系统中已存在"); | ||
| 59 | + } | ||
| 60 | + } | ||
| 61 | + | ||
| 62 | + @Override | ||
| 63 | + protected void afterAllAnalysed(AnalysisContext context) { | ||
| 64 | + | ||
| 65 | + FundPaymentSupplierService fundPaymentSupplierService = ApplicationUtil | ||
| 66 | + .getBean(FundPaymentSupplierService.class); | ||
| 67 | + | ||
| 68 | + List<FundPaymentSupplierImportModel> datas = this.getDatas(); | ||
| 69 | + for (int i = 0; i < datas.size(); i++) { | ||
| 70 | + FundPaymentSupplierImportModel data = datas.get(i); | ||
| 71 | + | ||
| 72 | + CreateFundPaymentSupplierVo createVo = new CreateFundPaymentSupplierVo(); | ||
| 73 | + //客户名称 | ||
| 74 | + createVo.setCustomerName(data.getCustomerName().trim()); | ||
| 75 | + //开户行 | ||
| 76 | + createVo.setBankName(StringUtil.isBlank(data.getBankName()) ? null : data.getBankName().trim()); | ||
| 77 | + //卡号 | ||
| 78 | + createVo.setCardNo(data.getCardNo().trim()); | ||
| 79 | + | ||
| 80 | + fundPaymentSupplierService.create(createVo); | ||
| 81 | + | ||
| 82 | + this.setSuccessProcess(i); | ||
| 83 | + } | ||
| 84 | + } | ||
| 85 | + | ||
| 86 | + @Override | ||
| 87 | + protected void doComplete() { | ||
| 88 | + } | ||
| 89 | +} |
| 1 | +package com.lframework.xingyun.sc.excel.fundPayment; | ||
| 2 | + | ||
| 3 | +import com.alibaba.excel.annotation.ExcelIgnore; | ||
| 4 | +import com.alibaba.excel.annotation.ExcelProperty; | ||
| 5 | +import com.lframework.starter.web.core.annotations.excel.ExcelRequired; | ||
| 6 | +import com.lframework.starter.web.core.components.excel.ExcelModel; | ||
| 7 | +import lombok.Data; | ||
| 8 | + | ||
| 9 | +@Data | ||
| 10 | +public class FundPaymentSupplierImportModel implements ExcelModel { | ||
| 11 | + | ||
| 12 | + /** | ||
| 13 | + * ID | ||
| 14 | + */ | ||
| 15 | + @ExcelIgnore | ||
| 16 | + private String id; | ||
| 17 | + | ||
| 18 | + /** | ||
| 19 | + * 客户名称 | ||
| 20 | + */ | ||
| 21 | + @ExcelRequired | ||
| 22 | + @ExcelProperty("*客户名称") | ||
| 23 | + private String customerName; | ||
| 24 | + | ||
| 25 | + /** | ||
| 26 | + * 开户行 | ||
| 27 | + */ | ||
| 28 | + @ExcelProperty("开户行") | ||
| 29 | + private String bankName; | ||
| 30 | + | ||
| 31 | + /** | ||
| 32 | + * 卡号 | ||
| 33 | + */ | ||
| 34 | + @ExcelRequired | ||
| 35 | + @ExcelProperty("*卡号") | ||
| 36 | + private String cardNo; | ||
| 37 | +} |
| 1 | +package com.lframework.xingyun.sc.procurement.controller.fundpayment; | ||
| 2 | + | ||
| 3 | +import com.lframework.starter.common.exceptions.impl.DefaultClientException; | ||
| 4 | +import com.lframework.starter.common.utils.CollectionUtil; | ||
| 5 | +import com.lframework.starter.web.core.annotations.security.HasPermission; | ||
| 6 | +import com.lframework.starter.web.core.components.resp.InvokeResult; | ||
| 7 | +import com.lframework.starter.web.core.components.resp.InvokeResultBuilder; | ||
| 8 | +import com.lframework.starter.web.core.components.resp.PageResult; | ||
| 9 | +import com.lframework.starter.web.core.controller.DefaultBaseController; | ||
| 10 | +import com.lframework.starter.web.core.utils.ExcelUtil; | ||
| 11 | +import com.lframework.starter.web.core.utils.PageResultUtil; | ||
| 12 | +import com.lframework.xingyun.sc.bo.procurement.GetFundPaymentSupplierBo; | ||
| 13 | +import com.lframework.xingyun.sc.bo.procurement.QueryFundPaymentSupplierBo; | ||
| 14 | +import com.lframework.xingyun.sc.excel.fundPayment.FundPaymentSupplierExportModel; | ||
| 15 | +import com.lframework.xingyun.sc.excel.fundPayment.FundPaymentSupplierImportListener; | ||
| 16 | +import com.lframework.xingyun.sc.excel.fundPayment.FundPaymentSupplierImportModel; | ||
| 17 | +import com.lframework.xingyun.sc.procurement.entity.fundpayment.FundPaymentSupplier; | ||
| 18 | +import com.lframework.xingyun.sc.procurement.service.fundpayment.FundPaymentSupplierService; | ||
| 19 | +import com.lframework.xingyun.sc.procurement.vo.fundpayment.CreateFundPaymentSupplierVo; | ||
| 20 | +import com.lframework.xingyun.sc.procurement.vo.fundpayment.QueryFundPaymentSupplierVo; | ||
| 21 | +import com.lframework.xingyun.sc.procurement.vo.fundpayment.UpdateFundPaymentSupplierVo; | ||
| 22 | +import io.swagger.annotations.Api; | ||
| 23 | +import io.swagger.annotations.ApiImplicitParam; | ||
| 24 | +import io.swagger.annotations.ApiOperation; | ||
| 25 | +import java.util.List; | ||
| 26 | +import java.util.stream.Collectors; | ||
| 27 | +import javax.servlet.http.HttpServletResponse; | ||
| 28 | +import javax.validation.Valid; | ||
| 29 | +import javax.validation.constraints.NotBlank; | ||
| 30 | +import javax.validation.constraints.NotNull; | ||
| 31 | +import org.springframework.beans.factory.annotation.Autowired; | ||
| 32 | +import org.springframework.validation.annotation.Validated; | ||
| 33 | +import org.springframework.web.bind.annotation.DeleteMapping; | ||
| 34 | +import org.springframework.web.bind.annotation.GetMapping; | ||
| 35 | +import org.springframework.web.bind.annotation.PostMapping; | ||
| 36 | +import org.springframework.web.bind.annotation.PutMapping; | ||
| 37 | +import org.springframework.web.bind.annotation.RequestBody; | ||
| 38 | +import org.springframework.web.bind.annotation.RequestMapping; | ||
| 39 | +import org.springframework.web.bind.annotation.RestController; | ||
| 40 | +import org.springframework.web.multipart.MultipartFile; | ||
| 41 | + | ||
| 42 | +/** | ||
| 43 | + * 资金支付-供应商信息 Controller | ||
| 44 | + * | ||
| 45 | + */ | ||
| 46 | +@Api(tags = "资金支付-供应商信息") | ||
| 47 | +@Validated | ||
| 48 | +@RestController | ||
| 49 | +@RequestMapping("/procurement/fundPaymentSupplier") | ||
| 50 | +public class FundPaymentSupplierController extends DefaultBaseController { | ||
| 51 | + | ||
| 52 | + @Autowired | ||
| 53 | + private FundPaymentSupplierService fundPaymentSupplierService; | ||
| 54 | + | ||
| 55 | + /** | ||
| 56 | + * 查询列表 | ||
| 57 | + */ | ||
| 58 | + @ApiOperation("查询列表") | ||
| 59 | + @HasPermission({"procure-manage:payment-supplier:query"}) | ||
| 60 | + @GetMapping("/query") | ||
| 61 | + public InvokeResult<PageResult<QueryFundPaymentSupplierBo>> query(@Valid QueryFundPaymentSupplierVo vo) { | ||
| 62 | + | ||
| 63 | + PageResult<FundPaymentSupplier> pageResult = fundPaymentSupplierService | ||
| 64 | + .query(getPageIndex(vo), getPageSize(vo), vo); | ||
| 65 | + | ||
| 66 | + List<FundPaymentSupplier> datas = pageResult.getDatas(); | ||
| 67 | + List<QueryFundPaymentSupplierBo> results = null; | ||
| 68 | + | ||
| 69 | + if (!CollectionUtil.isEmpty(datas)) { | ||
| 70 | + results = datas.stream().map(QueryFundPaymentSupplierBo::new).collect(Collectors.toList()); | ||
| 71 | + } | ||
| 72 | + | ||
| 73 | + return InvokeResultBuilder.success(PageResultUtil.rebuild(pageResult, results)); | ||
| 74 | + } | ||
| 75 | + | ||
| 76 | + /** | ||
| 77 | + * 根据ID查询 | ||
| 78 | + */ | ||
| 79 | + @ApiOperation("根据ID查询") | ||
| 80 | + @ApiImplicitParam(value = "ID", name = "id", paramType = "query", required = true) | ||
| 81 | + @HasPermission({"procure-manage:payment-supplier:query"}) | ||
| 82 | + @GetMapping | ||
| 83 | + public InvokeResult<GetFundPaymentSupplierBo> get(@NotBlank(message = "ID不能为空!") String id) { | ||
| 84 | + | ||
| 85 | + FundPaymentSupplier data = fundPaymentSupplierService.findById(id); | ||
| 86 | + if (data == null) { | ||
| 87 | + throw new DefaultClientException("资金支付供应商信息不存在!"); | ||
| 88 | + } | ||
| 89 | + | ||
| 90 | + GetFundPaymentSupplierBo result = new GetFundPaymentSupplierBo(data); | ||
| 91 | + | ||
| 92 | + return InvokeResultBuilder.success(result); | ||
| 93 | + } | ||
| 94 | + | ||
| 95 | + /** | ||
| 96 | + * 新增 | ||
| 97 | + */ | ||
| 98 | + @ApiOperation("新增") | ||
| 99 | + @HasPermission({"procure-manage:payment-supplier:add"}) | ||
| 100 | + @PostMapping | ||
| 101 | + public InvokeResult<Void> create(@Valid @RequestBody CreateFundPaymentSupplierVo vo) { | ||
| 102 | + | ||
| 103 | + fundPaymentSupplierService.create(vo); | ||
| 104 | + | ||
| 105 | + return InvokeResultBuilder.success(); | ||
| 106 | + } | ||
| 107 | + | ||
| 108 | + /** | ||
| 109 | + * 修改 | ||
| 110 | + */ | ||
| 111 | + @ApiOperation("修改") | ||
| 112 | + @HasPermission({"procure-manage:payment-supplier:modify"}) | ||
| 113 | + @PutMapping | ||
| 114 | + public InvokeResult<Void> update(@Valid @RequestBody UpdateFundPaymentSupplierVo vo) { | ||
| 115 | + | ||
| 116 | + fundPaymentSupplierService.update(vo); | ||
| 117 | + | ||
| 118 | + return InvokeResultBuilder.success(); | ||
| 119 | + } | ||
| 120 | + | ||
| 121 | + /** | ||
| 122 | + * 根据ID删除 | ||
| 123 | + */ | ||
| 124 | + @ApiOperation("根据ID删除") | ||
| 125 | + @ApiImplicitParam(value = "ID", name = "id", paramType = "query", required = true) | ||
| 126 | + @HasPermission({"procure-manage:payment-supplier:delete"}) | ||
| 127 | + @DeleteMapping | ||
| 128 | + public InvokeResult<Void> deleteById(@NotBlank(message = "ID不能为空!") String id) { | ||
| 129 | + | ||
| 130 | + fundPaymentSupplierService.deleteById(id); | ||
| 131 | + | ||
| 132 | + return InvokeResultBuilder.success(); | ||
| 133 | + } | ||
| 134 | + | ||
| 135 | + /** | ||
| 136 | + * 导出(按筛选条件导出全部数据) | ||
| 137 | + */ | ||
| 138 | + @ApiOperation("导出") | ||
| 139 | + @HasPermission({"procure-manage:payment-supplier:query", "procure-manage:payment-supplier:export"}) | ||
| 140 | + @GetMapping("/export") | ||
| 141 | + public void export(@Valid QueryFundPaymentSupplierVo vo, HttpServletResponse response) { | ||
| 142 | + | ||
| 143 | + List<FundPaymentSupplier> datas = fundPaymentSupplierService.query(vo); | ||
| 144 | + | ||
| 145 | + List<FundPaymentSupplierExportModel> results = datas.stream() | ||
| 146 | + .map(FundPaymentSupplierExportModel::new).collect(Collectors.toList()); | ||
| 147 | + | ||
| 148 | + ExcelUtil.exportXls("资金支付供应商信息", FundPaymentSupplierExportModel.class, results); | ||
| 149 | + } | ||
| 150 | + | ||
| 151 | + /** | ||
| 152 | + * 下载导入模板 | ||
| 153 | + */ | ||
| 154 | + @ApiOperation("下载导入模板") | ||
| 155 | + @HasPermission({"procure-manage:payment-supplier:import"}) | ||
| 156 | + @GetMapping("/import/template") | ||
| 157 | + public void downloadImportTemplate() { | ||
| 158 | + ExcelUtil.exportXls("资金支付供应商信息导入模板", FundPaymentSupplierImportModel.class); | ||
| 159 | + } | ||
| 160 | + | ||
| 161 | + /** | ||
| 162 | + * 导入 | ||
| 163 | + */ | ||
| 164 | + @ApiOperation("导入") | ||
| 165 | + @HasPermission({"procure-manage:payment-supplier:import"}) | ||
| 166 | + @PostMapping("/import") | ||
| 167 | + public InvokeResult<Void> importExcel(@NotBlank(message = "ID不能为空") String id, | ||
| 168 | + @NotNull(message = "请上传文件") MultipartFile file) { | ||
| 169 | + | ||
| 170 | + FundPaymentSupplierImportListener listener = new FundPaymentSupplierImportListener(); | ||
| 171 | + listener.setTaskId(id); | ||
| 172 | + ExcelUtil.read(file, FundPaymentSupplierImportModel.class, listener).sheet().doRead(); | ||
| 173 | + | ||
| 174 | + return InvokeResultBuilder.success(); | ||
| 175 | + } | ||
| 176 | +} |
| 1 | +package com.lframework.xingyun.sc.procurement.entity.fundpayment; | ||
| 2 | + | ||
| 3 | +import com.baomidou.mybatisplus.annotation.FieldFill; | ||
| 4 | +import com.baomidou.mybatisplus.annotation.TableField; | ||
| 5 | +import com.baomidou.mybatisplus.annotation.TableName; | ||
| 6 | +import com.lframework.starter.web.core.dto.BaseDto; | ||
| 7 | +import com.lframework.starter.web.core.entity.BaseEntity; | ||
| 8 | +import java.time.LocalDateTime; | ||
| 9 | +import lombok.Data; | ||
| 10 | + | ||
| 11 | +/** | ||
| 12 | + * <p> | ||
| 13 | + * 资金支付-供应商信息 | ||
| 14 | + * </p> | ||
| 15 | + * | ||
| 16 | + */ | ||
| 17 | +@Data | ||
| 18 | +@TableName("fund_payment_supplier") | ||
| 19 | +public class FundPaymentSupplier extends BaseEntity implements BaseDto { | ||
| 20 | + | ||
| 21 | + private static final long serialVersionUID = 1L; | ||
| 22 | + | ||
| 23 | + public static final String CACHE_NAME = "FundPaymentSupplier"; | ||
| 24 | + | ||
| 25 | + /** | ||
| 26 | + * ID | ||
| 27 | + */ | ||
| 28 | + private String id; | ||
| 29 | + | ||
| 30 | + /** | ||
| 31 | + * 客户名称 | ||
| 32 | + */ | ||
| 33 | + private String customerName; | ||
| 34 | + | ||
| 35 | + /** | ||
| 36 | + * 开户行 | ||
| 37 | + */ | ||
| 38 | + private String bankName; | ||
| 39 | + | ||
| 40 | + /** | ||
| 41 | + * 卡号(文本,中间可含空格便于阅读) | ||
| 42 | + */ | ||
| 43 | + private String cardNo; | ||
| 44 | + | ||
| 45 | + /** | ||
| 46 | + * 创建人ID | ||
| 47 | + */ | ||
| 48 | + @TableField(fill = FieldFill.INSERT) | ||
| 49 | + private String createById; | ||
| 50 | + | ||
| 51 | + /** | ||
| 52 | + * 创建人 | ||
| 53 | + */ | ||
| 54 | + @TableField(fill = FieldFill.INSERT) | ||
| 55 | + private String createBy; | ||
| 56 | + | ||
| 57 | + /** | ||
| 58 | + * 更新人ID | ||
| 59 | + */ | ||
| 60 | + @TableField(fill = FieldFill.INSERT_UPDATE) | ||
| 61 | + private String updateById; | ||
| 62 | + | ||
| 63 | + /** | ||
| 64 | + * 更新人 | ||
| 65 | + */ | ||
| 66 | + @TableField(fill = FieldFill.INSERT_UPDATE) | ||
| 67 | + private String updateBy; | ||
| 68 | + | ||
| 69 | + /** | ||
| 70 | + * 创建时间 | ||
| 71 | + */ | ||
| 72 | + @TableField(fill = FieldFill.INSERT) | ||
| 73 | + private LocalDateTime createTime; | ||
| 74 | + | ||
| 75 | + /** | ||
| 76 | + * 更新时间 | ||
| 77 | + */ | ||
| 78 | + @TableField(fill = FieldFill.INSERT_UPDATE) | ||
| 79 | + private LocalDateTime updateTime; | ||
| 80 | +} |
| 1 | +package com.lframework.xingyun.sc.procurement.impl.fundpayment; | ||
| 2 | + | ||
| 3 | +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; | ||
| 4 | +import com.baomidou.mybatisplus.core.toolkit.Wrappers; | ||
| 5 | +import com.github.pagehelper.PageInfo; | ||
| 6 | +import com.lframework.starter.common.exceptions.impl.DefaultClientException; | ||
| 7 | +import com.lframework.starter.common.utils.Assert; | ||
| 8 | +import com.lframework.starter.common.utils.ObjectUtil; | ||
| 9 | +import com.lframework.starter.common.utils.StringUtil; | ||
| 10 | +import com.lframework.starter.web.core.annotations.oplog.OpLog; | ||
| 11 | +import com.lframework.starter.web.core.components.resp.PageResult; | ||
| 12 | +import com.lframework.starter.web.core.impl.BaseMpServiceImpl; | ||
| 13 | +import com.lframework.starter.web.core.utils.IdUtil; | ||
| 14 | +import com.lframework.starter.web.core.utils.OpLogUtil; | ||
| 15 | +import com.lframework.starter.web.core.utils.PageHelperUtil; | ||
| 16 | +import com.lframework.starter.web.core.utils.PageResultUtil; | ||
| 17 | +import com.lframework.starter.web.inner.components.oplog.OtherOpLogType; | ||
| 18 | +import com.lframework.xingyun.sc.procurement.entity.fundpayment.FundPaymentSupplier; | ||
| 19 | +import com.lframework.xingyun.sc.procurement.mappers.fundpayment.FundPaymentSupplierMapper; | ||
| 20 | +import com.lframework.xingyun.sc.procurement.service.fundpayment.FundPaymentSupplierService; | ||
| 21 | +import com.lframework.xingyun.sc.procurement.vo.fundpayment.CreateFundPaymentSupplierVo; | ||
| 22 | +import com.lframework.xingyun.sc.procurement.vo.fundpayment.QueryFundPaymentSupplierVo; | ||
| 23 | +import com.lframework.xingyun.sc.procurement.vo.fundpayment.UpdateFundPaymentSupplierVo; | ||
| 24 | +import java.io.Serializable; | ||
| 25 | +import java.util.List; | ||
| 26 | +import org.springframework.stereotype.Service; | ||
| 27 | +import org.springframework.transaction.annotation.Transactional; | ||
| 28 | + | ||
| 29 | +@Service | ||
| 30 | +public class FundPaymentSupplierServiceImpl extends | ||
| 31 | + BaseMpServiceImpl<FundPaymentSupplierMapper, FundPaymentSupplier> implements FundPaymentSupplierService { | ||
| 32 | + | ||
| 33 | + @Override | ||
| 34 | + public PageResult<FundPaymentSupplier> query(Integer pageIndex, Integer pageSize, QueryFundPaymentSupplierVo vo) { | ||
| 35 | + | ||
| 36 | + Assert.greaterThanZero(pageIndex); | ||
| 37 | + Assert.greaterThanZero(pageSize); | ||
| 38 | + | ||
| 39 | + PageHelperUtil.startPage(pageIndex, pageSize); | ||
| 40 | + List<FundPaymentSupplier> datas = this.query(vo); | ||
| 41 | + | ||
| 42 | + return PageResultUtil.convert(new PageInfo<>(datas)); | ||
| 43 | + } | ||
| 44 | + | ||
| 45 | + @Override | ||
| 46 | + public List<FundPaymentSupplier> query(QueryFundPaymentSupplierVo vo) { | ||
| 47 | + | ||
| 48 | + return getBaseMapper().query(vo); | ||
| 49 | + } | ||
| 50 | + | ||
| 51 | + @Override | ||
| 52 | + public FundPaymentSupplier findById(String id) { | ||
| 53 | + | ||
| 54 | + return getBaseMapper().findById(id); | ||
| 55 | + } | ||
| 56 | + | ||
| 57 | + @Override | ||
| 58 | + public FundPaymentSupplier getDuplicate(String customerName, String bankName, String cardNo) { | ||
| 59 | + | ||
| 60 | + if (StringUtil.isBlank(customerName) || StringUtil.isBlank(cardNo)) { | ||
| 61 | + return null; | ||
| 62 | + } | ||
| 63 | + // 客户名称、开户行、卡号三项完全一致才算重复;卡号按文本存储、中间含空格便于阅读,比对时忽略空格 | ||
| 64 | + String normalizedBankName = StringUtil.isBlank(bankName) ? "" : bankName.trim(); | ||
| 65 | + String normalizedCardNo = cardNo.replace(" ", ""); | ||
| 66 | + List<FundPaymentSupplier> datas = getBaseMapper().selectList( | ||
| 67 | + Wrappers.lambdaQuery(FundPaymentSupplier.class) | ||
| 68 | + .eq(FundPaymentSupplier::getCustomerName, customerName.trim())); | ||
| 69 | + for (FundPaymentSupplier data : datas) { | ||
| 70 | + if (StringUtil.isEmpty(data.getCardNo())) { | ||
| 71 | + continue; | ||
| 72 | + } | ||
| 73 | + if (!normalizedCardNo.equals(data.getCardNo().replace(" ", ""))) { | ||
| 74 | + continue; | ||
| 75 | + } | ||
| 76 | + String existedBankName = StringUtil.isBlank(data.getBankName()) ? "" : data.getBankName().trim(); | ||
| 77 | + if (normalizedBankName.equals(existedBankName)) { | ||
| 78 | + return data; | ||
| 79 | + } | ||
| 80 | + } | ||
| 81 | + return null; | ||
| 82 | + } | ||
| 83 | + | ||
| 84 | + /** | ||
| 85 | + * 拼装重复提示文案(开户行为空时显示为空) | ||
| 86 | + */ | ||
| 87 | + private String buildDuplicateMessage(String customerName, String bankName, String cardNo) { | ||
| 88 | + | ||
| 89 | + return "客户名称“" + customerName + "”、开户行“" + (StringUtil.isBlank(bankName) ? "空" : bankName) | ||
| 90 | + + "”、卡号“" + cardNo + "”的记录已存在!"; | ||
| 91 | + } | ||
| 92 | + | ||
| 93 | + @OpLog(type = OtherOpLogType.class, name = "新增资金支付供应商信息,ID:{}", params = {"#id"}) | ||
| 94 | + @Transactional(rollbackFor = Exception.class) | ||
| 95 | + @Override | ||
| 96 | + public String create(CreateFundPaymentSupplierVo vo) { | ||
| 97 | + | ||
| 98 | + FundPaymentSupplier duplicated = this.getDuplicate(vo.getCustomerName(), vo.getBankName(), | ||
| 99 | + vo.getCardNo()); | ||
| 100 | + if (duplicated != null) { | ||
| 101 | + throw new DefaultClientException( | ||
| 102 | + this.buildDuplicateMessage(vo.getCustomerName(), vo.getBankName(), vo.getCardNo())); | ||
| 103 | + } | ||
| 104 | + | ||
| 105 | + FundPaymentSupplier data = new FundPaymentSupplier(); | ||
| 106 | + data.setId(IdUtil.getId()); | ||
| 107 | + data.setCustomerName(vo.getCustomerName()); | ||
| 108 | + data.setBankName(vo.getBankName()); | ||
| 109 | + data.setCardNo(vo.getCardNo()); | ||
| 110 | + | ||
| 111 | + getBaseMapper().insert(data); | ||
| 112 | + | ||
| 113 | + OpLogUtil.setVariable("id", data.getId()); | ||
| 114 | + OpLogUtil.setExtra(vo); | ||
| 115 | + | ||
| 116 | + return data.getId(); | ||
| 117 | + } | ||
| 118 | + | ||
| 119 | + @OpLog(type = OtherOpLogType.class, name = "修改资金支付供应商信息,ID:{}", params = {"#id"}) | ||
| 120 | + @Transactional(rollbackFor = Exception.class) | ||
| 121 | + @Override | ||
| 122 | + public void update(UpdateFundPaymentSupplierVo vo) { | ||
| 123 | + | ||
| 124 | + FundPaymentSupplier data = getBaseMapper().selectById(vo.getId()); | ||
| 125 | + if (ObjectUtil.isNull(data)) { | ||
| 126 | + throw new DefaultClientException("资金支付供应商信息不存在!"); | ||
| 127 | + } | ||
| 128 | + | ||
| 129 | + FundPaymentSupplier duplicated = this.getDuplicate(vo.getCustomerName(), vo.getBankName(), | ||
| 130 | + vo.getCardNo()); | ||
| 131 | + if (duplicated != null && !duplicated.getId().equals(vo.getId())) { | ||
| 132 | + throw new DefaultClientException( | ||
| 133 | + this.buildDuplicateMessage(vo.getCustomerName(), vo.getBankName(), vo.getCardNo())); | ||
| 134 | + } | ||
| 135 | + | ||
| 136 | + LambdaUpdateWrapper<FundPaymentSupplier> updateWrapper = Wrappers.lambdaUpdate(FundPaymentSupplier.class) | ||
| 137 | + .set(FundPaymentSupplier::getCustomerName, vo.getCustomerName()) | ||
| 138 | + .set(StringUtil.isNotBlank(vo.getBankName()), FundPaymentSupplier::getBankName, vo.getBankName()) | ||
| 139 | + .set(FundPaymentSupplier::getCardNo, vo.getCardNo()) | ||
| 140 | + .eq(FundPaymentSupplier::getId, vo.getId()); | ||
| 141 | + | ||
| 142 | + getBaseMapper().update(updateWrapper); | ||
| 143 | + | ||
| 144 | + OpLogUtil.setVariable("id", data.getId()); | ||
| 145 | + OpLogUtil.setExtra(vo); | ||
| 146 | + } | ||
| 147 | + | ||
| 148 | + @OpLog(type = OtherOpLogType.class, name = "删除资金支付供应商信息,ID:{}", params = {"#id"}) | ||
| 149 | + @Transactional(rollbackFor = Exception.class) | ||
| 150 | + @Override | ||
| 151 | + public void deleteById(String id) { | ||
| 152 | + | ||
| 153 | + getBaseMapper().deleteById(id); | ||
| 154 | + } | ||
| 155 | + | ||
| 156 | + @Override | ||
| 157 | + public void cleanCacheByKey(Serializable key) { | ||
| 158 | + | ||
| 159 | + } | ||
| 160 | +} |
| 1 | +package com.lframework.xingyun.sc.procurement.mappers.fundpayment; | ||
| 2 | + | ||
| 3 | +import com.lframework.starter.web.core.mapper.BaseMapper; | ||
| 4 | +import com.lframework.xingyun.sc.procurement.entity.fundpayment.FundPaymentSupplier; | ||
| 5 | +import com.lframework.xingyun.sc.procurement.vo.fundpayment.QueryFundPaymentSupplierVo; | ||
| 6 | +import java.util.List; | ||
| 7 | +import org.apache.ibatis.annotations.Param; | ||
| 8 | + | ||
| 9 | +/** | ||
| 10 | + * <p> | ||
| 11 | + * 资金支付-供应商信息 Mapper 接口 | ||
| 12 | + * </p> | ||
| 13 | + * | ||
| 14 | + */ | ||
| 15 | +public interface FundPaymentSupplierMapper extends BaseMapper<FundPaymentSupplier> { | ||
| 16 | + | ||
| 17 | + /** | ||
| 18 | + * 查询列表 | ||
| 19 | + * @param vo | ||
| 20 | + * @return | ||
| 21 | + */ | ||
| 22 | + List<FundPaymentSupplier> query(@Param("vo") QueryFundPaymentSupplierVo vo); | ||
| 23 | + | ||
| 24 | + /** | ||
| 25 | + * 根据ID查询 | ||
| 26 | + * @param id | ||
| 27 | + * @return | ||
| 28 | + */ | ||
| 29 | + FundPaymentSupplier findById(@Param("id") String id); | ||
| 30 | +} |
| 1 | +package com.lframework.xingyun.sc.procurement.service.fundpayment; | ||
| 2 | + | ||
| 3 | +import com.lframework.starter.web.core.components.resp.PageResult; | ||
| 4 | +import com.lframework.starter.web.core.service.BaseMpService; | ||
| 5 | +import com.lframework.xingyun.sc.procurement.entity.fundpayment.FundPaymentSupplier; | ||
| 6 | +import com.lframework.xingyun.sc.procurement.vo.fundpayment.CreateFundPaymentSupplierVo; | ||
| 7 | +import com.lframework.xingyun.sc.procurement.vo.fundpayment.QueryFundPaymentSupplierVo; | ||
| 8 | +import com.lframework.xingyun.sc.procurement.vo.fundpayment.UpdateFundPaymentSupplierVo; | ||
| 9 | +import java.util.List; | ||
| 10 | + | ||
| 11 | +/** | ||
| 12 | + * 资金支付-供应商信息 Service | ||
| 13 | + */ | ||
| 14 | +public interface FundPaymentSupplierService extends BaseMpService<FundPaymentSupplier> { | ||
| 15 | + | ||
| 16 | + /** | ||
| 17 | + * 查询列表 | ||
| 18 | + * @param pageIndex | ||
| 19 | + * @param pageSize | ||
| 20 | + * @param vo | ||
| 21 | + * @return | ||
| 22 | + */ | ||
| 23 | + PageResult<FundPaymentSupplier> query(Integer pageIndex, Integer pageSize, QueryFundPaymentSupplierVo vo); | ||
| 24 | + | ||
| 25 | + /** | ||
| 26 | + * 查询列表 | ||
| 27 | + * @param vo | ||
| 28 | + * @return | ||
| 29 | + */ | ||
| 30 | + List<FundPaymentSupplier> query(QueryFundPaymentSupplierVo vo); | ||
| 31 | + | ||
| 32 | + /** | ||
| 33 | + * 根据ID查询 | ||
| 34 | + * @param id | ||
| 35 | + * @return | ||
| 36 | + */ | ||
| 37 | + FundPaymentSupplier findById(String id); | ||
| 38 | + | ||
| 39 | + /** | ||
| 40 | + * 查询重复记录(客户名称、开户行、卡号三项完全一致才算重复,卡号忽略空格后比对) | ||
| 41 | + * @param customerName | ||
| 42 | + * @param bankName | ||
| 43 | + * @param cardNo | ||
| 44 | + * @return | ||
| 45 | + */ | ||
| 46 | + FundPaymentSupplier getDuplicate(String customerName, String bankName, String cardNo); | ||
| 47 | + | ||
| 48 | + /** | ||
| 49 | + * 创建 | ||
| 50 | + * @param vo | ||
| 51 | + * @return | ||
| 52 | + */ | ||
| 53 | + String create(CreateFundPaymentSupplierVo vo); | ||
| 54 | + | ||
| 55 | + /** | ||
| 56 | + * 修改 | ||
| 57 | + * @param vo | ||
| 58 | + */ | ||
| 59 | + void update(UpdateFundPaymentSupplierVo vo); | ||
| 60 | + | ||
| 61 | + /** | ||
| 62 | + * 根据ID删除 | ||
| 63 | + * @param id | ||
| 64 | + */ | ||
| 65 | + void deleteById(String id); | ||
| 66 | +} |
| 1 | +package com.lframework.xingyun.sc.procurement.vo.fundpayment; | ||
| 2 | + | ||
| 3 | +import io.swagger.annotations.ApiModelProperty; | ||
| 4 | +import java.io.Serializable; | ||
| 5 | +import javax.validation.constraints.NotBlank; | ||
| 6 | +import com.lframework.starter.web.core.vo.BaseVo; | ||
| 7 | +import org.hibernate.validator.constraints.Length; | ||
| 8 | +import lombok.Data; | ||
| 9 | + | ||
| 10 | +@Data | ||
| 11 | +public class CreateFundPaymentSupplierVo implements BaseVo, Serializable { | ||
| 12 | + | ||
| 13 | + private static final long serialVersionUID = 1L; | ||
| 14 | + | ||
| 15 | + /** | ||
| 16 | + * 客户名称 | ||
| 17 | + */ | ||
| 18 | + @ApiModelProperty(value = "客户名称", required = true) | ||
| 19 | + @NotBlank(message = "请输入客户名称!") | ||
| 20 | + @Length(max = 200, message = "客户名称最多允许200个字符!") | ||
| 21 | + private String customerName; | ||
| 22 | + | ||
| 23 | + /** | ||
| 24 | + * 开户行 | ||
| 25 | + */ | ||
| 26 | + @ApiModelProperty(value = "开户行") | ||
| 27 | + @Length(max = 200, message = "开户行最多允许200个字符!") | ||
| 28 | + private String bankName; | ||
| 29 | + | ||
| 30 | + /** | ||
| 31 | + * 卡号(文本,中间可含空格便于阅读) | ||
| 32 | + */ | ||
| 33 | + @ApiModelProperty(value = "卡号", required = true) | ||
| 34 | + @NotBlank(message = "请输入卡号!") | ||
| 35 | + @Length(max = 50, message = "卡号最多允许50个字符!") | ||
| 36 | + private String cardNo; | ||
| 37 | +} |
| 1 | +package com.lframework.xingyun.sc.procurement.vo.fundpayment; | ||
| 2 | + | ||
| 3 | +import com.lframework.starter.web.core.vo.BaseVo; | ||
| 4 | +import com.lframework.starter.web.core.vo.PageVo; | ||
| 5 | +import io.swagger.annotations.ApiModelProperty; | ||
| 6 | +import java.io.Serializable; | ||
| 7 | +import lombok.Data; | ||
| 8 | + | ||
| 9 | +@Data | ||
| 10 | +public class QueryFundPaymentSupplierVo extends PageVo implements BaseVo, Serializable { | ||
| 11 | + | ||
| 12 | + private static final long serialVersionUID = 1L; | ||
| 13 | + | ||
| 14 | + /** | ||
| 15 | + * 客户名称 | ||
| 16 | + */ | ||
| 17 | + @ApiModelProperty("客户名称") | ||
| 18 | + private String customerName; | ||
| 19 | + | ||
| 20 | + /** | ||
| 21 | + * 开户行 | ||
| 22 | + */ | ||
| 23 | + @ApiModelProperty("开户行") | ||
| 24 | + private String bankName; | ||
| 25 | + | ||
| 26 | + /** | ||
| 27 | + * 卡号 | ||
| 28 | + */ | ||
| 29 | + @ApiModelProperty("卡号") | ||
| 30 | + private String cardNo; | ||
| 31 | +} |
| 1 | +package com.lframework.xingyun.sc.procurement.vo.fundpayment; | ||
| 2 | + | ||
| 3 | +import io.swagger.annotations.ApiModelProperty; | ||
| 4 | +import java.io.Serializable; | ||
| 5 | +import javax.validation.constraints.NotBlank; | ||
| 6 | +import com.lframework.starter.web.core.vo.BaseVo; | ||
| 7 | +import org.hibernate.validator.constraints.Length; | ||
| 8 | +import lombok.Data; | ||
| 9 | + | ||
| 10 | +@Data | ||
| 11 | +public class UpdateFundPaymentSupplierVo implements BaseVo, Serializable { | ||
| 12 | + | ||
| 13 | + private static final long serialVersionUID = 1L; | ||
| 14 | + | ||
| 15 | + /** | ||
| 16 | + * ID | ||
| 17 | + */ | ||
| 18 | + @ApiModelProperty(value = "ID", required = true) | ||
| 19 | + @NotBlank(message = "id不能为空!") | ||
| 20 | + private String id; | ||
| 21 | + | ||
| 22 | + /** | ||
| 23 | + * 客户名称 | ||
| 24 | + */ | ||
| 25 | + @ApiModelProperty(value = "客户名称", required = true) | ||
| 26 | + @NotBlank(message = "请输入客户名称!") | ||
| 27 | + @Length(max = 200, message = "客户名称最多允许200个字符!") | ||
| 28 | + private String customerName; | ||
| 29 | + | ||
| 30 | + /** | ||
| 31 | + * 开户行 | ||
| 32 | + */ | ||
| 33 | + @ApiModelProperty(value = "开户行") | ||
| 34 | + @Length(max = 200, message = "开户行最多允许200个字符!") | ||
| 35 | + private String bankName; | ||
| 36 | + | ||
| 37 | + /** | ||
| 38 | + * 卡号(文本,中间可含空格便于阅读) | ||
| 39 | + */ | ||
| 40 | + @ApiModelProperty(value = "卡号", required = true) | ||
| 41 | + @NotBlank(message = "请输入卡号!") | ||
| 42 | + @Length(max = 50, message = "卡号最多允许50个字符!") | ||
| 43 | + private String cardNo; | ||
| 44 | +} |
xingyun-sc/src/main/resources/mappers/procurement/fundpayment/FundPaymentSupplierMapper.xml
0 → 100644
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
| 2 | +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | ||
| 3 | +<mapper namespace="com.lframework.xingyun.sc.procurement.mappers.fundpayment.FundPaymentSupplierMapper"> | ||
| 4 | + | ||
| 5 | + <resultMap id="FundPaymentSupplier" type="com.lframework.xingyun.sc.procurement.entity.fundpayment.FundPaymentSupplier"> | ||
| 6 | + <id column="id" property="id"/> | ||
| 7 | + <result column="customer_name" property="customerName"/> | ||
| 8 | + <result column="bank_name" property="bankName"/> | ||
| 9 | + <result column="card_no" property="cardNo"/> | ||
| 10 | + <result column="create_by_id" property="createById"/> | ||
| 11 | + <result column="create_by" property="createBy"/> | ||
| 12 | + <result column="update_by_id" property="updateById"/> | ||
| 13 | + <result column="update_by" property="updateBy"/> | ||
| 14 | + <result column="create_time" property="createTime"/> | ||
| 15 | + <result column="update_time" property="updateTime"/> | ||
| 16 | + </resultMap> | ||
| 17 | + | ||
| 18 | + <sql id="FundPaymentSupplier_sql"> | ||
| 19 | + SELECT | ||
| 20 | + tb.id, | ||
| 21 | + tb.customer_name, | ||
| 22 | + tb.bank_name, | ||
| 23 | + tb.card_no, | ||
| 24 | + tb.create_by_id, | ||
| 25 | + tb.create_by, | ||
| 26 | + tb.update_by_id, | ||
| 27 | + tb.update_by, | ||
| 28 | + tb.create_time, | ||
| 29 | + tb.update_time | ||
| 30 | + FROM fund_payment_supplier AS tb | ||
| 31 | + </sql> | ||
| 32 | + | ||
| 33 | + <select id="query" resultMap="FundPaymentSupplier"> | ||
| 34 | + <include refid="FundPaymentSupplier_sql"/> | ||
| 35 | + <where> | ||
| 36 | + <if test="vo.customerName != null and vo.customerName != ''"> | ||
| 37 | + AND tb.customer_name LIKE CONCAT('%', #{vo.customerName}, '%') | ||
| 38 | + </if> | ||
| 39 | + <if test="vo.bankName != null and vo.bankName != ''"> | ||
| 40 | + AND tb.bank_name LIKE CONCAT('%', #{vo.bankName}, '%') | ||
| 41 | + </if> | ||
| 42 | + <if test="vo.cardNo != null and vo.cardNo != ''"> | ||
| 43 | + AND REPLACE(tb.card_no, ' ', '') LIKE CONCAT('%', REPLACE(#{vo.cardNo}, ' ', ''), '%') | ||
| 44 | + </if> | ||
| 45 | + </where> | ||
| 46 | + ORDER BY tb.customer_name ASC, tb.create_time DESC | ||
| 47 | + </select> | ||
| 48 | + | ||
| 49 | + <select id="findById" resultMap="FundPaymentSupplier"> | ||
| 50 | + <include refid="FundPaymentSupplier_sql"/> | ||
| 51 | + <where> | ||
| 52 | + <if test="id != null and id != ''"> | ||
| 53 | + AND tb.id = #{id} | ||
| 54 | + </if> | ||
| 55 | + </where> | ||
| 56 | + </select> | ||
| 57 | +</mapper> |