Browse Source

[fix] 销售管理

修改销售订单导出全部的后端接口:支持筛选后导出筛选后的数据
修复销售订单不能按照业务员筛选的问题
销售订单新增 通过用户名找到业务登录名,重新给业务员赋值后端方法
dev
liuxiaoxu 3 months ago
parent
commit
0b08d44f23
  1. 7
      ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysSalesOrderController.java
  2. 8
      ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysSalesOrderService.java
  3. 14
      ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSalesOrderServiceImpl.java
  4. 17
      ruoyi-admin/src/main/resources/mapper/system/SysSalesOrderMapper.xml
  5. 4
      ruoyi-admin/src/main/resources/templates/system/salesOrder/salesOrder.html

7
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<SysSalesOrderVo> 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<SysSalesOrderVo> list = sysSalesOrderService.selectSysSalesOrderAllList(sysSalesOrder);
ExcelUtil<SysSalesOrderVo> util = new ExcelUtil<SysSalesOrderVo>(SysSalesOrderVo.class);
return util.exportExcel(list, "销售订单数据");

8
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<SysSalesOrderVo> selectSysSalesOrderAllList(SysSalesOrderVo sysSalesOrder);
/**
* 通过用户名找到业务登录名重新给业务员赋值
* */
String convertName(SysSalesOrderVo sysSalesOrder);
}

14
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;
}
/**
* 新增销售订单
*

17
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
<where>
<if test="createBy != null and createBy !=''"> and s.create_by = #{createBy}</if>
<if test="salesOrderCode != null and salesOrderCode != ''"> and s.sales_order_code like concat('%', #{salesOrderCode}, '%')</if>
<if test="salesOrderNumber != null and salesOrderNumber != ''"> and s.sales_order_number like concat('%', #{salesOrderNumber}, '%')</if>
<if test="enterpriseCode != null and enterpriseCode != ''"> and s.enterprise_code like concat('%', #{enterpriseCode}, '%')</if>
@ -187,18 +187,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="deliveryStatus != null and deliveryStatus != ''"> and s.delivery_status = #{deliveryStatus}</if>
<if test="closeStatus != null and closeStatus != ''"> and s.close_status = #{closeStatus}</if>
<if test="invoice != null and invoice != ''"> and s.invoice = #{invoice}</if>
<if test="instanceType != null and instanceType != ''"> and s.instance_type = #{instanceType}</if>
<if test="instanceId != null and instanceId != ''"> and s.instance_id = #{instanceId}</if>
<if test="applyUser != null and applyUser != ''"> and s.apply_user = #{applyUser}</if>
<if test="applyTime != null and applyTime != ''"> and s.apply_time = #{applyTime}</if>
<if test="applyTitle != null and applyTitle != ''"> and s.apply_title = #{applyTitle}</if>
<if test="applyUsers != null and applyUsers != ''"> and s.apply_user in
<foreach item="user" index="index" collection="applyUsers" open="(" separator="," close=")">
#{user}
</foreach>
<if test="materialCode != null and materialCode != ''"> and c.materialCode like concat('%', #{materialCode}, '%')</if>
<if test="materialName != null and materialName != ''">
and c.materialName like concat('%',#{materialName},'%')
</if>
</where>
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
</select>

4
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<selections.length;i++){
salesOrderCodeData.push(selections[i].salesOrderCode);

Loading…
Cancel
Save