Browse Source

[fix] 销售管理

销售出货通知:新增根据销售出货通知单号查询销售出货通知单详情列表方法;新增根据销售出货通知单号批量获取销售出货通知单详情列表
修改销售出货通知实体类所有的成员变量的@Excel注解:新增 width = 20, needMerge = true两个属性,合并主表字段的excel单元格
销售出货通知详情集合List<SysSalesShippingInformDetail>新增@Excel注解
销售出货通知控制层:修改导出所有销售出货通知列表后端接口:新增批量遍历方法,导出前把销售出货通知详情集合List放入销售出货通知里,一起导出;修改导出可选择的销售出货通知列表后端接口实现上面同样的效果
修改销售出货通知前端列表:使用菜单下拉的形式隐藏所有的模板导出按钮
dev
liuxiaoxu 1 week ago
parent
commit
b8cc4c2db5
  1. 35
      ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysSalesShippingInformController.java
  2. 53
      ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysSalesShippingInform.java
  3. 12
      ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysSalesShippingInformDetail.java
  4. 5
      ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysSalesShippingInformDetailMapper.java
  5. 12
      ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysSalesShippingInformDetailService.java
  6. 26
      ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSalesShippingInformDetailServiceImpl.java
  7. 8
      ruoyi-admin/src/main/resources/mapper/system/SysSalesShippingInformDetailMapper.xml
  8. 56
      ruoyi-admin/src/main/resources/templates/system/salesShippingInform/salesShippingInform.html

35
ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysSalesShippingInformController.java

@ -1,6 +1,9 @@
package com.ruoyi.system.controller;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import com.ruoyi.aftersales.domain.vo.SelectShippingDeviceVO;
import com.ruoyi.erp.domain.ErpBom;
@ -8,10 +11,12 @@ import com.ruoyi.erp.domain.ErpBomVo;
import com.ruoyi.purchase.domain.PurchaseOrder;
import com.ruoyi.system.domain.SysSalesOrder;
import com.ruoyi.system.domain.SysSalesShippingInformDetail;
import com.ruoyi.system.service.ISysSalesShippingInformDetailService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.*;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.enums.BusinessType;
@ -39,6 +44,9 @@ public class SysSalesShippingInformController extends BaseController
@Autowired
private ISysSalesShippingInformService sysSalesShippingInformService;
@Autowired
private ISysSalesShippingInformDetailService shippingInformDetailService;
@RequiresPermissions("system:salesShippingInform:view")
@GetMapping()
public String salesShippingInform()
@ -69,8 +77,20 @@ public class SysSalesShippingInformController extends BaseController
public AjaxResult export(SysSalesShippingInform sysSalesShippingInform)
{
List<SysSalesShippingInform> list = sysSalesShippingInformService.selectSysSalesShippingInformList(sysSalesShippingInform);
if (!CollectionUtils.isEmpty(list)){
//批量遍历
List<String> collectOutOrderCodes = list.stream().map(SysSalesShippingInform::getOutOrderCode).collect(Collectors.toList());
Map<String, List<SysSalesShippingInformDetail>> detailMap = shippingInformDetailService.selectShippingInformDetailListByCodes(collectOutOrderCodes);
list.forEach(salesShippingInform -> {
salesShippingInform.setShippingInformDetailList(
detailMap.getOrDefault(salesShippingInform.getOutOrderCode(), Collections.emptyList())
);
});
}
ExcelUtil<SysSalesShippingInform> util = new ExcelUtil<SysSalesShippingInform>(SysSalesShippingInform.class);
return util.exportExcel(list, "销售出货通知数据");
return util.exportExcel(list, "销售出货通知数据","销售出货通知数据");
}
/**
* 导出销售出货通知列表
@ -82,8 +102,19 @@ public class SysSalesShippingInformController extends BaseController
public AjaxResult export(@RequestBody String[] outOrderCodes)
{
List<SysSalesShippingInform> list = sysSalesShippingInformService.getExportListByNos(outOrderCodes);
if (!CollectionUtils.isEmpty(list)){
//批量遍历
List<String> collectOutOrderCodes = list.stream().map(SysSalesShippingInform::getOutOrderCode).collect(Collectors.toList());
Map<String, List<SysSalesShippingInformDetail>> detailMap = shippingInformDetailService.selectShippingInformDetailListByCodes(collectOutOrderCodes);
list.forEach(salesShippingInform -> {
salesShippingInform.setShippingInformDetailList(
detailMap.getOrDefault(salesShippingInform.getOutOrderCode(), Collections.emptyList())
);
});
}
ExcelUtil<SysSalesShippingInform> util = new ExcelUtil<SysSalesShippingInform>(SysSalesShippingInform.class);
return util.exportExcel(list, "销售出货通知数据");
return util.exportExcel(list, "销售出货通知数据","销售出货通知数据");
}
/**

53
ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysSalesShippingInform.java

@ -24,117 +24,118 @@ public class SysSalesShippingInform extends BaseEntity
private Long shippingInformId;
/** 出库单号 */
@Excel(name = "出库单号")
@Excel(name = "出库单号", width = 20, needMerge = true)
private String outOrderCode;
/** 出库状态(0待仓库准备物料、1待售后维护设备1、2待业务确认发货、3待售后维护设备2、4待出库、5部分出库、6全部出库、7已出库、8已取消) */
// @Excel(name = "出库状态", readConverterExp = "0=待仓库准备物料、1待售后维护设备1、2待业务确认发货、3待售后维护设备2、4待出库、5部分出库、6全部出库、7已出库、8已取消")
@Excel(name = "出库状态", dictType = "warehouse_out_status")
@Excel(name = "出库状态", dictType = "warehouse_out_status", width = 20, needMerge = true)
private String warehouseOutStatus;
/** 关联销售订单号 */
@Excel(name = "关联销售订单号")
@Excel(name = "关联销售订单号", width = 20, needMerge = true)
private String salesOrderCode;
/** 出库类型(0销售出库、1生产领料、2员工领料、3委外领料、4公司退货、5工程领料) */
// @Excel(name = "出库类型", readConverterExp = "0=销售出库、1生产领料、2员工领料、3委外领料、4公司退货、5工程领料")
@Excel(name = "出库类型", dictType = "warehouse_out_type")
@Excel(name = "出库类型", dictType = "warehouse_out_type", width = 20, needMerge = true)
private String warehouseOutType;
/** 出库订单类型(0销售订单、1生产订单、2请购订单、3委外订单、4退换货订单、5开发修改单) */
// @Excel(name = "出库订单类型", readConverterExp = "0=销售订单、1生产订单、2请购订单、3委外订单、4退换货订单、5开发修改单")
@Excel(name = "出库订单类型", dictType = "warehouse_order_type")
@Excel(name = "出库订单类型", dictType = "warehouse_order_type", width = 20, needMerge = true)
private String warehouseOrderType;
/** 客户代码/id */
@Excel(name = "客户代码/id")
@Excel(name = "客户ID", width = 20, needMerge = true)
private String customerId;
/** 客户名称 */
@Excel(name = "客户名称")
@Excel(name = "客户名称", width = 20, needMerge = true)
private String customerName;
/** 业务员 */
@Excel(name = "业务员")
@Excel(name = "业务员", width = 20, needMerge = true)
private String businessMembers;
/** 客户订单号 */
@Excel(name = "客户订单号")
@Excel(name = "客户订单号", width = 20, needMerge = true)
private String salesOrderNumber;
/** 物料合计 */
@Excel(name = "物料合计")
@Excel(name = "物料合计", width = 20, needMerge = true,isStatistics = true)
private Integer materialSum;
/** 数量合计 */
@Excel(name = "数量合计")
@Excel(name = "数量合计", width = 20, needMerge = true,isStatistics = true)
private Integer enterpriseSum;
/** 收货联系人 */
@Excel(name = "收货联系人(Ship To)")
@Excel(name = "收货联系人(Ship To)", width = 20, needMerge = true)
private String customerContact;
/** 联系电话 */
@Excel(name = "收货联系人电话(Ship To)")
@Excel(name = "收货联系人电话(Ship To)", width = 20, needMerge = true)
private String contactNumber;
/** 收货地址 */
@Excel(name = "收货地址(Ship To)")
@Excel(name = "收货地址(Ship To)", width = 20, needMerge = true)
private String customerContactAddress;
/** 收货联系人 */
@Excel(name = "收货联系人(Bill To)")
@Excel(name = "收货联系人(Bill To)", width = 20, needMerge = true)
private String customerContactBillto;
/** 联系电话 */
@Excel(name = "联系电话(Bill To)")
@Excel(name = "联系电话(Bill To)", width = 20, needMerge = true)
private String contactNumberBillto;
/** 收货地址 */
@Excel(name = "收货地址(Bill To)")
@Excel(name = "收货地址(Bill To)", width = 20, needMerge = true)
private String contactAddressBillto;
/** 不含税总价(RMB) */
@Excel(name = "不含税总价", readConverterExp = "R=MB")
@Excel(name = "不含税总价", width = 20, needMerge = true,isStatistics = true)
private BigDecimal allPriceExcludingTaxRmb;
/** 不含税总价(美元) */
@Excel(name = "不含税总价", readConverterExp = "美=元")
@Excel(name = "不含税总价", width = 20, needMerge = true,isStatistics = true)
private BigDecimal allPriceExcludingTaxDollar;
/** 含税总价(RMB) */
@Excel(name = "含税总价", readConverterExp = "R=MB")
@Excel(name = "含税总价", width = 20, needMerge = true,isStatistics = true)
private BigDecimal allPriceIncludesTax;
/** 计划交付时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "计划交付时间", width = 30, dateFormat = "yyyy-MM-dd")
@Excel(name = "计划交付时间", width = 30, dateFormat = "yyyy-MM-dd", needMerge = true)
private Date plannedDeliveryTime;
/** 客户验收时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "客户验收时间", width = 30, dateFormat = "yyyy-MM-dd")
@Excel(name = "客户验收时间", width = 30, dateFormat = "yyyy-MM-dd", needMerge = true)
private Date acceptanceTime;
/** 付款条件 */
@Excel(name = "付款条件")
@Excel(name = "付款条件", width = 20, needMerge = true)
private String paymentCondition;
/** 交付条件 */
@Excel(name = "交付条件")
@Excel(name = "交付条件", width = 20, needMerge = true)
private String deliveryCondition;
/** 送货日期 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "送货日期", width = 30, dateFormat = "yyyy-MM-dd")
@Excel(name = "送货日期", width = 30, dateFormat = "yyyy-MM-dd", needMerge = true)
private Date deliverTime;
/** 销售出库单详情*/
/** 销售出货通知详情*/
@Excel(name = "销售出货通知详情")
private List<SysSalesShippingInformDetail> shippingInformDetailList;

12
ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysSalesShippingInformDetail.java

@ -23,11 +23,9 @@ public class SysSalesShippingInformDetail extends BaseEntity
private String outOrderCode;
/** 客户代码/id */
@Excel(name = "客户代码/id")
private String customerId;
/** 客户名称 */
@Excel(name = "客户名称")
private String customerName;
/** 料号 */
@ -71,23 +69,23 @@ public class SysSalesShippingInformDetail extends BaseEntity
private String materialSpecification;
/** 订单数 */
@Excel(name = "订单数")
@Excel(name = "订单数",isStatistics = true)
private Integer makeNum;
/** 本次出货数 */
@Excel(name = "本次出货数")
@Excel(name = "本次出货数",isStatistics = true)
private Integer thisShippingNum;
/** 已出库数 */
@Excel(name = "已出库数")
@Excel(name = "已出库数",isStatistics = true)
private Integer hasOutOrderNum;
/** 本次验收数 */
@Excel(name = "本次验收数")
@Excel(name = "本次验收数",isStatistics = true)
private Integer thisCheckNum;
/** 已验收数 */
@Excel(name = "已验收数")
@Excel(name = "已验收数",isStatistics = true)
private Integer hasCheckNum;
public void setShippingInformDetailId(Long shippingInformDetailId)

5
ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysSalesShippingInformDetailMapper.java

@ -90,4 +90,9 @@ public interface SysSalesShippingInformDetailMapper
* 根据出库单号查询销售出库详情
* */
List<SysSalesShippingInformDetail> selectSysSalesShippingInformDetailByCode(String outOrderCode);
/*
* 根据出库单号批量查询销售出库详情
* */
List<SysSalesShippingInformDetail> selectSalesShippingInformDetailListByCodes(List<String> collectOutOrderCodes);
}

12
ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysSalesShippingInformDetailService.java

@ -1,6 +1,8 @@
package com.ruoyi.system.service;
import java.util.List;
import java.util.Map;
import com.ruoyi.system.domain.SysSalesShippingInformDetail;
/**
@ -72,4 +74,14 @@ public interface ISysSalesShippingInformDetailService
* @return
*/
int restoreSysSalesShippingInformDetailById(Long shippingInformDetailId);
/**
* 根据销售出货通知单号查询销售出货通知单详情列表
* */
List<SysSalesShippingInformDetail> selectShippingInformDetailListByCode(String outOrderCode);
/**
* 根据销售出货通知单号批量获取销售出货通知单详情列表
* */
Map<String, List<SysSalesShippingInformDetail>> selectShippingInformDetailListByCodes(List<String> collectOutOrderCodes);
}

26
ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSalesShippingInformDetailServiceImpl.java

@ -1,6 +1,9 @@
package com.ruoyi.system.service.impl;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.ShiroUtils;
import org.springframework.beans.factory.annotation.Autowired;
@ -46,6 +49,29 @@ public class SysSalesShippingInformDetailServiceImpl implements ISysSalesShippin
return sysSalesShippingInformDetailMapper.selectSysSalesShippingInformDetailList(sysSalesShippingInformDetail);
}
/**
* 根据销售订单编号查询销售出货通知详情列表
*
* @param outOrderCode 出库单号
* @return 销售出货通知详情集合
*/
@Override
public List<SysSalesShippingInformDetail> selectShippingInformDetailListByCode(String outOrderCode) {
return sysSalesShippingInformDetailMapper.selectSysSalesShippingInformDetailByCode(outOrderCode);
}
/**
* 根据销售出货通知单号批量获取销售出货通知单详情列表
* */
@Override
public Map<String, List<SysSalesShippingInformDetail>> selectShippingInformDetailListByCodes(List<String> collectOutOrderCodes) {
List<SysSalesShippingInformDetail> details = sysSalesShippingInformDetailMapper.selectSalesShippingInformDetailListByCodes(collectOutOrderCodes);
Map<String, List<SysSalesShippingInformDetail>> result = details.stream().collect(Collectors.groupingBy(SysSalesShippingInformDetail::getOutOrderCode));
return result;
}
/**
* 新增销售出货通知详情
*

8
ruoyi-admin/src/main/resources/mapper/system/SysSalesShippingInformDetailMapper.xml

@ -51,6 +51,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where out_order_code = #{outOrderCode}
</select>
<select id="selectSalesShippingInformDetailListByCodes" parameterType="String" resultMap="SysSalesShippingInformDetailResult">
<include refid="selectSysSalesShippingInformDetailVo"/>
where out_order_code in
<foreach collection="list" item="outOrderCode" open="(" separator="," close=")">
#{outOrderCode}
</foreach>
</select>
<insert id="insertSysSalesShippingInformDetail" parameterType="SysSalesShippingInformDetail" useGeneratedKeys="true" keyProperty="shippingInformDetailId">
insert into sys_sales_shipping_inform_detail

56
ruoyi-admin/src/main/resources/templates/system/salesShippingInform/salesShippingInform.html

@ -49,32 +49,38 @@
<a class="btn btn-warning" onclick="exportExcel()" shiro:hasPermission="system:salesShippingInform:export">
<i class="fa fa-download"></i> 导出
</a>
<a class="btn btn-warning" onclick="exportShippingOrderOne()" shiro:hasPermission="system:salesShippingInform:exportShippingOrderOne">
<i class="fa fa-download"></i> 导出销售出货单1
</a>
<a class="btn btn-warning" onclick="exportShippingOrderTwo()" shiro:hasPermission="system:salesShippingInform:exportShippingOrderTwo">
<i class="fa fa-download"></i> 导出销售出货单2
</a>
<a class="btn btn-warning" onclick="exportShippingPackingOne()" shiro:hasPermission="system:salesShippingInform:exportShippingPackingOne">
<i class="fa fa-download"></i> 导出销售出货箱单1
</a>
<a class="btn btn-warning" onclick="exportShippingPackingTwo()" shiro:hasPermission="system:salesShippingInform:exportShippingPackingTwo">
<i class="fa fa-download"></i> 导出销售出货箱单2
</a>
<a class="btn btn-warning" onclick="exportShippingInvoiceOne()" shiro:hasPermission="system:salesShippingInform:exportShippingInvoiceOne">
<i class="fa fa-download"></i> 导出销售出货发票1
</a>
<a class="btn btn-warning" onclick="exportShippingInvoiceTwo()" shiro:hasPermission="system:salesShippingInform:exportShippingInvoiceTwo">
<i class="fa fa-download"></i> 导出销售出货发票2
</a>
<a class="btn btn-warning" onclick="exportShippingInformOrder()" shiro:hasPermission="system:salesShippingInform:exportShippingInformOrder">
<i class="fa fa-download"></i> 导出销售出货通知单
</a>
<!-- <div class="dropdown">-->
<a class="btn btn-warning" id="dropdownMenu2" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<i class="fa fa-download"></i> 模板导出
</a>
<div class="dropdown-menu" aria-labelledby="dropdownMenu2">
<a class="btn btn-warning" onclick="exportShippingOrderOne()" shiro:hasPermission="system:salesShippingInform:exportShippingOrderOne">
<i class="fa fa-download"></i> 导出销售出货单1
</a>
<a class="btn btn-warning" onclick="exportShippingOrderTwo()" shiro:hasPermission="system:salesShippingInform:exportShippingOrderTwo">
<i class="fa fa-download"></i> 导出销售出货单2
</a>
<a class="btn btn-warning" onclick="exportShippingPackingOne()" shiro:hasPermission="system:salesShippingInform:exportShippingPackingOne">
<i class="fa fa-download"></i> 导出销售出货箱单1
</a>
<a class="btn btn-warning" onclick="exportShippingPackingTwo()" shiro:hasPermission="system:salesShippingInform:exportShippingPackingTwo">
<i class="fa fa-download"></i> 导出销售出货箱单2
</a>
<a class="btn btn-warning" onclick="exportShippingInvoiceOne()" shiro:hasPermission="system:salesShippingInform:exportShippingInvoiceOne">
<i class="fa fa-download"></i> 导出销售出货发票1
</a>
<a class="btn btn-warning" onclick="exportShippingInvoiceTwo()" shiro:hasPermission="system:salesShippingInform:exportShippingInvoiceTwo">
<i class="fa fa-download"></i> 导出销售出货发票2
</a>
<a class="btn btn-warning" onclick="exportShippingInformOrder()" shiro:hasPermission="system:salesShippingInform:exportShippingInformOrder">
<i class="fa fa-download"></i> 导出销售出货通知单
</a>
</div>
<!-- </div>-->
</div>
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table"></table>

Loading…
Cancel
Save