diff --git a/ruoyi-admin/src/main/java/com/ruoyi/erp/controller/ErpBomController.java b/ruoyi-admin/src/main/java/com/ruoyi/erp/controller/ErpBomController.java index bf676f8f..cac41a3f 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/erp/controller/ErpBomController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/erp/controller/ErpBomController.java @@ -77,6 +77,7 @@ public class ErpBomController extends BaseController @ResponseBody public TableDataInfo list(ErpBomVo erpBomVo,HttpServletRequest request) { + erpBomVo.setParentId(0L); SysUser curUser = ShiroUtils.getSysUser(); Long userId = curUser.getUserId(); Set roleKeys = roleService.selectRoleKeys(userId); @@ -88,21 +89,10 @@ public class ErpBomController extends BaseController @RequiresPermissions("erp:bom:list") @PostMapping("/reverseList") @ResponseBody - public TableDataInfo selectErpBomVoReverse(ErpBomVo erpBomVo,HttpServletRequest request) { - Map map = new HashMap<>(); - String materialNo = String.valueOf(request.getSession().getAttribute("materialNo")); - map.put("materialNo", materialNo); - List materialList = erpBomService.selectErpBomByMaterialNos(erpBomVo.getMaterialNo()); - //将返回结果根据父节点进行排序 - List parentIds = erpBomService.getAllParentIds(materialList); - Map map2 = new HashMap<>(); - map2.put("parentIds", parentIds); - //查询所有上述父节点的值 - List list1 = erpBomService.selectSubBomsByParentMaterialNo(map2); - - //转换为页面需要的格式数据 - startPage(); - List list = erpBomService.selectErpBomListReverse(list1); + public TableDataInfo selectErpBomVoReverse(@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum, + @RequestParam(value = "pageSize", defaultValue = "20") Integer pageSize, + ErpBomVo erpBomVo, HttpServletRequest request) { + List list = erpBomService.selectReverseErpBomList(erpBomVo, pageNum, pageSize); return getDataTable(list); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/erp/domain/ErpBomVo.java b/ruoyi-admin/src/main/java/com/ruoyi/erp/domain/ErpBomVo.java index 156ba28d..d011067c 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/erp/domain/ErpBomVo.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/erp/domain/ErpBomVo.java @@ -107,7 +107,7 @@ public class ErpBomVo extends ErpBom{ @Override public String toString() { - return "ErpMaterialVo{" + + return "ErpBomVo{" + "applyUserName='" + applyUserName + '\'' + ", taskId='" + taskId + '\'' + ", taskName='" + taskName + '\'' + @@ -117,7 +117,6 @@ public class ErpBomVo extends ErpBom{ ", todoUserId='" + todoUserId + '\'' + ", instanceTypeName='" + instanceTypeName + '\'' + ", keyword='" + keyword + '\'' + - "} " + super.toString(); + '}'; } - } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/erp/mapper/ErpBomMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/erp/mapper/ErpBomMapper.java index 680e1209..5101f5b4 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/erp/mapper/ErpBomMapper.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/erp/mapper/ErpBomMapper.java @@ -28,6 +28,11 @@ public interface ErpBomMapper public List selectErpBomList(ErpBomVo erpBomVo); + /** + * 反向BOM查询 + * */ + public List selectReverseErpBomList(ErpBomVo erpBomVo); + /** * 查询bom列表 * diff --git a/ruoyi-admin/src/main/java/com/ruoyi/erp/service/IErpBomService.java b/ruoyi-admin/src/main/java/com/ruoyi/erp/service/IErpBomService.java index e6dad27f..af14cb1a 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/erp/service/IErpBomService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/erp/service/IErpBomService.java @@ -54,9 +54,6 @@ public interface IErpBomService void collectParentIdsRecursively(List parents, Long currentId); - List selectErpBomListReverse(List erpBomVoList); - - List selectErpBomByMaterialNos(String materialNo); List selectErpBomlist(); @@ -135,4 +132,9 @@ public interface IErpBomService ErpBom selectErpBomByOneMaterialNo(String materialNo); List selectSubBomsByParentMaterialNo(Map params); + + /** + * 查询反向BOM列表 + * */ + List selectReverseErpBomList(ErpBomVo erpBomVo,Integer pageNum,Integer pageSize); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/erp/service/impl/ErpBomServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/erp/service/impl/ErpBomServiceImpl.java index 797ba421..7f43ee5c 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/erp/service/impl/ErpBomServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/erp/service/impl/ErpBomServiceImpl.java @@ -1,6 +1,8 @@ package com.ruoyi.erp.service.impl; import com.github.pagehelper.Page; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; import com.ruoyi.common.core.domain.entity.SysUser; import com.ruoyi.common.core.page.PageDomain; import com.ruoyi.common.core.page.TableSupport; @@ -32,8 +34,11 @@ import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestParam; import java.util.*; +import java.util.stream.Collectors; /** * bomService业务层处理 @@ -369,55 +374,184 @@ private ISysAttachService attachService; } } } + + + + /** + * 查询反向 BOM 列表并自动获取分页后的结果 + */ @Override - public List selectErpBomListReverse(List erpBomVoList) - { - List returnList = new ArrayList<>(); - for (ErpBomVo bomVo: erpBomVoList) { - SysUser sysUser = userMapper.selectUserByLoginName(bomVo.getCreateBy()); - if (sysUser != null) { - bomVo.setCreateUserName(sysUser.getUserName()); + public Page selectReverseErpBomList(ErpBomVo erpBomVo, Integer pageNum, Integer pageSize) { + // 设置分页参数 + PageHelper.startPage(pageNum, pageSize); + + // 执行查询并自动获取分页后的结果 + List allBoms = erpBomMapper.selectReverseErpBomList(erpBomVo); + PageInfo pageInfo = new PageInfo<>(allBoms); + + // 创建一个映射来存储 BOM 和它的直接子项 + Map bomMap = allBoms.stream() + .collect(Collectors.toMap(ErpBomVo::getId, bom -> bom)); + + // 使用 Set 来防止重复添加和避免无限循环 + Set visited = new HashSet<>(); + + // 构建返回的结果列表 + List resultList = new ArrayList<>(); + + for (ErpBomVo bom : allBoms) { + if (!visited.contains(bom.getId())) { + ErpBomVo topParent = findTopMostParentBom(bom, bomMap, visited); + if (topParent != null && !resultList.contains(topParent)) { + resultList.add(topParent); + } } - SysUser sysUser2 = userMapper.selectUserByLoginName(bomVo.getApplyUser()); - if (sysUser2 != null) { - bomVo.setApplyUserName(sysUser2.getUserName()); + } + + // 对结果进行用户信息、任务状态等附加信息设置 + for (ErpBomVo bomVo : resultList) { + setAdditionalInfo(bomVo); + } + + // 创建一个新的分页对象来封装过滤后的结果 + Page returnPage = new Page<>(pageNum, pageSize); + returnPage.addAll(resultList); + returnPage.setTotal(pageInfo.getTotal()); // 设置总记录数 + + return returnPage; + } + + /** + * 查找最顶层的 BOM,即使不在初始 bomMap 中也会尝试查找 + */ + private ErpBomVo findTopMostParentBom(ErpBomVo bom, Map bomMap, Set visited) { + Long currentId = bom.getId(); + ErpBomVo currentBom = bomMap.get(currentId); + if (currentBom == null) { + // 如果当前 BOM 不在 bomMap 中,则尝试从数据库中加载 + currentBom = erpBomMapper.selectErpBomById(currentId); + if (currentBom != null) { + bomMap.put(currentId, currentBom); // 将新找到的 BOM 添加到 bomMap 中 + } else { + return null; // 如果找不到对应的 BOM,则停止查找 } - String instanceId = bomVo.getInstanceId(); - // 当前环节 - if (StringUtils.isNotBlank(instanceId)) { - List taskList = taskService.createTaskQuery() - .processInstanceId(instanceId) -// .singleResult(); - .list(); // 例如请假会签,会同时拥有多个任务 - if (!org.springframework.util.CollectionUtils.isEmpty(taskList)) { - TaskEntityImpl task = (TaskEntityImpl) taskList.get(0); - String taskId = task.getId(); - bomVo.setTaskId(taskId); - // 设置待办用户 - List todoUserList = todoItemMapper.selectUndealTodoUserList(taskId); - if(!org.springframework.util.CollectionUtils.isEmpty(taskList)){ - bomVo.setTodoUserId(String.join(",",todoUserList)); - } - if (task.getSuspensionState() == 2) { - bomVo.setTaskName("已挂起"); - bomVo.setSuspendState("2"); - } else { - bomVo.setTaskName(task.getName()); - bomVo.setSuspendState("1"); - } + } + + // 首先找到0阶 BOM + ErpBomVo zeroLevelBom = findTopZeroLevelBom(currentBom, bomMap, visited); + if (zeroLevelBom == null) { + return null; + } + + // 然后检查该0阶 BOM 是否为其他 BOM 的子项,如果是,继续向上追溯 + ErpBomVo topParent = traceToTopParent(zeroLevelBom, bomMap, visited); + return topParent != null ? topParent : zeroLevelBom; + } + + /** + * 查找最顶层的0阶 BOM,即使不在初始 bomMap 中也会尝试查找 + */ + private ErpBomVo findTopZeroLevelBom(ErpBomVo bom, Map bomMap, Set visited) { + Long currentId = bom.getId(); + while (currentId != null && !visited.contains(currentId)) { + visited.add(currentId); + ErpBomVo currentBom = bomMap.get(currentId); + if (currentBom == null) { + // 如果当前 BOM 不在 bomMap 中,则尝试从数据库中加载 + currentBom = erpBomMapper.selectErpBomById(currentId); + if (currentBom != null) { + bomMap.put(currentId, currentBom); // 将新找到的 BOM 添加到 bomMap 中 } else { - // 已办结或者已撤销 - bomVo.setTaskName("已结束"); + break; // 如果找不到对应的 BOM,则停止查找 } + } + + if (currentBom != null && StringUtils.isNotEmpty(currentBom.getBomNo()) && (currentBom.getLevel() == null || currentBom.getLevel() != 1)) { + return currentBom; // 满足条件,返回当前 BOM + } + currentId = currentBom != null ? currentBom.getParentId() : null; + } + return null; + } + + /** + * 追溯到最顶级的父级 BOM + */ + private ErpBomVo traceToTopParent(ErpBomVo bom, Map bomMap, Set visited) { + Long parentId = bom.getParentId(); + while (parentId != null && !visited.contains(parentId)) { + visited.add(parentId); + ErpBomVo parentBom = bomMap.get(parentId); + if (parentBom == null) { + // 如果父级 BOM 不在 bomMap 中,则尝试从数据库中加载 + parentBom = erpBomMapper.selectErpBomById(parentId); + if (parentBom != null) { + bomMap.put(parentId, parentBom); // 将新找到的 BOM 添加到 bomMap 中 + } else { + break; // 如果找不到对应的父级 BOM,则停止查找 + } + } + if (parentBom != null) { + bom = parentBom; + parentId = parentBom.getParentId(); } else { - bomVo.setTaskName("未启动"); + break; + } + } + return bom; + } + + /** + * 设置附加信息(用户信息、任务状态等) + */ + private void setAdditionalInfo(ErpBomVo bomVo) { + SysUser sysUser = userMapper.selectUserByLoginName(bomVo.getCreateBy()); + if (sysUser != null) { + bomVo.setCreateUserName(sysUser.getUserName()); + } + SysUser sysUser2 = userMapper.selectUserByLoginName(bomVo.getApplyUser()); + if (sysUser2 != null) { + bomVo.setApplyUserName(sysUser2.getUserName()); + } + String instanceId = bomVo.getInstanceId(); + // 当前环节 + if (StringUtils.isNotBlank(instanceId)) { + List taskList = taskService.createTaskQuery() + .processInstanceId(instanceId) + .list(); + if (!org.springframework.util.CollectionUtils.isEmpty(taskList)) { + TaskEntityImpl task = (TaskEntityImpl) taskList.get(0); + String taskId = task.getId(); + bomVo.setTaskId(taskId); + // 设置待办用户 + List todoUserList = todoItemMapper.selectUndealTodoUserList(taskId); + if(!org.springframework.util.CollectionUtils.isEmpty(todoUserList)){ + bomVo.setTodoUserId(String.join(",",todoUserList)); + } + if (task.getSuspensionState() == 2) { + bomVo.setTaskName("已挂起"); + bomVo.setSuspendState("2"); + } else { + bomVo.setTaskName(task.getName()); + bomVo.setSuspendState("1"); + } + } else { + // 已办结或者已撤销 + bomVo.setTaskName("已结束"); + } + } else { + bomVo.setTaskName("未启动"); + } + if (bomVo.getAuditStatus() != null) { + if ("1".equals(bomVo.getAuditStatus())) { + bomVo.setTaskName("审核通过"); + } else if ("2".equals(bomVo.getAuditStatus())) { + bomVo.setTaskName("审核拒绝"); } - returnList.add(bomVo); } - Integer total = erpBomVoList.size(); - return returnList; } + @Override public List selectErpBomByMaterialNos(String materialNo) { return erpBomMapper.selectErpBomByMaterialNos(materialNo); diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/domain/Vo/ExportCustomerQuoteChildVo.java b/ruoyi-admin/src/main/java/com/ruoyi/system/domain/Vo/ExportCustomerQuoteChildVo.java index 6a08c03f..d368338e 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/domain/Vo/ExportCustomerQuoteChildVo.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/domain/Vo/ExportCustomerQuoteChildVo.java @@ -18,6 +18,12 @@ public class ExportCustomerQuoteChildVo { /** 物料的数量 */ private Integer materialNum; + /** 物料的型号 */ + private String materialModel; + + + /** 物料图片*/ + private String photoUrl; /** 物料的含税单价 */ private BigDecimal materialTaxMoney; diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysCustomerQuoteServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysCustomerQuoteServiceImpl.java index dfbea659..1f0043b9 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysCustomerQuoteServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysCustomerQuoteServiceImpl.java @@ -486,7 +486,7 @@ public class SysCustomerQuoteServiceImpl implements ISysCustomerQuoteService { @Override public void exportCustomerQuoteOne(String supplierCode, HttpServletResponse response) { - String fileName = "Vantritek-RMB.xlsx"; + String fileName = "中文Vantritek-RMB.xlsx"; try { @@ -533,8 +533,9 @@ public class SysCustomerQuoteServiceImpl implements ISysCustomerQuoteService { ExportCustomerQuoteChildVo exportCustomerQuoteChildVo = new ExportCustomerQuoteChildVo(); exportCustomerQuoteChildVo.setDescribe(sysCustomerQuoteChild.getDescribe()); exportCustomerQuoteChildVo.setMaterialNum(sysCustomerQuoteChild.getMaterialNum()); + exportCustomerQuoteChildVo.setMaterialModel(sysCustomerQuoteChild.getMaterialModel()); //区分币种 - setMaterialPrice(exportCustomerQuoteChildVo, sysCustomerVo, sysCustomerQuoteChild); + setMaterialPrice(exportCustomerQuoteChildVo, sysCustomerQuote, sysCustomerQuoteChild); exportCustomerQuoteChildVos.add(exportCustomerQuoteChildVo); } @@ -557,7 +558,7 @@ public class SysCustomerQuoteServiceImpl implements ISysCustomerQuoteService { * */ @Override public void exportCustomerQuoteTwo(String supplierCode, HttpServletResponse response) { - String fileName = "Vantritek-美元.xlsx"; + String fileName = "英文Vantritek-美元.xlsx"; try { @@ -597,8 +598,9 @@ public class SysCustomerQuoteServiceImpl implements ISysCustomerQuoteService { ExportCustomerQuoteChildVo exportCustomerQuoteChildVo = new ExportCustomerQuoteChildVo(); exportCustomerQuoteChildVo.setDescribe(sysCustomerQuoteChild.getDescribe()); exportCustomerQuoteChildVo.setMaterialNum(sysCustomerQuoteChild.getMaterialNum()); + exportCustomerQuoteChildVo.setMaterialModel(sysCustomerQuoteChild.getMaterialModel()); //区分币种 - setMaterialPrice(exportCustomerQuoteChildVo, sysCustomerVo, sysCustomerQuoteChild); + setMaterialPrice(exportCustomerQuoteChildVo, sysCustomerQuote, sysCustomerQuoteChild); exportCustomerQuoteChildVos.add(exportCustomerQuoteChildVo); } @@ -620,7 +622,7 @@ public class SysCustomerQuoteServiceImpl implements ISysCustomerQuoteService { * */ @Override public void exportCustomerQuoteThree(String supplierCode, HttpServletResponse response) { - String fileName = "Infinity-RMB.xlsx"; + String fileName = "英文Infinity-美元.xlsx"; try { @@ -645,19 +647,11 @@ public class SysCustomerQuoteServiceImpl implements ISysCustomerQuoteService { String customerCode = sysCustomerQuote.getCustomerCode(); SysCustomerVo sysCustomerVo = sysCustomerMapper.selectSysCustomerByEnterpriseCode(customerCode); - - List companyInformations = companyInformationMapper.selectSysCompanyInformationAllList(); - //from - SysCompanyInformation sysCompanyInformation = companyInformations.get(0); - HashMap map = new HashMap<>(); String pricingDate = sysCustomerQuote.getPricingDate(); map.put("supplierCode", sysCustomerQuote.getSupplierCode()); map.put("pricingDate", pricingDate); - map.put("contacts", sysCompanyInformation.getContacts()); - map.put("contactNumberFrom", sysCompanyInformation.getContactNumber()); - map.put("companyEmail", sysCompanyInformation.getCompanyEmail()); map.put("customerContact", sysCustomerVo.getCustomerContact()); map.put("contactNumberTo", sysCustomerVo.getContactNumber()); map.put("customerEmail", sysCustomerVo.getCustomerEmail()); @@ -667,8 +661,9 @@ public class SysCustomerQuoteServiceImpl implements ISysCustomerQuoteService { ExportCustomerQuoteChildVo exportCustomerQuoteChildVo = new ExportCustomerQuoteChildVo(); exportCustomerQuoteChildVo.setDescribe(sysCustomerQuoteChild.getDescribe()); exportCustomerQuoteChildVo.setMaterialNum(sysCustomerQuoteChild.getMaterialNum()); + exportCustomerQuoteChildVo.setMaterialModel(sysCustomerQuoteChild.getMaterialModel()); //区分币种 - setMaterialPrice(exportCustomerQuoteChildVo, sysCustomerVo, sysCustomerQuoteChild); + setMaterialPrice(exportCustomerQuoteChildVo, sysCustomerQuote, sysCustomerQuoteChild); exportCustomerQuoteChildVos.add(exportCustomerQuoteChildVo); } @@ -690,7 +685,7 @@ public class SysCustomerQuoteServiceImpl implements ISysCustomerQuoteService { * */ @Override public void exportCustomerQuoteFour(String supplierCode, HttpServletResponse response) { - String fileName = "Infinity-美元.xlsx"; + String fileName = "中文Infinity-美元.xlsx"; try { @@ -715,13 +710,18 @@ public class SysCustomerQuoteServiceImpl implements ISysCustomerQuoteService { String customerCode = sysCustomerQuote.getCustomerCode(); SysCustomerVo sysCustomerVo = sysCustomerMapper.selectSysCustomerByEnterpriseCode(customerCode); - + List companyInformations = companyInformationMapper.selectSysCompanyInformationAllList(); + //from + SysCompanyInformation sysCompanyInformation = companyInformations.get(0); HashMap map = new HashMap<>(); String pricingDate = sysCustomerQuote.getPricingDate(); map.put("supplierCode", sysCustomerQuote.getSupplierCode()); map.put("pricingDate", pricingDate); + map.put("contacts", sysCompanyInformation.getContacts()); + map.put("contactNumberFrom", sysCompanyInformation.getContactNumber()); + map.put("companyEmail", sysCompanyInformation.getCompanyEmail()); map.put("customerContact", sysCustomerVo.getCustomerContact()); map.put("contactNumberTo", sysCustomerVo.getContactNumber()); map.put("customerEmail", sysCustomerVo.getCustomerEmail()); @@ -731,8 +731,9 @@ public class SysCustomerQuoteServiceImpl implements ISysCustomerQuoteService { ExportCustomerQuoteChildVo exportCustomerQuoteChildVo = new ExportCustomerQuoteChildVo(); exportCustomerQuoteChildVo.setDescribe(sysCustomerQuoteChild.getDescribe()); exportCustomerQuoteChildVo.setMaterialNum(sysCustomerQuoteChild.getMaterialNum()); + exportCustomerQuoteChildVo.setMaterialModel(sysCustomerQuoteChild.getMaterialModel()); //区分币种 - setMaterialPrice(exportCustomerQuoteChildVo, sysCustomerVo, sysCustomerQuoteChild); + setMaterialPrice(exportCustomerQuoteChildVo, sysCustomerQuote, sysCustomerQuoteChild); exportCustomerQuoteChildVos.add(exportCustomerQuoteChildVo); } @@ -742,15 +743,14 @@ public class SysCustomerQuoteServiceImpl implements ISysCustomerQuoteService { workBook.fill(map, sheet); workBook.fill(exportCustomerQuoteChildVos, fillConfig, sheet); workBook.finish(); - } catch (IOException e) { throw new RuntimeException("文件处理失败",e); } } //区分不同币种的金额 - private void setMaterialPrice(ExportCustomerQuoteChildVo vo, SysCustomerVo sysCustomerVo, SysCustomerQuoteChild child) { - if (RMB.equals(sysCustomerVo.getCommonCurrency())) { + private void setMaterialPrice(ExportCustomerQuoteChildVo vo, SysCustomerQuote sysCustomerQuote, SysCustomerQuoteChild child) { + if (RMB.equals(sysCustomerQuote.getCommonCurrency())) { // RMB BigDecimal noTax = child.getMaterialNoRmb() != null ? child.getMaterialNoRmb() : BigDecimal.ZERO; BigDecimal tax = child.getMaterialRmb() != null ? child.getMaterialRmb() : BigDecimal.ZERO; diff --git a/ruoyi-admin/src/main/resources/mapper/erp/ErpBomMapper.xml b/ruoyi-admin/src/main/resources/mapper/erp/ErpBomMapper.xml index 32bd8929..aab17e6a 100644 --- a/ruoyi-admin/src/main/resources/mapper/erp/ErpBomMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/erp/ErpBomMapper.xml @@ -117,10 +117,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and erp.create_by = #{createBy} and erp.create_time between #{params.beginCreateTime} and #{params.endCreateTime} - and erp.material_no like concat('%', #{params.materialNo}, '%') - and erp.bom_no like concat('%', #{params.bomNo}, '%') - and erp.material_no = #{materialNo} - and erp.bom_no = #{bomNo} + and erp.material_no like concat('%', #{materialNo}, '%') + and erp.bom_no like concat('%', #{bomNo}, '%') + + and erp.material_name like concat('%', #{materialName}, '%') and erp.audit_status = #{auditStatus} and erp.use_status = #{useStatus} @@ -157,6 +157,61 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" order by erp.audit_status asc, erp.create_time desc + + + + + + + +
  • - +
  • - +
  • @@ -76,12 +76,10 @@ -
  • - -
  •  搜索  重置 - 反向BOM + 反向BOM
  • @@ -748,22 +746,27 @@ } }); } - function seachReverseBom(){ - var url = prefix + '/reverseList'; - //将获取的page类型数据放入bootstarpTable中 + + // 反向BOM搜索函数 + function searchReverseBom() { + var formData = $('#formId').serializeArray(); // 获取表单数据并序列化为数组 + // 获取当前表格的分页信息 + var tableOptions = $("#bootstrap-table").bootstrapTable('getOptions'); + formData.push({name: 'pageNum', value: tableOptions.pageNumber}); + formData.push({name: 'pageSize', value: tableOptions.pageSize}); $.ajax({ type: "POST", - url: url, - data: { - 'materialNo':$("#selectMaterialNo").val(), - 'materialName':$("#selectMaterialName").val() - }, + url: prefix + '/reverseList', + data: $.param(formData), // 将表单数据转换为字符串格式 + contentType: "application/x-www-form-urlencoded", // 设置请求的内容类型 success: function (result) { if (result.code == 0) { - $("#bootstrap-table").bootstrapTable('destroy'); - $("#bootstrap-table").bootstrapTable( 'load',result.rows); + // 使用 bootstrap-table 的 load 方法更新表格数据 + $("#bootstrap-table").bootstrapTable('load', result.rows); + // 更新分页信息(如果需要) + $("#bootstrap-table").bootstrapTable('load', { total: result.total-1 }); } - } + }, }); } // 导出 @@ -822,62 +825,6 @@ }); } }; - // 导入 - // function importExcel(formId, width, height) { - // table.set(); - // var currentId = $.common.isEmpty(formId) ? 'importTpl' : formId; - // var _width = $.common.isEmpty(width) ? "400" : width; - // var _height = $.common.isEmpty(height) ? "230" : height; - // layer.open({ - // type: 1, - // area: [_width + 'px', _height + 'px'], - // fix: false, - // // 不固定 - // maxmin: true, - // shade: 0.3, - // title: '导入' + table.options.modalName + '数据', - // content: $('#' + currentId).html(), - // btn: [' 导入', ' 取消'], - // // 弹层外区域关闭 - // shadeClose: true, - // btn1: function(index, layero){ - // var file = layero.find('#file').val(); - // if (file == '' || (!$.common.endWith(file, '.xls') && !$.common.endWith(file, '.xlsx'))) { - // $.modal.msgWarning("请选择后缀为 “xls”或“xlsx”的文件。"); - // return false; - // } - // var index = layer.load(2, {shade: false}); - // $.modal.disable(); - // - // // 获取CheckBox的状态 - // var updateSupport = layero.find('#updateSupport').is(':checked'); - // - // var formData = new FormData(layero.find('form')[0]); - // formData.append('updateSupport', updateSupport); // 添加CheckBox的状态到FormData - // - // $.ajax({ - // url: table.options.importUrl, - // data: formData, - // cache: false, - // contentType: false, - // processData: false, - // type: 'POST', - // success: function (result) { - // layer.close(index); - // $.modal.enable(); - // - // $.modal.closeAll(); - // $.modal.alertSuccess(result); - // $.table.refresh(); - // }, - // error: function (result){ - // layer.close(index); - // $.modal.alertError(result); - // } - // }); - // } - // }); - // } diff --git a/ruoyi-admin/src/main/resources/templates/erp/material/material.html b/ruoyi-admin/src/main/resources/templates/erp/material/material.html index ff1c24f4..16321cfb 100644 --- a/ruoyi-admin/src/main/resources/templates/erp/material/material.html +++ b/ruoyi-admin/src/main/resources/templates/erp/material/material.html @@ -342,7 +342,6 @@ $.modal.open("作废", url); }) } - \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/system/customerQuote/customerQuote.html b/ruoyi-admin/src/main/resources/templates/system/customerQuote/customerQuote.html index 75a00751..1c65e1ba 100644 --- a/ruoyi-admin/src/main/resources/templates/system/customerQuote/customerQuote.html +++ b/ruoyi-admin/src/main/resources/templates/system/customerQuote/customerQuote.html @@ -71,16 +71,16 @@ 导出 - 导出Vantritek-RMB + 导出中文Vantritek-RMB - 导出Vantritek-美元 + 导出英文Vantritek-美元 - 导出Infinity-RMB + 导出英文Infinity-美元 - 导出Infinity-美元 + 导出中文Infinity-美元
    @@ -433,7 +433,7 @@ // 检查是否已审核 if (row.auditStatus === AUDIT_STATUS_APPROVED) { - if (row.commonCurrency === '1'){ + if (row.commonCurrency === '2'){ // 使用 $.modal.confirm 显示确认对话框 $.modal.confirm("确定导出这条数据的客户报价吗?", function() { // 如果用户点击确定,继续导出 @@ -442,7 +442,7 @@ $('#bootstrap-table').bootstrapTable('refresh'); // 刷新表格 }); }else { - showWarning("请选择报价币种为RMB的数据进行导出"); + showWarning("请选择报价币种为美元的数据进行导出"); } } else { showWarning("请先审核");