From e93df8f3b272a011d2785f59b0a5e6da332cbd87 Mon Sep 17 00:00:00 2001 From: lSun <15893999301@qq.com> Date: Tue, 16 Sep 2025 15:21:24 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BA=94=E4=BB=98=E5=BD=95=E5=85=A5=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../manager/ca/bm/dao/PayAccountInfoDao.java | 2 + .../impl/PayAccountInfoServiceImpl.java | 18 ++++++++- .../ca/im/controller/PayableController.java | 40 +++++++++++++++---- .../mappers/ca/PayAccountInfoMapper.xml | 11 +++++ .../js/work/basic/UserManagementList.js | 10 ++--- .../static/pages/finance/addGoodsInfo.html | 2 +- .../pages/finance/addPayableDetails.html | 2 +- .../pages/finance/addPaymentAccount.html | 10 ++++- .../static/pages/finance/addSupplierInfo.html | 2 +- .../static/pages/finance/paymentAccount.html | 10 +++++ .../resources/static/pages/role/addRole.html | 2 +- .../static/pages/tools/addToolsInfo.html | 2 +- .../static/pages/user/addUserForm.html | 2 +- 13 files changed, 92 insertions(+), 21 deletions(-) diff --git a/src/main/java/com/bonus/boot/manager/ca/bm/dao/PayAccountInfoDao.java b/src/main/java/com/bonus/boot/manager/ca/bm/dao/PayAccountInfoDao.java index 6f1a228..71700a5 100644 --- a/src/main/java/com/bonus/boot/manager/ca/bm/dao/PayAccountInfoDao.java +++ b/src/main/java/com/bonus/boot/manager/ca/bm/dao/PayAccountInfoDao.java @@ -28,4 +28,6 @@ public interface PayAccountInfoDao { List getPayAccountInfo(Map params); PayAccountInfoBean getPayAccountInfoByName(String name); + + PayAccountInfoBean getPayAccountInfoByAccountNumber(String accountNumber); } diff --git a/src/main/java/com/bonus/boot/manager/ca/bm/service/impl/PayAccountInfoServiceImpl.java b/src/main/java/com/bonus/boot/manager/ca/bm/service/impl/PayAccountInfoServiceImpl.java index 786d4f4..3e9412e 100644 --- a/src/main/java/com/bonus/boot/manager/ca/bm/service/impl/PayAccountInfoServiceImpl.java +++ b/src/main/java/com/bonus/boot/manager/ca/bm/service/impl/PayAccountInfoServiceImpl.java @@ -47,6 +47,12 @@ public class PayAccountInfoServiceImpl implements PayAccountInfoService { @Override public void save(PayAccountInfoBean payAccountInfoBean) { + if (payAccountInfoBean.getName() != null) { + payAccountInfoBean.setName(payAccountInfoBean.getName().trim()); + } + if (payAccountInfoBean.getAccountNumber() != null) { + payAccountInfoBean.setAccountNumber(payAccountInfoBean.getAccountNumber().trim()); + } LoginUser loginUser = UserUtil.getLoginUser(); String username = loginUser.getUsername(); String userId = dao.getIdByName(username); @@ -56,12 +62,22 @@ public class PayAccountInfoServiceImpl implements PayAccountInfoService { if (bean != null && !bean.getId().equals(payAccountInfoBean.getId())){ throw new IllegalArgumentException("付款账户名称:"+bean.getName() +"已存在"); } - dao.update(payAccountInfoBean); + + PayAccountInfoBean o = dao.getPayAccountInfoByAccountNumber(payAccountInfoBean.getAccountNumber()); + if(o !=null && !o.getId().equals(payAccountInfoBean.getId())){ + throw new IllegalArgumentException("付款账户:"+o.getAccountNumber() +"已存在"); + } + dao.update (payAccountInfoBean); }else { PayAccountInfoBean bean = dao.getPayAccountInfoByName(payAccountInfoBean.getName()); if (bean != null){ throw new IllegalArgumentException("付款账户名称:"+bean.getName() +"已存在"); } + + PayAccountInfoBean o = dao.getPayAccountInfoByAccountNumber(payAccountInfoBean.getAccountNumber()); + if(o !=null ){ + throw new IllegalArgumentException("付款账户:"+o.getAccountNumber() +"已存在"); + } dao.add(payAccountInfoBean); } } diff --git a/src/main/java/com/bonus/boot/manager/ca/im/controller/PayableController.java b/src/main/java/com/bonus/boot/manager/ca/im/controller/PayableController.java index 4cbdfc4..9d8d9f6 100644 --- a/src/main/java/com/bonus/boot/manager/ca/im/controller/PayableController.java +++ b/src/main/java/com/bonus/boot/manager/ca/im/controller/PayableController.java @@ -210,7 +210,7 @@ public class PayableController { // 从第二行开始读取数据(跳过表头) for (int i = 2; i <= sheet.getLastRowNum(); i++) { Row row = sheet.getRow(i); - if (row == null) { + if (row == null || isRowEmpty(row)) { continue; } @@ -460,23 +460,49 @@ public class PayableController { switch (cell.getCellType()) { case STRING: - return cell.getStringCellValue(); + return cell.getStringCellValue().trim(); case NUMERIC: if (DateUtil.isCellDateFormatted(cell)) { - return new java.text.SimpleDateFormat("yyyy-MM-dd").format(cell.getDateCellValue()); + return new java.text.SimpleDateFormat("yyyy-MM-dd").format(cell.getDateCellValue()).trim(); } // 处理数值类型,去掉可能存在的.0后缀 double numericValue = cell.getNumericCellValue(); if (numericValue == (long) numericValue) { - return String.valueOf((long) numericValue); + return String.valueOf((long) numericValue).trim(); } - return String.valueOf(numericValue); + return String.valueOf(numericValue).trim(); case BOOLEAN: - return String.valueOf(cell.getBooleanCellValue()); + return String.valueOf(cell.getBooleanCellValue()).trim(); case FORMULA: - return cell.getCellFormula(); + return cell.getCellFormula().trim(); default: return ""; } } + + + private boolean isRowEmpty(Row row) { + if (row == null) { + return true; + } + // 检查从第0个到第11个单元格(根据你的列数调整) + for (int c = 0; c < 12; c++) { + Cell cell = row.getCell(c); + if (cell != null) { + if (cell.getCellType() == CellType.STRING) { + if (cell.getStringCellValue().trim().length() > 0) { + return false; + } + } else if (cell.getCellType() == CellType.NUMERIC) { + return false; // 数字即使为0也算“有值” + } else if (cell.getCellType() == CellType.BOOLEAN) { + return false; + } else if (cell.getCellType() == CellType.FORMULA) { + // 公式也算“有内容” + return false; + } + } + } + return true; + } } diff --git a/src/main/resources/mappers/ca/PayAccountInfoMapper.xml b/src/main/resources/mappers/ca/PayAccountInfoMapper.xml index eadc5d5..5392c4e 100644 --- a/src/main/resources/mappers/ca/PayAccountInfoMapper.xml +++ b/src/main/resources/mappers/ca/PayAccountInfoMapper.xml @@ -46,6 +46,10 @@ and cbpai.name like concat ('%',#{params.name},'%') + + and cbpai.account_number like concat ('%',#{params.accountNumber},'%') + + and cbpai.opening_account_date like concat ('%',#{params.openingAccountDate},'%') @@ -96,4 +100,11 @@ from ca_bm_pay_account_info where is_active = '1' and name = #{name} + + \ No newline at end of file diff --git a/src/main/resources/static/js/work/basic/UserManagementList.js b/src/main/resources/static/js/work/basic/UserManagementList.js index 05854df..eba8a7f 100644 --- a/src/main/resources/static/js/work/basic/UserManagementList.js +++ b/src/main/resources/static/js/work/basic/UserManagementList.js @@ -58,7 +58,7 @@ layui.use(['table', 'layer', 'laydate', 'jquery', 'form'], function () { /** * 部门下拉树 */ - loadOrgTree(); + // loadOrgTree(); /** * 点击除了部门输入框和下拉树范围之外的地方,关闭下拉树列表 */ @@ -99,7 +99,7 @@ layui.use(['table', 'layer', 'laydate', 'jquery', 'form'], function () { } //设定异步数据接口的额外参数 }); $("#keyWord").val(oldKeyWord); - loadOrgTree(); + // loadOrgTree(); break; case "addBtn": openForm("",'新增'); @@ -164,7 +164,7 @@ function resetPassword(id){ /** 树的方法开始 */ -var machines = new Set(); //专业容器 +/*var machines = new Set(); //专业容器 var size = 1; //序号 var map =[]; var mapinfo={}; @@ -180,7 +180,7 @@ function loadOrgTree(){ }},data.obj); // 获取树对象 var treeObj = $.fn.zTree.getZTreeObj("departmentTree"); - /* 获取所有树节点 */ + /!* 获取所有树节点 *!/ var nodes = treeObj.transformToArray(treeObj.getNodes()); //展开第一级树 treeObj.expandNode(nodes[1], true); @@ -189,7 +189,7 @@ function loadOrgTree(){ alert("未连接到服务器,请检查网络!"); } }); -} +}*/ /** * 专业的选择 diff --git a/src/main/resources/static/pages/finance/addGoodsInfo.html b/src/main/resources/static/pages/finance/addGoodsInfo.html index c3be400..a97fe3a 100644 --- a/src/main/resources/static/pages/finance/addGoodsInfo.html +++ b/src/main/resources/static/pages/finance/addGoodsInfo.html @@ -97,7 +97,7 @@ success : function(data) { parent.table.reload('menuTable'); parent.layer.closeAll(); - top.layer.close(addLoadingMsg); //再执行关闭 + top.layer.close(); //再执行关闭 parent.layer.msg('成功', {icon: 1, time: 2000}); }, }); diff --git a/src/main/resources/static/pages/finance/addPayableDetails.html b/src/main/resources/static/pages/finance/addPayableDetails.html index 9898fca..f73d4b0 100644 --- a/src/main/resources/static/pages/finance/addPayableDetails.html +++ b/src/main/resources/static/pages/finance/addPayableDetails.html @@ -250,7 +250,7 @@ success : function(data) { parent.table.reload('menuTable'); parent.layer.closeAll(); - top.layer.close(addLoadingMsg); //再执行关闭 + top.layer.close(); //再执行关闭 parent.layer.msg('成功', {icon: 1, time: 2000}); }, }); diff --git a/src/main/resources/static/pages/finance/addPaymentAccount.html b/src/main/resources/static/pages/finance/addPaymentAccount.html index 0058415..fc010db 100644 --- a/src/main/resources/static/pages/finance/addPaymentAccount.html +++ b/src/main/resources/static/pages/finance/addPaymentAccount.html @@ -26,7 +26,7 @@
- +
@@ -113,6 +113,12 @@ layer.msg("请输入账户名称!",{icon:0,time:2000}) return false; } + + if (isNull($("#accountNumber").val())){ + layer.msg("请输入账户!",{icon:0,time:2000}) + return false; + } + var formdata = $("#form"); if (id == "0"){ formdata.id = ""; @@ -133,7 +139,7 @@ success : function(data) { parent.table.reload('menuTable'); parent.layer.closeAll(); - top.layer.close(addLoadingMsg); //再执行关闭 + top.layer.close(); //再执行关闭 parent.layer.msg('成功', {icon: 1, time: 2000}); }, }); diff --git a/src/main/resources/static/pages/finance/addSupplierInfo.html b/src/main/resources/static/pages/finance/addSupplierInfo.html index 82170c0..1da4aa1 100644 --- a/src/main/resources/static/pages/finance/addSupplierInfo.html +++ b/src/main/resources/static/pages/finance/addSupplierInfo.html @@ -196,7 +196,7 @@ success : function(data) { parent.table.reload('menuTable'); parent.layer.closeAll(); - top.layer.close(addLoadingMsg); //再执行关闭 + top.layer.close(); //再执行关闭 parent.layer.msg('成功', {icon: 1, time: 2000}); }, }); diff --git a/src/main/resources/static/pages/finance/paymentAccount.html b/src/main/resources/static/pages/finance/paymentAccount.html index 4529786..baa1f7a 100644 --- a/src/main/resources/static/pages/finance/paymentAccount.html +++ b/src/main/resources/static/pages/finance/paymentAccount.html @@ -39,6 +39,14 @@ placeholder="请输入账户名称">
+ +
+
+ +
+
+
@@ -117,6 +125,7 @@ , defaultToolbar: [] , where: { name: $('#name').val(), + accountNumber: $('#accountNumber').val(), openingAccountDate: $('#openingAccountDate').val() } //post请求必须加where ,post请求需要的参数 , cellMinWidth: 80 @@ -207,6 +216,7 @@ , page: true , where: { name: $('#name').val(), + accountNumber: $('#accountNumber').val(), openingAccountDate: $('#openingAccountDate').val() } //设定异步数据接口的额外参数 }); diff --git a/src/main/resources/static/pages/role/addRole.html b/src/main/resources/static/pages/role/addRole.html index f88a41e..a59fbd3 100644 --- a/src/main/resources/static/pages/role/addRole.html +++ b/src/main/resources/static/pages/role/addRole.html @@ -214,7 +214,7 @@ success : function(data) { parent.example.ajax.reload(); parent.layer.closeAll(); - top.layer.close(addLoadingMsg); //再执行关闭 + top.layer.close(); //再执行关闭 parent.layer.msg('成功', {icon: 1, time: 2000}); }, }); diff --git a/src/main/resources/static/pages/tools/addToolsInfo.html b/src/main/resources/static/pages/tools/addToolsInfo.html index 5f2628b..a403ace 100644 --- a/src/main/resources/static/pages/tools/addToolsInfo.html +++ b/src/main/resources/static/pages/tools/addToolsInfo.html @@ -186,7 +186,7 @@ success : function(data) { parent.example.ajax.reload(); parent.layer.closeAll(); - top.layer.close(addLoadingMsg); //再执行关闭 + top.layer.close(); //再执行关闭 parent.layer.msg('成功', {icon: 1, time: 2000}); }, }); diff --git a/src/main/resources/static/pages/user/addUserForm.html b/src/main/resources/static/pages/user/addUserForm.html index b817a29..8257925 100644 --- a/src/main/resources/static/pages/user/addUserForm.html +++ b/src/main/resources/static/pages/user/addUserForm.html @@ -171,7 +171,7 @@ /** * 判断是否高职---展示或隐藏特殊岗位标签 */ - isSpecial('higherJob'); + // isSpecial('higherJob'); /** * 点击除了部门输入框和下拉树范围之外的地方,关闭下拉树列表