diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysSalesOrderController.java b/ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysSalesOrderController.java index 8b4371f5..f7d0073c 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysSalesOrderController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysSalesOrderController.java @@ -144,6 +144,9 @@ public class SysSalesOrderController extends BaseController if (roleKeys.contains("ywyRole")) { sysSalesOrderVo.setApplyUser(loginName); } + //通过用户名找到业务登录名,重新给业务员赋值 + String tempLoginName = sysSalesOrderService.convertName(sysSalesOrderVo); + sysSalesOrderVo.setBusinessMembers(tempLoginName); List list = sysSalesOrderService.selectSysSalesOrderList(sysSalesOrderVo); return getDataTable(list); } @@ -158,6 +161,10 @@ public class SysSalesOrderController extends BaseController @ResponseBody public AjaxResult exportAll(SysSalesOrderVo sysSalesOrder) { + + //通过用户名找到业务登录名,重新给业务员赋值 + String tempLoginName = sysSalesOrderService.convertName(sysSalesOrder); + sysSalesOrder.setBusinessMembers(tempLoginName); List list = sysSalesOrderService.selectSysSalesOrderAllList(sysSalesOrder); ExcelUtil util = new ExcelUtil(SysSalesOrderVo.class); return util.exportExcel(list, "销售订单数据"); diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysSalesOrderService.java b/ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysSalesOrderService.java index b949b69d..7669e1ea 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysSalesOrderService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysSalesOrderService.java @@ -1,5 +1,6 @@ package com.ruoyi.system.service; +import com.ruoyi.system.domain.SysCustomerQuoteVo; import com.ruoyi.system.domain.SysSalesOrderVo; import com.ruoyi.system.domain.SysSalesOrder; import com.ruoyi.system.domain.SysSalesOrderVo; @@ -125,4 +126,11 @@ public interface ISysSalesOrderService * 查询所有可使用的销售订单 * */ List selectSysSalesOrderAllList(SysSalesOrderVo sysSalesOrder); + + + /** + * 通过用户名找到业务登录名,重新给业务员赋值 + * */ + String convertName(SysSalesOrderVo sysSalesOrder); + } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSalesOrderServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSalesOrderServiceImpl.java index 1bc12fed..6243d386 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSalesOrderServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSalesOrderServiceImpl.java @@ -223,6 +223,20 @@ public class SysSalesOrderServiceImpl implements ISysSalesOrderService return sysSalesOrderMapper.selectSysSalesOrderAllList(sysSalesOrder); } + + /** + * 通过用户名找到业务登录名,重新给业务员赋值 + * */ + @Override + public String convertName(SysSalesOrderVo sysSalesOrder) { + String businessMembers = sysSalesOrder.getBusinessMembers(); + if (StringUtils.isNotEmpty(businessMembers)){ + String loginName = userMapper.selectLoginNameByUserName(businessMembers); + return loginName; + } + return businessMembers; + } + /** * 新增销售订单 * diff --git a/ruoyi-admin/src/main/resources/mapper/system/SysSalesOrderMapper.xml b/ruoyi-admin/src/main/resources/mapper/system/SysSalesOrderMapper.xml index 014044fb..1464f858 100644 --- a/ruoyi-admin/src/main/resources/mapper/system/SysSalesOrderMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/system/SysSalesOrderMapper.xml @@ -171,8 +171,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where dict_type = 'processType' ) as p on s.instance_type = p.dict_value + left join sys_sales_order_child as c on s.sales_order_code = c.quoteId - and s.create_by = #{createBy} and s.sales_order_code like concat('%', #{salesOrderCode}, '%') and s.sales_order_number like concat('%', #{salesOrderNumber}, '%') and s.enterprise_code like concat('%', #{enterpriseCode}, '%') @@ -187,18 +187,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and s.delivery_status = #{deliveryStatus} and s.close_status = #{closeStatus} and s.invoice = #{invoice} - and s.instance_type = #{instanceType} - and s.instance_id = #{instanceId} - and s.apply_user = #{applyUser} - and s.apply_time = #{applyTime} - and s.apply_title = #{applyTitle} - and s.apply_user in - - #{user} - + and c.materialCode like concat('%', #{materialCode}, '%') + + and c.materialName like concat('%',#{materialName},'%') - order by s.audit_status,s.create_time desc + group by s.sales_order_id + order by s.audit_status asc,s.create_time desc diff --git a/ruoyi-admin/src/main/resources/templates/system/salesOrder/salesOrder.html b/ruoyi-admin/src/main/resources/templates/system/salesOrder/salesOrder.html index ae6ab24f..e1a1d219 100644 --- a/ruoyi-admin/src/main/resources/templates/system/salesOrder/salesOrder.html +++ b/ruoyi-admin/src/main/resources/templates/system/salesOrder/salesOrder.html @@ -461,7 +461,7 @@ var salesOrderCodeData = []; var selections = $("#bootstrap-table").bootstrapTable("getSelections"); if(selections.length === 0){ - $.modal.confirm("确定导出所有出货通知吗?", function() { + $.modal.confirm("确定导出所有销售订单吗?", function() { var currentId = $.common.isEmpty(formId) ? $('form').attr('id') : formId; var params = $("#bootstrap-table").bootstrapTable('getOptions'); var dataParam = $("#" + currentId).serializeArray(); @@ -480,7 +480,7 @@ }); }); }else { - $.modal.confirm("确定导出选中的所有出货通知吗?", function () { + $.modal.confirm("确定导出选中的所有销售订单吗?", function () { //·拼接单号 for(let i=0;i