Browse Source

Merge remote-tracking branch 'origin/dev' into dev

dev
zhangsiqi 3 months ago
parent
commit
cc6d8a63dd
  1. 11
      ruoyi-admin/src/main/java/com/ruoyi/sales/controller/SalesShippingInformationController.java
  2. 42
      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. 43
      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.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
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 org.springframework.web.bind.annotation.*;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.sales.domain.SalesShippingInformation;
@ -61,13 +57,14 @@ public class SalesShippingInformationController extends BaseController
@Log(title = "销售出货资料", businessType = BusinessType.EXPORT)
@PostMapping("/export")
@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);
return util.exportExcel(list, "销售出货资料数据");
}
/**
* 新增销售出货资料
*/

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

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

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

@ -74,4 +74,9 @@ public interface SalesShippingInformationMapper
* @return 结果
*/
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
*/
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);
}
/**
* 通过出货资料单号数组查询销售出货资料集合
* */
@Override
public List<SalesShippingInformation> selectShippingInformationListByCodes(String[] shippingInformationCodes) {
return salesShippingInformationMapper.selectShippingInformationListByCodes(shippingInformationCodes);
}
/**
* 新增销售出货资料
*

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

@ -414,9 +414,9 @@ public class SysSalesShippingInformServiceImpl implements ISysSalesShippingInfor
//销售出货单
String shippingInformationType = "2";
String shippingTemplateType = "销售出货单1";
//生成出货资料
insertShippingInformation(outOrderCode,shippingInformationType,salesShippingInform);
insertShippingInformation(outOrderCode,shippingInformationType,shippingTemplateType,salesShippingInform);
List<SysSalesShippingInformDetail> salesShippingInformDetails = shippingInformDetailMapper.selectSysSalesShippingInformDetailByCode(outOrderCode);
@ -498,9 +498,9 @@ public class SysSalesShippingInformServiceImpl implements ISysSalesShippingInfor
//销售出货单
String shippingInformationType = "2";
String shippingTemplateType = "销售出货单2";
//生成出货资料
insertShippingInformation(outOrderCode,shippingInformationType,salesShippingInform);
insertShippingInformation(outOrderCode,shippingInformationType,shippingTemplateType,salesShippingInform);
List<SysSalesShippingInformDetail> salesShippingInformDetails = shippingInformDetailMapper.selectSysSalesShippingInformDetailByCode(outOrderCode);
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
@ -575,8 +575,9 @@ public class SysSalesShippingInformServiceImpl implements ISysSalesShippingInfor
SysSalesShippingInform sysSalesShippingInform = sysSalesShippingInformMapper.selectSysSalesShippingInformByCode(outOrderCode);
String shippingInformationType = "0";
String shippingTemplateType = "销售出货箱单1";
//生成出货资料
insertShippingInformation(outOrderCode,shippingInformationType,sysSalesShippingInform);
insertShippingInformation(outOrderCode,shippingInformationType,shippingTemplateType,sysSalesShippingInform);
String salesOrderCode = sysSalesShippingInform.getSalesOrderCode();
String realFileName = salesOrderCode + "-" + fileName.substring(0, fileName.lastIndexOf(".")) + ".xlsx";
@ -650,8 +651,9 @@ public class SysSalesShippingInformServiceImpl implements ISysSalesShippingInfor
SysSalesShippingInform sysSalesShippingInform = sysSalesShippingInformMapper.selectSysSalesShippingInformByCode(outOrderCode);
String shippingInformationType = "0";
String shippingTemplateType = "销售出货箱单2";
//生成出货资料
insertShippingInformation(outOrderCode,shippingInformationType,sysSalesShippingInform);
insertShippingInformation(outOrderCode,shippingInformationType,shippingTemplateType,sysSalesShippingInform);
String salesOrderCode = sysSalesShippingInform.getSalesOrderCode();
if (StringUtils.isEmpty(salesOrderCode)){
@ -733,6 +735,11 @@ public class SysSalesShippingInformServiceImpl implements ISysSalesShippingInfor
SysSalesShippingInform sysSalesShippingInform = sysSalesShippingInformMapper.selectSysSalesShippingInformByCode(outOrderCode);
String shippingInformationType = "1";
String shippingTemplateType = "销售出货发票1";
//生成出货资料
insertShippingInformation(outOrderCode,shippingInformationType,shippingTemplateType,sysSalesShippingInform);
String salesOrderCode = sysSalesShippingInform.getSalesOrderCode();
SysMakeOrder sysMakeOrder = sysMakeOrderMapper.selectMakeOrderBySaleNo(salesOrderCode);
@ -815,6 +822,12 @@ public class SysSalesShippingInformServiceImpl implements ISysSalesShippingInfor
SysSalesShippingInform sysSalesShippingInform = sysSalesShippingInformMapper.selectSysSalesShippingInformByCode(outOrderCode);
String shippingInformationType = "1";
String shippingTemplateType = "销售出货发票2";
//生成出货资料
insertShippingInformation(outOrderCode,shippingInformationType,shippingTemplateType,sysSalesShippingInform);
String salesOrderCode = sysSalesShippingInform.getSalesOrderCode();
SysMakeOrder sysMakeOrder = sysMakeOrderMapper.selectMakeOrderBySaleNo(salesOrderCode);
@ -884,8 +897,18 @@ public class SysSalesShippingInformServiceImpl implements ISysSalesShippingInfor
FileDownloadUtils fileDownloadUtils = new FileDownloadUtils();
try {
String fileRelativePath = fileDownloadUtils.getFileRelativePath(fileName);
if (StringUtils.isEmpty(outOrderCode)){
log.warn("出货单号为空,请检查:{}", outOrderCode);
throw new RuntimeException("出货单号为空,请检查");
}
SysSalesShippingInform sysSalesShippingInform = sysSalesShippingInformMapper.selectSysSalesShippingInformByCode(outOrderCode);
String shippingInformationType = "3";
String shippingTemplateType = "出货通知单";
//生成出货资料
insertShippingInformation(outOrderCode,shippingInformationType,shippingTemplateType,sysSalesShippingInform);
String salesOrderCode = sysSalesShippingInform.getSalesOrderCode();
SysMakeOrder sysMakeOrder = sysMakeOrderMapper.selectMakeOrderBySaleNo(salesOrderCode);
@ -935,20 +958,20 @@ public class SysSalesShippingInformServiceImpl implements ISysSalesShippingInfor
private void insertShippingInformation(String outOrderCode, String shippingInformationType, SysSalesShippingInform salesShippingInform) {
private void insertShippingInformation(String outOrderCode, String shippingInformationType, String shippingTemplateType, SysSalesShippingInform salesShippingInform) {
String loginName = ShiroUtils.getLoginName();
SalesShippingInformation shippingInformation = new SalesShippingInformation();
shippingInformation.setOutOrderCode(outOrderCode);
shippingInformation.setSalesOrderCode(salesShippingInform.getSalesOrderCode());
shippingInformation.setShippingInformationType(shippingInformationType);
shippingInformation.setShippingInformationCode(redisCache.generateBillNo("CHZL"));
shippingInformation.setShippingTemplateType("1");
shippingInformation.setShippingTemplateType(shippingTemplateType);
shippingInformation.setCreateBy(loginName);
shippingInformation.setCreateTime(new Date());
shippingInformation.setBusinessMembers(salesShippingInform.getBusinessMembers());
shippingInformation.setCustomerId(salesShippingInform.getCustomerId());
shippingInformation.setAcceptanceTime(salesShippingInform.getAcceptanceTime());
shippingInformation.setAllPriceExcludingTaxRmb(salesShippingInform.getAllPriceExcludingTaxRmb());
shippingInformation.setAllPriceExcludingTaxDollar(salesShippingInform.getAllPriceExcludingTaxDollar());
@ -967,6 +990,8 @@ public class SysSalesShippingInformServiceImpl implements ISysSalesShippingInfor
shippingInformation.setRemark(salesShippingInform.getRemark());
shippingInformation.setWarehouseOutType(salesShippingInform.getWarehouseOutType());
shippingInformation.setWarehouseOrderType(salesShippingInform.getWarehouseOrderType());
shippingInformation.setEnterpriseSum(salesShippingInform.getEnterpriseSum());
shippingInformation.setMaterialSum(salesShippingInform.getMaterialSum());
int result = salesShippingInformationMapper.insertSalesShippingInformation(shippingInformation);
if (result<=0){
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}
</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 into sales_shipping_information
<trim prefix="(" suffix=")" suffixOverrides=",">

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

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

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

@ -63,12 +63,12 @@
</div>
<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> 导出
</a>
</div>
<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>
@ -213,10 +213,6 @@
title: '收货地址(Bill to)',
field: 'contactAddressBillto',
},
{
title: '备注',
field: 'remarks',
},
{
title: '录入时间',
field: 'createTime',
@ -236,6 +232,61 @@
};
$.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>
</body>
</html>
Loading…
Cancel
Save