From 6aa51ffdc446e9df2822b60c5a59f8e553c0568f Mon Sep 17 00:00:00 2001 From: jishenghua <752718920@qq.com> Date: Thu, 28 Mar 2024 22:44:44 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=95=86=E5=93=81?= =?UTF-8?q?=E5=BA=93=E5=AD=98=E6=9F=A5=E8=AF=A2=E7=9A=84=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=EF=BC=8C=E8=A7=A3=E5=86=B30=E5=BA=93=E5=AD=98=E7=9A=84?= =?UTF-8?q?=E5=95=86=E5=93=81=E4=B8=8D=E5=B1=95=E7=A4=BA=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/mapper_xml/MaterialMapperEx.xml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/jshERP-boot/src/main/resources/mapper_xml/MaterialMapperEx.xml b/jshERP-boot/src/main/resources/mapper_xml/MaterialMapperEx.xml index c12eae9b..f6616c3c 100644 --- a/jshERP-boot/src/main/resources/mapper_xml/MaterialMapperEx.xml +++ b/jshERP-boot/src/main/resources/mapper_xml/MaterialMapperEx.xml @@ -610,16 +610,16 @@ FROM jsh_material m left JOIN jsh_material_extend me on m.id = me.material_id and ifnull(me.delete_Flag,'0') !='1' left join jsh_material_current_stock mcs on m.id = mcs.material_id and ifnull(mcs.delete_flag,'0') !='1' - left JOIN jsh_unit u on m.unit_id = u.id and ifnull(u.delete_Flag,'0') !='1' - left JOIN jsh_material_category mc on m.category_id = mc.id and ifnull(mc.delete_Flag,'0') !='1' - where 1=1 - and me.default_flag=1 and mcs.depot_id in #{item} + left JOIN jsh_unit u on m.unit_id = u.id and ifnull(u.delete_Flag,'0') !='1' + left JOIN jsh_material_category mc on m.category_id = mc.id and ifnull(mc.delete_Flag,'0') !='1' + where 1=1 + and me.default_flag=1 and m.category_id in @@ -655,16 +655,16 @@ (select m.id, ifnull(sum(mcs.current_number),0) currentStock from jsh_material m left JOIN jsh_material_extend me on m.id = me.material_id and ifnull(me.delete_Flag,'0') !='1' left join jsh_material_current_stock mcs on m.id = mcs.material_id and ifnull(mcs.delete_flag,'0') !='1' - left JOIN jsh_unit u on m.unit_id = u.id and ifnull(u.delete_Flag,'0') !='1' - left JOIN jsh_material_category mc on m.category_id = mc.id and ifnull(mc.delete_Flag,'0') !='1' - where 1=1 - and me.default_flag=1 and mcs.depot_id in #{item} + left JOIN jsh_unit u on m.unit_id = u.id and ifnull(u.delete_Flag,'0') !='1' + left JOIN jsh_material_category mc on m.category_id = mc.id and ifnull(mc.delete_Flag,'0') !='1' + where 1=1 + and me.default_flag=1 and m.category_id in From 44e34c78ce9531661272d0d3213cd468597debb6 Mon Sep 17 00:00:00 2001 From: jishenghua <752718920@qq.com> Date: Sat, 30 Mar 2024 14:48:33 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E5=AE=8C=E5=96=84excel=E5=AF=BC=E5=87=BA?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E7=9A=84=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/depotHead/DepotHeadService.java | 8 ++++---- .../erp/service/material/MaterialService.java | 4 ++-- .../erp/service/supplier/SupplierService.java | 8 ++++---- .../systemConfig/SystemConfigService.java | 4 ++-- .../java/com/jsh/erp/utils/ExcelUtils.java | 20 +++++++++---------- 5 files changed, 21 insertions(+), 23 deletions(-) diff --git a/jshERP-boot/src/main/java/com/jsh/erp/service/depotHead/DepotHeadService.java b/jshERP-boot/src/main/java/com/jsh/erp/service/depotHead/DepotHeadService.java index 7bf5bb1c..cac71be0 100644 --- a/jshERP-boot/src/main/java/com/jsh/erp/service/depotHead/DepotHeadService.java +++ b/jshERP-boot/src/main/java/com/jsh/erp/service/depotHead/DepotHeadService.java @@ -1311,7 +1311,7 @@ public class DepotHeadService { billListCacheVo.setOrganName(dh.getOrganName()); billListCacheVo.setOperTimeStr(getCenternTime(dh.getOperTime())); billListCacheVoMap.put(dh.getId(), billListCacheVo); - String[] objs = new String[100]; + String[] objs = new String[sheetOneArr.length]; objs[0] = dh.getOrganName(); objs[1] = dh.getNumber(); objs[2] = dh.getLinkNumber(); @@ -1328,7 +1328,7 @@ public class DepotHeadService { objs[10] = dh.getRemark(); billList.add(objs); } - ExcelUtils.exportObjectsWithTitle(wtwb, oneTip, sheetOneArr, "单据列表", 0, billList); + ExcelUtils.exportObjectsManySheet(wtwb, oneTip, sheetOneArr, "单据列表", 0, billList); //导出明细数据 if(idList.size()>0) { List dataList = depotItemMapperEx.getBillDetailListByIds(idList); @@ -1349,7 +1349,7 @@ public class DepotHeadService { String[] sheetTwoArr = StringUtil.listToStringArray(sheetTwoList); List billDetail = new ArrayList<>(); for (DepotItemVo4WithInfoEx diEx : dataList) { - String[] objs = new String[100]; + String[] objs = new String[sheetTwoArr.length]; BillListCacheVo billListCacheVo = billListCacheVoMap.get(diEx.getHeaderId()); objs[0] = billListCacheVo != null ? billListCacheVo.getOrganName() : ""; objs[1] = billListCacheVo != null ? billListCacheVo.getNumber() : ""; @@ -1377,7 +1377,7 @@ public class DepotHeadService { objs[22] = diEx.getRemark(); billDetail.add(objs); } - ExcelUtils.exportObjectsWithTitle(wtwb, twoTip, sheetTwoArr, "单据明细", 1, billDetail); + ExcelUtils.exportObjectsManySheet(wtwb, twoTip, sheetTwoArr, "单据明细", 1, billDetail); } wtwb.write(); wtwb.close(); diff --git a/jshERP-boot/src/main/java/com/jsh/erp/service/material/MaterialService.java b/jshERP-boot/src/main/java/com/jsh/erp/service/material/MaterialService.java index d505b044..994b4f70 100644 --- a/jshERP-boot/src/main/java/com/jsh/erp/service/material/MaterialService.java +++ b/jshERP-boot/src/main/java/com/jsh/erp/service/material/MaterialService.java @@ -507,7 +507,7 @@ public class MaterialService { List objects = new ArrayList<>(); if (null != dataList) { for (MaterialVo4Unit m : dataList) { - String[] objs = new String[100]; + String[] objs = new String[names.length]; objs[0] = m.getName(); objs[1] = m.getStandard(); objs[2] = m.getModel(); @@ -544,7 +544,7 @@ public class MaterialService { objects.add(objs); } } - File file = ExcelUtils.exportObjectsWithoutTitle(title, "*导入时本行内容请勿删除,切记!", names, title, objects); + File file = ExcelUtils.exportObjectsOneSheet(title, "*导入时本行内容请勿删除,切记!", names, title, objects); ExcelUtils.downloadExcel(file, file.getName(), response); } diff --git a/jshERP-boot/src/main/java/com/jsh/erp/service/supplier/SupplierService.java b/jshERP-boot/src/main/java/com/jsh/erp/service/supplier/SupplierService.java index 4a314636..09534839 100644 --- a/jshERP-boot/src/main/java/com/jsh/erp/service/supplier/SupplierService.java +++ b/jshERP-boot/src/main/java/com/jsh/erp/service/supplier/SupplierService.java @@ -582,7 +582,7 @@ public class SupplierService { List objects = new ArrayList(); if (null != dataList) { for (Supplier s : dataList) { - String[] objs = new String[10]; + String[] objs = new String[names.length]; objs[0] = s.getSupplier(); objs[1] = s.getContacts(); objs[2] = s.getTelephone(); @@ -594,7 +594,7 @@ public class SupplierService { objects.add(objs); } } - return ExcelUtils.exportObjectsWithoutTitle(title, "*导入时本行内容请勿删除,切记!", names, title, objects); + return ExcelUtils.exportObjectsOneSheet(title, "*导入时本行内容请勿删除,切记!", names, title, objects); } } @@ -611,7 +611,7 @@ public class SupplierService { List objects = new ArrayList(); if (null != dataList) { for (Supplier s : dataList) { - String[] objs = new String[20]; + String[] objs = new String[names.length]; objs[0] = s.getSupplier(); objs[1] = s.getContacts(); objs[2] = s.getTelephone(); @@ -634,7 +634,7 @@ public class SupplierService { objects.add(objs); } } - return ExcelUtils.exportObjectsWithoutTitle(title, "*导入时本行内容请勿删除,切记!", names, title, objects); + return ExcelUtils.exportObjectsOneSheet(title, "*导入时本行内容请勿删除,切记!", names, title, objects); } /** diff --git a/jshERP-boot/src/main/java/com/jsh/erp/service/systemConfig/SystemConfigService.java b/jshERP-boot/src/main/java/com/jsh/erp/service/systemConfig/SystemConfigService.java index 649d98e5..aafeca43 100644 --- a/jshERP-boot/src/main/java/com/jsh/erp/service/systemConfig/SystemConfigService.java +++ b/jshERP-boot/src/main/java/com/jsh/erp/service/systemConfig/SystemConfigService.java @@ -504,7 +504,7 @@ public class SystemConfigService { if (null != arr) { for (Object object: arr) { List list = (List) object; - String[] objs = new String[100]; + String[] objs = new String[names.length]; for (int i = 0; i < list.size(); i++) { if(null != list.get(i)) { objs[i] = list.get(i).toString(); @@ -513,7 +513,7 @@ public class SystemConfigService { objects.add(objs); } } - File file = ExcelUtils.exportObjectsWithoutTitle(title, tip, names, title, objects); + File file = ExcelUtils.exportObjectsOneSheet(title, tip, names, title, objects); ExcelUtils.downloadExcel(file, file.getName(), response); } } \ No newline at end of file diff --git a/jshERP-boot/src/main/java/com/jsh/erp/utils/ExcelUtils.java b/jshERP-boot/src/main/java/com/jsh/erp/utils/ExcelUtils.java index ba732e71..961fed7a 100644 --- a/jshERP-boot/src/main/java/com/jsh/erp/utils/ExcelUtils.java +++ b/jshERP-boot/src/main/java/com/jsh/erp/utils/ExcelUtils.java @@ -45,9 +45,8 @@ public class ExcelUtils { * @return * @throws Exception */ - public static void exportObjectsWithTitle(WritableWorkbook wtwb, String tip, - String[] names, String title, int index, List objects) - throws Exception { + public static void exportObjectsManySheet(WritableWorkbook wtwb, String tip, + String[] names, String title, int index, List objects) throws Exception { WritableSheet sheet = wtwb.createSheet(title, index); sheet.getSettings().setDefaultColumnWidth(12); @@ -72,6 +71,7 @@ public class ExcelUtils { WritableCellFormat format = new WritableCellFormat(wfont); format.setAlignment(Alignment.LEFT); format.setVerticalAlignment(VerticalAlignment.TOP); + format.setBorder(jxl.format.Border.ALL,jxl.format.BorderLineStyle.THIN); // 第一行写入提示 if(com.jsh.erp.utils.StringUtil.isNotEmpty(tip) && tip.contains("*")) { @@ -101,7 +101,7 @@ public class ExcelUtils { } /** - * 导出excel,不需要第一行的title + * 导出excel,带单个sheet * * @param fileName * @param names @@ -110,9 +110,8 @@ public class ExcelUtils { * @return * @throws Exception */ - public static File exportObjectsWithoutTitle(String fileName, String tip, - String[] names, String title, List objects) - throws Exception { + public static File exportObjectsOneSheet(String fileName, String tip, + String[] names, String title, List objects) throws Exception { File excelFile = new File("/opt/"+ fileName); WritableWorkbook wtwb = Workbook.createWorkbook(excelFile); WritableSheet sheet = wtwb.createSheet(title, 0); @@ -120,16 +119,14 @@ public class ExcelUtils { // 标题的格式-红色 WritableFont redWF = new WritableFont(WritableFont.ARIAL, 12, - WritableFont.BOLD, false, UnderlineStyle.NO_UNDERLINE, - Colour.RED); + WritableFont.BOLD, false, UnderlineStyle.NO_UNDERLINE, Colour.RED); WritableCellFormat redWFFC = new WritableCellFormat(redWF); redWFFC.setVerticalAlignment(VerticalAlignment.CENTRE); redWFFC.setBorder(jxl.format.Border.ALL,jxl.format.BorderLineStyle.THIN); // 标题的格式-黑色 WritableFont blackWF = new WritableFont(WritableFont.ARIAL, 12, - WritableFont.BOLD, false, UnderlineStyle.NO_UNDERLINE, - Colour.BLACK); + WritableFont.BOLD, false, UnderlineStyle.NO_UNDERLINE, Colour.BLACK); WritableCellFormat blackWFFC = new WritableCellFormat(blackWF); blackWFFC.setVerticalAlignment(VerticalAlignment.CENTRE); blackWFFC.setBorder(jxl.format.Border.ALL,jxl.format.BorderLineStyle.THIN); @@ -139,6 +136,7 @@ public class ExcelUtils { WritableCellFormat format = new WritableCellFormat(wfont); format.setAlignment(Alignment.LEFT); format.setVerticalAlignment(VerticalAlignment.TOP); + format.setBorder(jxl.format.Border.ALL,jxl.format.BorderLineStyle.THIN); // 第一行写入提示 if(StringUtil.isNotEmpty(tip) && tip.contains("*")) { From 997508894a3f7ac797c718f855e8dbcb9935d5ad Mon Sep 17 00:00:00 2001 From: jishenghua <752718920@qq.com> Date: Sat, 30 Mar 2024 14:49:59 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E7=BB=99=E5=8D=95=E6=8D=AE=E6=9F=A5?= =?UTF-8?q?=E7=9C=8B=E7=95=8C=E9=9D=A2=E7=9A=84=EF=BC=8C=E6=98=8E=E7=BB=86?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E5=A2=9E=E5=8A=A0=E5=BA=8F=E5=8F=B7=E7=9A=84?= =?UTF-8?q?=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jshERP-web/src/views/bill/dialog/BillDetail.vue | 8 +++++--- .../src/views/financial/dialog/FinancialDetail.vue | 14 ++++++++------ 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/jshERP-web/src/views/bill/dialog/BillDetail.vue b/jshERP-web/src/views/bill/dialog/BillDetail.vue index a17e3d6a..6674e2a5 100644 --- a/jshERP-web/src/views/bill/dialog/BillDetail.vue +++ b/jshERP-web/src/views/bill/dialog/BillDetail.vue @@ -1535,12 +1535,15 @@ needAddkeywords.push('position') } } + let currentCol = [{title:'#',dataIndex:'',align:'center',customRender:function(t,r,index){return parseInt(index)+1;}}] if(record.status === '3') { //部分采购|部分销售的时候显示全部列 - this.columns = this.defColumns + for(let i=0; i Date: Sat, 30 Mar 2024 17:38:47 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E8=A7=A3=E5=86=B3bug=EF=BC=9A=E5=90=8C?= =?UTF-8?q?=E4=B8=80=E4=B8=AA=E5=BE=AE=E4=BF=A1=E7=BB=91=E5=AE=9A=E5=8F=AF?= =?UTF-8?q?=E4=BB=A5=E7=BB=91=E5=AE=9A=E5=A4=9A=E4=B8=AA=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E8=B4=A6=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jshERP-boot/src/main/resources/mapper_xml/UserMapperEx.xml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/jshERP-boot/src/main/resources/mapper_xml/UserMapperEx.xml b/jshERP-boot/src/main/resources/mapper_xml/UserMapperEx.xml index 964b72d9..5fb9f9cb 100644 --- a/jshERP-boot/src/main/resources/mapper_xml/UserMapperEx.xml +++ b/jshERP-boot/src/main/resources/mapper_xml/UserMapperEx.xml @@ -153,8 +153,7 @@ - update jsh_user u set u.weixin_open_id = #{weixinOpenId} - where u.login_name = #{loginName} and u.password = #{password} - and ifnull(u.status,'0') not in('1','2') + update jsh_user u set u.weixin_open_id = null where u.weixin_open_id = #{weixinOpenId}; + update jsh_user u set u.weixin_open_id = #{weixinOpenId} where u.login_name = #{loginName} and u.password = #{password} and ifnull(u.status,'0') not in('1','2'); \ No newline at end of file From 74383c5f3d01d00cb4ecca8a4f2526a8c014f708 Mon Sep 17 00:00:00 2001 From: jishenghua <752718920@qq.com> Date: Mon, 1 Apr 2024 21:07:51 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=8D=95=E6=8D=AE?= =?UTF-8?q?=E7=9A=84=E6=96=B0=E5=A2=9E=E5=92=8C=E6=9B=B4=E6=96=B0=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../jsh/erp/service/depotHead/DepotHeadService.java | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/jshERP-boot/src/main/java/com/jsh/erp/service/depotHead/DepotHeadService.java b/jshERP-boot/src/main/java/com/jsh/erp/service/depotHead/DepotHeadService.java index cac71be0..aaa5f61a 100644 --- a/jshERP-boot/src/main/java/com/jsh/erp/service/depotHead/DepotHeadService.java +++ b/jshERP-boot/src/main/java/com/jsh/erp/service/depotHead/DepotHeadService.java @@ -996,11 +996,7 @@ public class DepotHeadService { String.format(ExceptionConstants.DEPOT_HEAD_FILE_NUM_LIMIT_MSG, 4)); } } - try{ - depotHeadMapper.insertSelective(depotHead); - }catch(Exception e){ - JshException.writeFail(logger, e); - } + depotHeadMapper.insertSelective(depotHead); /**入库和出库处理预付款信息*/ if(BusinessConstants.PAY_TYPE_PREPAID.equals(depotHead.getPayType())){ if(depotHead.getOrganId()!=null) { @@ -1094,11 +1090,7 @@ public class DepotHeadService { String.format(ExceptionConstants.DEPOT_HEAD_FILE_NUM_LIMIT_MSG, 4)); } } - try{ - depotHeadMapper.updateByPrimaryKeySelective(depotHead); - }catch(Exception e){ - JshException.writeFail(logger, e); - } + depotHeadMapper.updateByPrimaryKeySelective(depotHead); //如果存在多账户结算需要将原账户的id置空 if(StringUtil.isNotEmpty(depotHead.getAccountIdList())) { depotHeadMapperEx.setAccountIdToNull(depotHead.getId());