Browse Source

[feat] 销售管理

去掉ry-ui.js对table的高度的统一调整
新增销售出货资料的列表数据导出后端接口
修改销售出货资料实体类中@Excel注解,正确使用不同类型的字段
新增 通过出货资料单号数组查询销售出货资料集合后端方法
新增导出前端js方法,实现可选择一条或者多条数据导出
dev
liuxiaoxu 3 months ago
parent
commit
97eaf1b708
  1. 11
      ruoyi-admin/src/main/java/com/ruoyi/sales/controller/SalesShippingInformationController.java
  2. 40
      ruoyi-admin/src/main/java/com/ruoyi/sales/domain/SalesShippingInformation.java
  3. 5
      ruoyi-admin/src/main/java/com/ruoyi/sales/mapper/SalesShippingInformationMapper.java
  4. 5
      ruoyi-admin/src/main/java/com/ruoyi/sales/service/ISalesShippingInformationService.java
  5. 10
      ruoyi-admin/src/main/java/com/ruoyi/sales/service/impl/SalesShippingInformationServiceImpl.java
  6. 3
      ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSalesShippingInformServiceImpl.java
  7. 8
      ruoyi-admin/src/main/resources/mapper/sales/SalesShippingInformationMapper.xml
  8. 2
      ruoyi-admin/src/main/resources/static/ruoyi/js/ry-ui.js
  9. 63
      ruoyi-admin/src/main/resources/templates/sales/salesShippingInformation/salesShippingInformation.html

11
ruoyi-admin/src/main/java/com/ruoyi/sales/controller/SalesShippingInformationController.java

@ -5,11 +5,7 @@ import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap; import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.ruoyi.common.annotation.Log; import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.enums.BusinessType; import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.sales.domain.SalesShippingInformation; import com.ruoyi.sales.domain.SalesShippingInformation;
@ -61,13 +57,14 @@ public class SalesShippingInformationController extends BaseController
@Log(title = "销售出货资料", businessType = BusinessType.EXPORT) @Log(title = "销售出货资料", businessType = BusinessType.EXPORT)
@PostMapping("/export") @PostMapping("/export")
@ResponseBody @ResponseBody
public AjaxResult export(SalesShippingInformation salesShippingInformation) public AjaxResult export(@RequestBody String[] shippingInformationCodes)
{ {
List<SalesShippingInformation> list = salesShippingInformationService.selectSalesShippingInformationList(salesShippingInformation); List<SalesShippingInformation> list = salesShippingInformationService.selectShippingInformationListByCodes(shippingInformationCodes);
ExcelUtil<SalesShippingInformation> util = new ExcelUtil<SalesShippingInformation>(SalesShippingInformation.class); ExcelUtil<SalesShippingInformation> util = new ExcelUtil<SalesShippingInformation>(SalesShippingInformation.class);
return util.exportExcel(list, "销售出货资料数据"); return util.exportExcel(list, "销售出货资料数据");
} }
/** /**
* 新增销售出货资料 * 新增销售出货资料
*/ */

40
ruoyi-admin/src/main/java/com/ruoyi/sales/domain/SalesShippingInformation.java

@ -34,7 +34,7 @@ public class SalesShippingInformation extends BaseEntity
private String outOrderCode; private String outOrderCode;
/** 出货资料类型(0出货箱单、1出货发票、2销售出货单、3出货通知单) */ /** 出货资料类型(0出货箱单、1出货发票、2销售出货单、3出货通知单) */
@Excel(name = "出货资料类型(0出货箱单、1出货发票、2销售出货单、3出货通知单)") @Excel(name = "出货资料类型",dictType = "shipping_information_type")
private String shippingInformationType; private String shippingInformationType;
/** 模板类型 */ /** 模板类型 */
@ -42,11 +42,11 @@ public class SalesShippingInformation extends BaseEntity
private String shippingTemplateType; private String shippingTemplateType;
/** 出库订单类型(0销售订单、1生产订单、2请购订单、3委外订单、4退换货订单、5开发修改单) */ /** 出库订单类型(0销售订单、1生产订单、2请购订单、3委外订单、4退换货订单、5开发修改单) */
@Excel(name = "出库订单类型", readConverterExp = "0=销售订单、1生产订单、2请购订单、3委外订单、4退换货订单、5开发修改单") @Excel(name = "出库订单类型", dictType = "warehouse_order_type")
private String warehouseOrderType; private String warehouseOrderType;
/** 出库类型(0销售出库、1生产领料、2员工领料、3委外领料、4公司退货、5工程领料) */ /** 出库类型(0销售出库、1生产领料、2员工领料、3委外领料、4公司退货、5工程领料) */
@Excel(name = "出库类型", readConverterExp = "0=销售出库、1生产领料、2员工领料、3委外领料、4公司退货、5工程领料") @Excel(name = "出库类型", dictType = "warehouse_out_type")
private String warehouseOutType; private String warehouseOutType;
/** 业务人员 */ /** 业务人员 */
@ -54,7 +54,7 @@ public class SalesShippingInformation extends BaseEntity
private String businessMembers; private String businessMembers;
/** 客户代码/id */ /** 客户代码/id */
@Excel(name = "客户代码/id") @Excel(name = "客户ID")
private String customerId; private String customerId;
/** 客户名称 */ /** 客户名称 */
@ -68,22 +68,22 @@ public class SalesShippingInformation extends BaseEntity
/** 物料合计 */ /** 物料合计 */
@Excel(name = "物料合计") @Excel(name = "物料合计")
private Long materialSum; private Integer materialSum;
/** 数量合计 */ /** 数量合计 */
@Excel(name = "数量合计") @Excel(name = "数量合计")
private Long enterpriseSum; private Integer enterpriseSum;
/** 不含税总价(RMB) */ /** 不含税总价(RMB) */
@Excel(name = "不含税总价", readConverterExp = "R=MB") @Excel(name = "不含税总价")
private BigDecimal allPriceExcludingTaxRmb; private BigDecimal allPriceExcludingTaxRmb;
/** 不含税总价(美元) */ /** 不含税总价(美元) */
@Excel(name = "不含税总价", readConverterExp = "美=元") @Excel(name = "不含税总价")
private BigDecimal allPriceExcludingTaxDollar; private BigDecimal allPriceExcludingTaxDollar;
/** 含税总价(RMB) */ /** 含税总价(RMB) */
@Excel(name = "含税总价", readConverterExp = "R=MB") @Excel(name = "含税总价")
private BigDecimal allPriceIncludesTax; private BigDecimal allPriceIncludesTax;
/** 计划交付时间 */ /** 计划交付时间 */
@ -134,7 +134,6 @@ public class SalesShippingInformation extends BaseEntity
private String contactAddressBillto; private String contactAddressBillto;
/** 备注 */ /** 备注 */
@Excel(name = "备注")
private String remarks; private String remarks;
public void setShippingInformationId(Long shippingInformationId) public void setShippingInformationId(Long shippingInformationId)
@ -246,24 +245,23 @@ public class SalesShippingInformation extends BaseEntity
return salesOrderNumber; return salesOrderNumber;
} }
public void setMaterialSum(Long materialSum)
{
this.materialSum = materialSum;
}
public Long getMaterialSum() public Integer getMaterialSum() {
{
return materialSum; return materialSum;
} }
public void setEnterpriseSum(Long enterpriseSum)
{ public void setMaterialSum(Integer materialSum) {
this.enterpriseSum = enterpriseSum; this.materialSum = materialSum;
} }
public Long getEnterpriseSum() public Integer getEnterpriseSum() {
{
return enterpriseSum; return enterpriseSum;
} }
public void setEnterpriseSum(Integer enterpriseSum) {
this.enterpriseSum = enterpriseSum;
}
public void setAllPriceExcludingTaxRmb(BigDecimal allPriceExcludingTaxRmb) public void setAllPriceExcludingTaxRmb(BigDecimal allPriceExcludingTaxRmb)
{ {
this.allPriceExcludingTaxRmb = allPriceExcludingTaxRmb; this.allPriceExcludingTaxRmb = allPriceExcludingTaxRmb;

5
ruoyi-admin/src/main/java/com/ruoyi/sales/mapper/SalesShippingInformationMapper.java

@ -74,4 +74,9 @@ public interface SalesShippingInformationMapper
* @return 结果 * @return 结果
*/ */
public int restoreSalesShippingInformationById(Long shippingInformationId); public int restoreSalesShippingInformationById(Long shippingInformationId);
/**
* 通过出货资料单号数组查询销售出货资料集合
* */
List<SalesShippingInformation> selectShippingInformationListByCodes(String[] shippingInformationCodes);
} }

5
ruoyi-admin/src/main/java/com/ruoyi/sales/service/ISalesShippingInformationService.java

@ -72,4 +72,9 @@ public interface ISalesShippingInformationService
* @return * @return
*/ */
int restoreSalesShippingInformationById(Long shippingInformationId); int restoreSalesShippingInformationById(Long shippingInformationId);
/**
* 通过出货资料单号数组查询销售出货资料集合
* */
List<SalesShippingInformation> selectShippingInformationListByCodes(String[] shippingInformationCodes);
} }

10
ruoyi-admin/src/main/java/com/ruoyi/sales/service/impl/SalesShippingInformationServiceImpl.java

@ -46,6 +46,16 @@ public class SalesShippingInformationServiceImpl implements ISalesShippingInform
return salesShippingInformationMapper.selectSalesShippingInformationList(salesShippingInformation); return salesShippingInformationMapper.selectSalesShippingInformationList(salesShippingInformation);
} }
/**
* 通过出货资料单号数组查询销售出货资料集合
* */
@Override
public List<SalesShippingInformation> selectShippingInformationListByCodes(String[] shippingInformationCodes) {
return salesShippingInformationMapper.selectShippingInformationListByCodes(shippingInformationCodes);
}
/** /**
* 新增销售出货资料 * 新增销售出货资料
* *

3
ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSalesShippingInformServiceImpl.java

@ -972,7 +972,6 @@ public class SysSalesShippingInformServiceImpl implements ISysSalesShippingInfor
shippingInformation.setCreateTime(new Date()); shippingInformation.setCreateTime(new Date());
shippingInformation.setBusinessMembers(salesShippingInform.getBusinessMembers()); shippingInformation.setBusinessMembers(salesShippingInform.getBusinessMembers());
shippingInformation.setCustomerId(salesShippingInform.getCustomerId()); shippingInformation.setCustomerId(salesShippingInform.getCustomerId());
shippingInformation.setAcceptanceTime(salesShippingInform.getAcceptanceTime()); shippingInformation.setAcceptanceTime(salesShippingInform.getAcceptanceTime());
shippingInformation.setAllPriceExcludingTaxRmb(salesShippingInform.getAllPriceExcludingTaxRmb()); shippingInformation.setAllPriceExcludingTaxRmb(salesShippingInform.getAllPriceExcludingTaxRmb());
shippingInformation.setAllPriceExcludingTaxDollar(salesShippingInform.getAllPriceExcludingTaxDollar()); shippingInformation.setAllPriceExcludingTaxDollar(salesShippingInform.getAllPriceExcludingTaxDollar());
@ -991,6 +990,8 @@ public class SysSalesShippingInformServiceImpl implements ISysSalesShippingInfor
shippingInformation.setRemark(salesShippingInform.getRemark()); shippingInformation.setRemark(salesShippingInform.getRemark());
shippingInformation.setWarehouseOutType(salesShippingInform.getWarehouseOutType()); shippingInformation.setWarehouseOutType(salesShippingInform.getWarehouseOutType());
shippingInformation.setWarehouseOrderType(salesShippingInform.getWarehouseOrderType()); shippingInformation.setWarehouseOrderType(salesShippingInform.getWarehouseOrderType());
shippingInformation.setEnterpriseSum(salesShippingInform.getEnterpriseSum());
shippingInformation.setMaterialSum(salesShippingInform.getMaterialSum());
int result = salesShippingInformationMapper.insertSalesShippingInformation(shippingInformation); int result = salesShippingInformationMapper.insertSalesShippingInformation(shippingInformation);
if (result<=0){ if (result<=0){
throw new BusinessException("插入销售出货资料单失败"); throw new BusinessException("插入销售出货资料单失败");

8
ruoyi-admin/src/main/resources/mapper/sales/SalesShippingInformationMapper.xml

@ -63,6 +63,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where shipping_information_id = #{shippingInformationId} where shipping_information_id = #{shippingInformationId}
</select> </select>
<select id="selectShippingInformationListByCodes" parameterType="String" resultMap="SalesShippingInformationResult">
<include refid="selectSalesShippingInformationVo"/>
where shipping_information_code in
<foreach item="item" collection="array" separator="," open="(" close=")">
#{item}
</foreach>
</select>
<insert id="insertSalesShippingInformation" parameterType="SalesShippingInformation" useGeneratedKeys="true" keyProperty="shippingInformationId"> <insert id="insertSalesShippingInformation" parameterType="SalesShippingInformation" useGeneratedKeys="true" keyProperty="shippingInformationId">
insert into sales_shipping_information insert into sales_shipping_information
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">

2
ruoyi-admin/src/main/resources/static/ruoyi/js/ry-ui.js

@ -71,7 +71,7 @@ var table = {
rightFixedColumns: false, rightFixedColumns: false,
fixedRightNumber: 0, fixedRightNumber: 0,
queryParams: $.table.queryParams, queryParams: $.table.queryParams,
height: $(window).height() - 100, // height: $(window).height() - 100,
rowStyle: {}, rowStyle: {},
}; };
var options = $.extend(defaults, options); var options = $.extend(defaults, options);

63
ruoyi-admin/src/main/resources/templates/sales/salesShippingInformation/salesShippingInformation.html

@ -63,12 +63,12 @@
</div> </div>
<div class="btn-group-sm" id="toolbar" role="group"> <div class="btn-group-sm" id="toolbar" role="group">
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="sales:salesShippingInformation:export"> <a class="btn btn-warning" onclick="exportExcel()" shiro:hasPermission="sales:salesShippingInformation:export">
<i class="fa fa-download"></i> 导出 <i class="fa fa-download"></i> 导出
</a> </a>
</div> </div>
<div class="col-sm-12 select-table table-striped"> <div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table"></table> <table id="bootstrap-table" style="white-space:nowrap"></table>
</div> </div>
</div> </div>
</div> </div>
@ -213,10 +213,6 @@
title: '收货地址(Bill to)', title: '收货地址(Bill to)',
field: 'contactAddressBillto', field: 'contactAddressBillto',
}, },
{
title: '备注',
field: 'remarks',
},
{ {
title: '录入时间', title: '录入时间',
field: 'createTime', field: 'createTime',
@ -236,6 +232,61 @@
}; };
$.table.init(options); $.table.init(options);
}); });
// 导出
function exportExcel(formId) {
// $.table.set();
var shippingInformationCodeData = [];
var selections = $("#bootstrap-table").bootstrapTable("getSelections");
if(selections.length === 0){
$.modal.confirm("确定导出所有出货出货资料吗?", function() {
var currentId = $.common.isEmpty(formId) ? $('form').attr('id') : formId;
var params = $("#bootstrap-table").bootstrapTable('getOptions');
var dataParam = $("#" + currentId).serializeArray();
dataParam.push({ "name": "orderByColumn", "value": params.sortName });
dataParam.push({ "name": "isAsc", "value": params.sortOrder });
$.modal.loading("正在导出数据,请稍后...");
$.post(prefix + '/exportAll', dataParam, function(result) {
if (result.code == web_status.SUCCESS) {
window.location.href = ctx + "common/download?fileName=" + encodeURI(result.msg) + "&delete=" + true;
} else if (result.code == web_status.WARNING) {
$.modal.alertWarning(result.msg)
} else {
$.modal.alertError(result.msg);
}
$.modal.closeLoading();
});
});
}else {
$.modal.confirm("确定导出选中的所有出货资料吗?", function () {
//·拼接单号
for(let i=0;i<selections.length;i++){
shippingInformationCodeData.push(selections[i].shippingInformationCode);
}
var shippingInformationCodes = JSON.stringify(shippingInformationCodeData);
// console.log(bomNos);
$.modal.loading("正在导出数据,请稍后...");
var config = {
url: prefix + '/export',
type: "post",
dataType: "json",
contentType: "application/json;charset=utf-8",
data: shippingInformationCodes,
success: function(result) {
window.location.href = ctx + "common/download?fileName=" + encodeURI(result.msg) + "&delete=" + true;
$.modal.alertSuccess("导出成功!")
$.modal.closeLoading();
},
error: function (result){
$.modal.alertError(result.msg);
}
};
$.ajax(config)
});
}
};
</script> </script>
</body> </body>
</html> </html>
Loading…
Cancel
Save