Browse Source

[fix] 销售管理

修改导出销售出货模板2接口:新增导出销售出货模板一的同时,新增销售出货资料信息
提炼生成出货资料方法为公共方法,新增出货资料类型字段,根据不同的导出模板设置不同的值
dev
liuxiaoxu 3 weeks ago
parent
commit
2c0ef1be03
  1. 93
      ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSalesShippingInformServiceImpl.java

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

@ -400,16 +400,21 @@ public class SysSalesShippingInformServiceImpl implements ISysSalesShippingInfor
String fileName = "销售出货单1.xlsx";
FileDownloadUtils fileDownloadUtils = new FileDownloadUtils();
String loginName = ShiroUtils.getLoginName();
try {
String fileAbsolutePath = fileDownloadUtils.getFileRelativePath(fileName);
SysSalesShippingInform salesShippingInform = sysSalesShippingInformMapper.selectSysSalesShippingInformByCode(outOrderCode);
if (StringUtils.isEmpty(outOrderCode)){
log.warn("出库单号为空:{}",outOrderCode);
throw new RuntimeException("出库单号为空,请检查");
}
//销售出货单
String shippingInformationType = "2";
//生成出货资料
insertShippingInformation(outOrderCode, loginName, salesShippingInform);
insertShippingInformation(outOrderCode,shippingInformationType,salesShippingInform);
List<SysSalesShippingInformDetail> salesShippingInformDetails = shippingInformDetailMapper.selectSysSalesShippingInformDetailByCode(outOrderCode);
@ -467,49 +472,13 @@ public class SysSalesShippingInformServiceImpl implements ISysSalesShippingInfor
}
private void insertShippingInformation(String outOrderCode, String loginName, SysSalesShippingInform salesShippingInform) {
SalesShippingInformation shippingInformation = new SalesShippingInformation();
shippingInformation.setOutOrderCode(outOrderCode);
shippingInformation.setSalesOrderCode(salesShippingInform.getSalesOrderCode());
//销售出货单
shippingInformation.setShippingInformationType("2");
shippingInformation.setShippingInformationCode(redisCache.generateBillNo("CHZL"));
shippingInformation.setShippingTemplateType("1");
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());
shippingInformation.setAllPriceIncludesTax(salesShippingInform.getAllPriceIncludesTax());
shippingInformation.setCustomerName(salesShippingInform.getCustomerName());
shippingInformation.setCustomerContact(salesShippingInform.getCustomerContact());
shippingInformation.setCustomerContactAddress(salesShippingInform.getCustomerContactAddress());
shippingInformation.setCustomerContactBillto(salesShippingInform.getCustomerContactBillto());
shippingInformation.setContactNumber(salesShippingInform.getContactNumber());
shippingInformation.setContactNumberBillto(salesShippingInform.getContactNumberBillto());
shippingInformation.setContactAddressBillto(salesShippingInform.getContactAddressBillto());
shippingInformation.setDeliveryCondition(salesShippingInform.getDeliveryCondition());
shippingInformation.setDeliverTime(salesShippingInform.getDeliverTime());
shippingInformation.setPaymentCondition(salesShippingInform.getPaymentCondition());
shippingInformation.setPlannedDeliveryTime(salesShippingInform.getPlannedDeliveryTime());
shippingInformation.setRemark(salesShippingInform.getRemark());
shippingInformation.setWarehouseOutType(salesShippingInform.getWarehouseOutType());
shippingInformation.setWarehouseOrderType(salesShippingInform.getWarehouseOrderType());
int result = salesShippingInformationMapper.insertSalesShippingInformation(shippingInformation);
if (result<=0){
throw new BusinessException("插入销售出货资料单失败");
}
}
/**
* 导出出货单2模板
* */
@Override
public void exportShippingOrderTwo(String outOrderCode, HttpServletResponse response) {
String fileName = "销售出货单2.xlsx";
FileDownloadUtils fileDownloadUtils = new FileDownloadUtils();
@ -523,6 +492,12 @@ public class SysSalesShippingInformServiceImpl implements ISysSalesShippingInfor
throw new RuntimeException("出库单号为空,请检查");
}
//销售出货单
String shippingInformationType = "2";
//生成出货资料
insertShippingInformation(outOrderCode,shippingInformationType,salesShippingInform);
List<SysSalesShippingInformDetail> salesShippingInformDetails = shippingInformDetailMapper.selectSysSalesShippingInformDetailByCode(outOrderCode);
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
String deliverTime = dateFormat.format(salesShippingInform.getDeliverTime());
@ -940,4 +915,44 @@ public class SysSalesShippingInformServiceImpl implements ISysSalesShippingInfor
}
}
private void insertShippingInformation(String outOrderCode, String shippingInformationType, 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.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());
shippingInformation.setAllPriceIncludesTax(salesShippingInform.getAllPriceIncludesTax());
shippingInformation.setCustomerName(salesShippingInform.getCustomerName());
shippingInformation.setCustomerContact(salesShippingInform.getCustomerContact());
shippingInformation.setCustomerContactAddress(salesShippingInform.getCustomerContactAddress());
shippingInformation.setCustomerContactBillto(salesShippingInform.getCustomerContactBillto());
shippingInformation.setContactNumber(salesShippingInform.getContactNumber());
shippingInformation.setContactNumberBillto(salesShippingInform.getContactNumberBillto());
shippingInformation.setContactAddressBillto(salesShippingInform.getContactAddressBillto());
shippingInformation.setDeliveryCondition(salesShippingInform.getDeliveryCondition());
shippingInformation.setDeliverTime(salesShippingInform.getDeliverTime());
shippingInformation.setPaymentCondition(salesShippingInform.getPaymentCondition());
shippingInformation.setPlannedDeliveryTime(salesShippingInform.getPlannedDeliveryTime());
shippingInformation.setRemark(salesShippingInform.getRemark());
shippingInformation.setWarehouseOutType(salesShippingInform.getWarehouseOutType());
shippingInformation.setWarehouseOrderType(salesShippingInform.getWarehouseOrderType());
int result = salesShippingInformationMapper.insertSalesShippingInformation(shippingInformation);
if (result<=0){
throw new BusinessException("插入销售出货资料单失败");
}
}
}

Loading…
Cancel
Save