Browse Source

[feat] 销售管理

按照新版prd实现:
销售出货单前端:
新增销售出货列表页面
新增销售出货单详情页面
新增销售出货单添加页面
新增 补充单据前端页面

销售出货单后端;
新增查询出货单列表接口
新增 导出销售出货单列表shippingInfinity接口
新增 导出销售出货单列表shippingVantritek接口
新增 新增销售出货单接口
新增 新增保存销售出货单接口
新增 打开出货单详情接口
新增 修改保存销售出货单详情接口
新增 查询出货单详情物料接口
新增 获取销售订单号下拉列表接口
新增 打开出货单补充单据接口
新增 修改保存销售出货单补充单据接口
修改销售出货通知后端 导出销售出货单的2个接口,修改实体类的赋值

新增通用工具类数字转成中文大写NumberChineseFormatterUtils
dev
liuxiaoxu 2 months ago
parent
commit
2862682001
  1. 171
      ruoyi-admin/src/main/java/com/ruoyi/sales/controller/SalesShippingInformationShippingController.java
  2. 5
      ruoyi-admin/src/main/java/com/ruoyi/sales/mapper/SalesShippingInformationMapper.java
  3. 25
      ruoyi-admin/src/main/java/com/ruoyi/sales/service/ISalesShippingInformationService.java
  4. 247
      ruoyi-admin/src/main/java/com/ruoyi/sales/service/impl/SalesShippingInformationServiceImpl.java
  5. 14
      ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSalesShippingInformServiceImpl.java
  6. 19
      ruoyi-admin/src/main/resources/mapper/sales/SalesShippingInformationMapper.xml
  7. 182
      ruoyi-admin/src/main/resources/templates/sales/salesShippingInformationShipping/add.html
  8. 200
      ruoyi-admin/src/main/resources/templates/sales/salesShippingInformationShipping/salesShippingInformationShipping.html
  9. 186
      ruoyi-admin/src/main/resources/templates/sales/salesShippingInformationShipping/shippingDetail.html
  10. 237
      ruoyi-admin/src/main/resources/templates/sales/salesShippingInformationShipping/supplementDocument.html
  11. 35
      ruoyi-common/src/main/java/com/ruoyi/common/utils/NumberChineseFormatterUtils.java

171
ruoyi-admin/src/main/java/com/ruoyi/sales/controller/SalesShippingInformationShippingController.java

@ -0,0 +1,171 @@
package com.ruoyi.sales.controller;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.sales.domain.SalesShippingInformation;
import com.ruoyi.sales.domain.SalesShippingInformationDetail;
import com.ruoyi.sales.service.ISalesShippingInformationService;
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.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* 销售出货资料出货单
* */
@Controller
@RequestMapping("/sales/salesShippingInformationShipping")
public class SalesShippingInformationShippingController extends BaseController {
@Autowired
private ISalesShippingInformationService shippingInformationService;
private String prefix = "sales/salesShippingInformationShipping";
@RequiresPermissions("sales:salesShippingInformationShipping:view")
@GetMapping()
public String salesShippingInformationShipping()
{
return prefix + "/salesShippingInformationShipping";
}
/**
* 查询出货单列表
*/
@RequiresPermissions("sales:salesShippingInformationShipping:list")
@PostMapping("/list")
@ResponseBody
public TableDataInfo list(SalesShippingInformation salesShippingInformation)
{
startPage();
List<SalesShippingInformation> list = shippingInformationService.selectSalesShippingInformationShippingList(salesShippingInformation);
return getDataTable(list);
}
/**
* 导出销售出货单列表ShippingInfinity
*/
@RequiresPermissions("sales:salesShippingInformationShipping:export")
@Log(title = "销售出货单", businessType = BusinessType.EXPORT)
@GetMapping("/exportShippingInfinity/{shippingInformationCode}")
public void exportShippingInfinity(@PathVariable("shippingInformationCode") String shippingInformationCode, HttpServletResponse response) {
shippingInformationService.exportShippingInfinity(shippingInformationCode, response);
}
/**
* 导出销售出货单列表ShippingVantritek
*/
@RequiresPermissions("sales:salesShippingInformationShipping:export")
@Log(title = "销售出货单", businessType = BusinessType.EXPORT)
@GetMapping("/exportShippingVantritek/{shippingInformationCode}")
public void exportShippingVantritek(@PathVariable("shippingInformationCode") String shippingInformationCode, HttpServletResponse response) {
shippingInformationService.exportShippingVantritek(shippingInformationCode, response);
}
/**
* 新增销售出货单
*/
@GetMapping("/add")
public String add()
{
return prefix + "/add";
}
/**
* 新增保存销售出货单
*/
@RequiresPermissions("sales:salesShippingInformationShipping:add")
@Log(title = "销售出货单", businessType = BusinessType.INSERT)
@PostMapping("/add")
@ResponseBody
public AjaxResult addSave(SalesShippingInformation salesShippingInformation)
{
return toAjax(shippingInformationService.insertSalesShippingInformationShipping(salesShippingInformation));
}
/**
* 打开出货单详情
*/
@GetMapping("/shippingDetail/{shippingInformationId}")
public String shippingDetail(@PathVariable("shippingInformationId") Long shippingInformationId, ModelMap mmap)
{
SalesShippingInformation salesShippingInformation = shippingInformationService.selectSalesShippingInformationById(shippingInformationId);
mmap.put("salesShippingInformation", salesShippingInformation);
return prefix + "/shippingDetail";
}
/**
* 修改保存销售出货单详情
*/
@Log(title = "销售出货单", businessType = BusinessType.UPDATE)
@PostMapping("/shippingDetail")
@ResponseBody
public AjaxResult shippingDetailSave(SalesShippingInformation salesShippingInformation)
{
return toAjax(shippingInformationService.updateShippingInformationDetail(salesShippingInformation));
}
/**
* 查询出货单详情物料
*/
@PostMapping("/getShippingDetailList")
@ResponseBody
public TableDataInfo getShippingDetailList(SalesShippingInformation salesShippingInformation)
{
startPage();
List<SalesShippingInformationDetail> list = shippingInformationService.selectShippingInformationDetailList(salesShippingInformation);
return getDataTable(list);
}
/**
* 打开出货单补充单据
*/
@GetMapping("/supplementDocument/{shippingInformationId}")
public String supplementDocument(@PathVariable("shippingInformationId") Long shippingInformationId, ModelMap mmap)
{
SalesShippingInformation salesShippingInformation = shippingInformationService.selectSalesShippingInformationById(shippingInformationId);
mmap.put("salesShippingInformation", salesShippingInformation);
return prefix + "/supplementDocument";
}
/**
* 修改保存销售出货单补充单据
*/
@RequiresPermissions("sales:salesShippingInformationShipping:supplementDocument")
@Log(title = "销售出货单", businessType = BusinessType.UPDATE)
@PostMapping("/supplementDocument")
@ResponseBody
public AjaxResult supplementDocumentSave(@RequestBody SalesShippingInformation salesShippingInformation)
{
return toAjax(shippingInformationService.updateShippingSupplementDocument(salesShippingInformation));
}
/**
* 获取销售订单号下拉列表
* */
@RequestMapping("/getSalesOrderCodeSelectList")
@ResponseBody
public AjaxResult getSalesOrderCodeSelectList(@RequestParam(value = "q",defaultValue = "") String prefix){
if (prefix == null || prefix.isEmpty()){
return success(shippingInformationService.getSalesOrderCodeSelectList());
}
return success(shippingInformationService.searchSalesOrderCodeByPrefix(prefix));
}
}

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

@ -90,4 +90,9 @@ public interface SalesShippingInformationMapper
* 查询销售出货箱单列表
* */
List<SalesShippingInformation> selectSalesShippingInformationPackingList(SalesShippingInformation salesShippingInformation);
/**
* 查找销售出货单数据集合
* */
List<SalesShippingInformation> selectSalesShippingInformationShippingList(SalesShippingInformation salesShippingInformation);
}

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

@ -143,4 +143,29 @@ public interface ISalesShippingInformationService
* 出货箱单补充单据
* */
int updatePackingSupplementDocument(SalesShippingInformation salesShippingInformation);
/**
* 查找销售出货单数据集合
* */
List<SalesShippingInformation> selectSalesShippingInformationShippingList(SalesShippingInformation salesShippingInformation);
/**
* 导出销售出货单Infinity
* */
void exportShippingInfinity(String shippingInformationCode, HttpServletResponse response);
/**
* 导出销售出货单Vantritek
* */
void exportShippingVantritek(String shippingInformationCode, HttpServletResponse response);
/**
* 插入销售出货单数据
* */
int insertSalesShippingInformationShipping(SalesShippingInformation salesShippingInformation);
/**
* 出货单补充单据
* */
int updateShippingSupplementDocument(SalesShippingInformation salesShippingInformation);
}

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

@ -3,6 +3,7 @@ package com.ruoyi.sales.service.impl;
import java.io.IOException;
import java.math.BigDecimal;
import java.net.URLEncoder;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.concurrent.atomic.AtomicInteger;
@ -12,14 +13,13 @@ import com.alibaba.excel.write.metadata.WriteSheet;
import com.alibaba.excel.write.metadata.fill.FillConfig;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.exception.BusinessException;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.ShiroUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.*;
import com.ruoyi.common.utils.file.FileDownloadUtils;
import com.ruoyi.sales.domain.SalesShippingInformationDetail;
import com.ruoyi.sales.mapper.SalesShippingInformationDetailMapper;
import com.ruoyi.system.domain.*;
import com.ruoyi.system.dto.ExportShippingInvoiceDto;
import com.ruoyi.system.dto.ExportShippingOrderDto;
import com.ruoyi.system.dto.ExportShippingPackingDto;
import com.ruoyi.system.mapper.SysMakeOrderMapper;
import com.ruoyi.system.mapper.SysSalesOrderChildMapper;
@ -227,6 +227,16 @@ public class SalesShippingInformationServiceImpl implements ISalesShippingInform
return list;
}
/**
* 查找销售出货单数据集合
* */
@Override
public List<SalesShippingInformation> selectSalesShippingInformationShippingList(SalesShippingInformation salesShippingInformation) {
List<SalesShippingInformation> list = salesShippingInformationMapper.selectSalesShippingInformationShippingList(salesShippingInformation);
return list;
}
/**
* 插入销售出货发票数据
* */
@ -356,7 +366,7 @@ public class SalesShippingInformationServiceImpl implements ISalesShippingInform
}
int insertDetailResult = salesShippingInformationDetailMapper.insertBatchSalesShippingInformationDetail(salesShippingInformationDetails);
if (insertDetailResult <= 0){
throw new BusinessException("新增销售出货发票明细失败!");
throw new BusinessException("新增销售出货箱单明细失败!");
}
}
salesShippingInformation.setShippingInformationCode(shippingInformationCode);
@ -369,6 +379,77 @@ public class SalesShippingInformationServiceImpl implements ISalesShippingInform
}
/**
* 插入销售出货单数据
* */
@Transactional(rollbackFor = Exception.class)
@Override
public int insertSalesShippingInformationShipping(SalesShippingInformation salesShippingInformation) {
String loginName = ShiroUtils.getLoginName();
String salesOrderCode = salesShippingInformation.getSalesOrderCode();
SysMakeOrder sysMakeOrder = sysMakeOrderMapper.selectMakeOrderBySaleNo(salesOrderCode);
String shippingInformationCode = redisCache.generateBillNo("CHZL");
String shippingCode = redisCache.generateBillNo("SHD");
List<SysSalesOrderChild> sysSalesOrderChildren = sysSalesOrderChildMapper.selectOrderChildListBySalesOrderCode(salesOrderCode);
List<SalesShippingInformationDetail> salesShippingInformationDetails = new ArrayList<>();
if (!CollectionUtils.isEmpty(sysSalesOrderChildren)){
for (SysSalesOrderChild sysSalesOrderChild : sysSalesOrderChildren) {
SalesShippingInformationDetail salesShippingInformationDetail = new SalesShippingInformationDetail();
salesShippingInformationDetail.setShippingInformationCode(shippingInformationCode);
salesShippingInformationDetail.setMaterialNo(sysSalesOrderChild.getMaterialCode());
salesShippingInformationDetail.setMaterialName(sysSalesOrderChild.getMaterialName());
salesShippingInformationDetail.setMaterialDescribe(sysSalesOrderChild.getDescribe());
salesShippingInformationDetail.setMaterialModel(sysSalesOrderChild.getMaterialModel());
salesShippingInformationDetail.setMaterialNum(sysSalesOrderChild.getMaterialNum());
salesShippingInformationDetail.setMaterialUnit(sysSalesOrderChild.getUnit());
salesShippingInformationDetails.add(salesShippingInformationDetail);
}
int insertDetailResult = salesShippingInformationDetailMapper.insertBatchSalesShippingInformationDetail(salesShippingInformationDetails);
if (insertDetailResult <= 0){
throw new BusinessException("新增销售出货单明细失败!");
}
}
salesShippingInformation.setShippingInformationCode(shippingInformationCode);
salesShippingInformation.setShippingCode(shippingCode);
salesShippingInformation.setMakeNo(sysMakeOrder.getMakeNo());
salesShippingInformation.setBusinessMembers(loginName);
salesShippingInformation.setShippingInformationType("2");//出货单
salesShippingInformation.setShippingDate(new Date());
salesShippingInformation.setCreateTime(new Date());
salesShippingInformation.setCreateBy(loginName);
return salesShippingInformationMapper.insertSalesShippingInformation(salesShippingInformation);
}
/**
* 出货单补充单据
* */
@Override
public int updateShippingSupplementDocument(SalesShippingInformation salesShippingInformation) {
String loginName = ShiroUtils.getLoginName();
List<SalesShippingInformationDetail> shippingInformationDetails = salesShippingInformation.getShippingInformationDetails();
if (!CollectionUtils.isEmpty(shippingInformationDetails)){
for (SalesShippingInformationDetail salesShippingInformationDetail : shippingInformationDetails) {
salesShippingInformationDetail.setShippingInformationDetailId(salesShippingInformationDetail.getShippingInformationDetailId());
salesShippingInformationDetail.setUpdateTime(new Date());
salesShippingInformationDetail.setUpdateBy(loginName);
int informationDetailResult = salesShippingInformationDetailMapper.updateSalesShippingInformationDetail(salesShippingInformationDetail);
if (informationDetailResult <= 0){
throw new BusinessException("更新销售出货单明细失败!");
}
}
return 1;
}
return 0;
}
/**
* 出货箱单补充单据
* */
@ -403,6 +484,164 @@ public class SalesShippingInformationServiceImpl implements ISalesShippingInform
}
/**
* 导出销售出货单Infinity
* */
@Override
public void exportShippingInfinity(String shippingInformationCode, HttpServletResponse response) {
String fileName = "销售出货单1.xlsx";
try {
String fileAbsolutePath = FileDownloadUtils.getFileAbsolutePath(fileName);
if (StringUtils.isEmpty(shippingInformationCode)){
log.warn("出货资料单号为空,请检查:{}", shippingInformationCode);
throw new BusinessException("出货资料单号为空,请检查");
}
String realFileName = shippingInformationCode + "-" + fileName.substring(0, fileName.lastIndexOf(".")) + ".xlsx";
//设置响应头,指定文件和文件类型
response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(realFileName, "UTF-8"));
response.setContentType("application/octet-stream");
SalesShippingInformation salesShippingInformation = salesShippingInformationMapper.selectSalesShippingInformationByCode(shippingInformationCode);
String salesOrderCode = salesShippingInformation.getSalesOrderCode();
SysSalesOrderVo sysSalesOrderVo = sysSalesOrderMapper.selectSysSalesOrderBySalesOrderCode(salesOrderCode);
List<SalesShippingInformationDetail> salesShippingInformationDetails = salesShippingInformationDetailMapper.selectShippingInformationDetailListByCode(shippingInformationCode);
//处理物料数据
List<ExportShippingOrderDto> exportShippingOrderDtos = new ArrayList<>();
AtomicInteger index = new AtomicInteger(1);
for (SalesShippingInformationDetail shippingInformationDetail : salesShippingInformationDetails) {
ExportShippingOrderDto exportShippingOrderDto = new ExportShippingOrderDto();
exportShippingOrderDto.setIndex(index.getAndIncrement());
exportShippingOrderDto.setMaterialName(shippingInformationDetail.getMaterialName());
exportShippingOrderDto.setMaterialModel(shippingInformationDetail.getMaterialModel());
exportShippingOrderDto.setMaterialUnit(shippingInformationDetail.getMaterialUnit());
exportShippingOrderDto.setMakeNum(shippingInformationDetail.getMaterialNum());
exportShippingOrderDto.setSalesOrderNumber(sysSalesOrderVo.getSalesOrderNumber());
exportShippingOrderDto.setRemark(shippingInformationDetail.getRemark());
exportShippingOrderDto.setEnterpriseMaterialNo(sysSalesOrderVo.getEnterpriseMaterialNo());
exportShippingOrderDtos.add(exportShippingOrderDto);
}
Integer totalMakeNum = salesShippingInformationDetails.stream().mapToInt(SalesShippingInformationDetail::getMaterialNum).sum();
String bigTotalMakeNum = NumberChineseFormatterUtils.toChinese(totalMakeNum);
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
Date shippingDate = salesShippingInformation.getShippingDate();
String formattedShippingDate;
if (shippingDate == null){
formattedShippingDate = dateFormat.format(new Date());
}else {
formattedShippingDate = dateFormat.format(shippingDate);
}
Map<String, Object> map = new HashMap<>();
map.put("shippingOrderCode",salesShippingInformation.getShippingCode());
map.put("shippingDate",formattedShippingDate);
map.put("totalMakeNum",bigTotalMakeNum);
ExcelWriter workBook = EasyExcel.write(response.getOutputStream()).withTemplate(fileAbsolutePath).build();
WriteSheet sheet = EasyExcel.writerSheet().build();
FillConfig fillConfig = FillConfig.builder().forceNewRow(true).build();
workBook.fill(map, sheet);
workBook.fill(exportShippingOrderDtos, fillConfig, sheet);
workBook.finish();
} catch (IOException e) {
throw new RuntimeException("文件处理失败",e);
}
}
/**
* 导出销售出货单Vantritek
* */
@Override
public void exportShippingVantritek(String shippingInformationCode, HttpServletResponse response) {
String fileName = "销售出货单2.xlsx";
try {
String fileAbsolutePath = FileDownloadUtils.getFileAbsolutePath(fileName);
if (StringUtils.isEmpty(shippingInformationCode)){
log.warn("出货资料单号为空,请检查:{}", shippingInformationCode);
throw new BusinessException("出货资料单号为空,请检查");
}
String realFileName = shippingInformationCode + "-" + fileName.substring(0, fileName.lastIndexOf(".")) + ".xlsx";
//设置响应头,指定文件和文件类型
response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(realFileName, "UTF-8"));
response.setContentType("application/octet-stream");
SalesShippingInformation salesShippingInformation = salesShippingInformationMapper.selectSalesShippingInformationByCode(shippingInformationCode);
String salesOrderCode = salesShippingInformation.getSalesOrderCode();
SysSalesOrderVo sysSalesOrderVo = sysSalesOrderMapper.selectSysSalesOrderBySalesOrderCode(salesOrderCode);
List<SalesShippingInformationDetail> salesShippingInformationDetails = salesShippingInformationDetailMapper.selectShippingInformationDetailListByCode(shippingInformationCode);
//处理物料数据
List<ExportShippingOrderDto> exportShippingOrderDtos = new ArrayList<>();
AtomicInteger index = new AtomicInteger(1);
for (SalesShippingInformationDetail shippingInformationDetail : salesShippingInformationDetails) {
ExportShippingOrderDto exportShippingOrderDto = new ExportShippingOrderDto();
exportShippingOrderDto.setIndex(index.getAndIncrement());
exportShippingOrderDto.setMaterialName(shippingInformationDetail.getMaterialName());
exportShippingOrderDto.setMaterialModel(shippingInformationDetail.getMaterialModel());
exportShippingOrderDto.setMaterialUnit(shippingInformationDetail.getMaterialUnit());
exportShippingOrderDto.setMakeNum(shippingInformationDetail.getMaterialNum());
exportShippingOrderDto.setSalesOrderNumber(sysSalesOrderVo.getSalesOrderNumber());
exportShippingOrderDto.setRemark(shippingInformationDetail.getRemark());
exportShippingOrderDto.setEnterpriseMaterialNo(sysSalesOrderVo.getEnterpriseMaterialNo());
exportShippingOrderDtos.add(exportShippingOrderDto);
}
Integer totalMakeNum = salesShippingInformationDetails.stream().mapToInt(SalesShippingInformationDetail::getMaterialNum).sum();
String bigTotalMakeNum = NumberChineseFormatterUtils.toChinese(totalMakeNum);
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
Date shippingDate = salesShippingInformation.getShippingDate();
String formattedShippingDate;
if (shippingDate == null){
formattedShippingDate = dateFormat.format(new Date());
}else {
formattedShippingDate = dateFormat.format(shippingDate);
}
Map<String, Object> map = new HashMap<>();
map.put("shippingOrderCode",salesShippingInformation.getShippingCode());
map.put("shippingDate",formattedShippingDate);
map.put("totalMakeNum",bigTotalMakeNum);
ExcelWriter workBook = EasyExcel.write(response.getOutputStream()).withTemplate(fileAbsolutePath).build();
WriteSheet sheet = EasyExcel.writerSheet().build();
FillConfig fillConfig = FillConfig.builder().forceNewRow(true).build();
workBook.fill(map, sheet);
workBook.fill(exportShippingOrderDtos, fillConfig, sheet);
workBook.finish();
} catch (IOException e) {
throw new RuntimeException("文件处理失败",e);
}
}
/**
* 导出销售出货发票Infinity
* */

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

@ -21,9 +21,11 @@ import com.ruoyi.aftersales.mapper.AftersalesOutOrderMapper;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.exception.BusinessException;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.NumberChineseFormatterUtils;
import com.ruoyi.common.utils.ShiroUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.file.FileDownloadUtils;
import com.ruoyi.sales.domain.SalesShippingInformationDetail;
import com.ruoyi.system.domain.*;
import com.ruoyi.system.domain.Vo.ConfirmReceivingDetailVo;
import com.ruoyi.system.domain.Vo.ExportSalesShippingInformDetailVo;
@ -820,9 +822,9 @@ public class SysSalesShippingInformServiceImpl implements ISysSalesShippingInfor
//totalMakeNum
String totalMakeNum = String.valueOf(sysSalesOrderChildren.stream().mapToInt(SysSalesOrderChild::getMaterialNum).sum());
Integer totalMakeNum = sysSalesOrderChildren.stream().mapToInt(SysSalesOrderChild::getMaterialNum).sum();
String bigTotalMakeNum = NumberChineseFormatterUtils.toChinese(totalMakeNum);
ExcelWriter workBook = EasyExcel.write(response.getOutputStream()).withTemplate(fileAbsolutePath).build();
WriteSheet sheet = EasyExcel.writerSheet().build();
@ -835,7 +837,7 @@ public class SysSalesShippingInformServiceImpl implements ISysSalesShippingInfor
HashMap<String, Object> map = MapUtils.newHashMap();
map.put("customerId",salesShippingInform.getCustomerId());
map.put("shippingDate",shippingDate);
map.put("totalMakeNum",totalMakeNum);
map.put("totalMakeNum",bigTotalMakeNum);
map.put("shippingOrderCode",shippingOrderCode);
// 写入数据
@ -924,7 +926,9 @@ public class SysSalesShippingInformServiceImpl implements ISysSalesShippingInfor
//totalMakeNum
String totalMakeNum = String.valueOf(sysSalesOrderChildren.stream().mapToInt(SysSalesOrderChild::getMaterialNum).sum());
Integer totalMakeNum = sysSalesOrderChildren.stream().mapToInt(SysSalesOrderChild::getMaterialNum).sum();
String bigTotalMakeNum = NumberChineseFormatterUtils.toChinese(totalMakeNum);
ExcelWriter workBook = EasyExcel.write(response.getOutputStream()).withTemplate(fileAbsolutePath).build();
@ -940,7 +944,7 @@ public class SysSalesShippingInformServiceImpl implements ISysSalesShippingInfor
map.put("customerId",salesShippingInform.getCustomerId());
map.put("shippingDate",shippingDate);
map.put("totalMakeNum",totalMakeNum);
map.put("totalMakeNum",bigTotalMakeNum);
map.put("shippingOrderCode",shippingOrderCode);
// 写入数据

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

@ -104,6 +104,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
order by create_time desc
</select>
<select id="selectSalesShippingInformationShippingList" parameterType="SalesShippingInformation" resultMap="SalesShippingInformationResult">
<include refid="selectSalesShippingInformationVo"/>
<where>
<if test="shippingInformationCode != null and shippingInformationCode != ''"> and shipping_information_code like concat('%', #{shippingInformationCode}, '%')</if>
<if test="salesOrderCode != null and salesOrderCode != ''"> and sales_order_code like concat('%', #{salesOrderCode}, '%')</if>
<if test="makeNo != null and makeNo != ''"> and make_no like concat('%', #{makeNo}, '%')</if>
<if test="invoiceCode != null and invoiceCode != ''"> and invoice_code like concat('%', #{invoiceCode}, '%')</if>
<if test="shippingCode != null and shippingCode != ''"> and shipping_code like concat('%', #{shippingCode}, '%')</if>
<if test="packingCode != null and packingCode != ''"> and packing_code like concat('%', #{packingCode}, '%')</if>
<if test="shippingInformationType != null and shippingInformationType != ''"> and shipping_information_type = #{shippingInformationType}</if>
<if test="customerId != null and customerId != ''"> and customer_id = #{customerId}</if>
<if test="customerName != null and customerName != ''"> and customer_name like concat('%', #{customerName}, '%')</if>
<if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''"> and create_time between #{params.beginCreateTime} and #{params.endCreateTime}</if>
and shipping_information_type = '2'
</where>
order by create_time desc
</select>
<insert id="insertSalesShippingInformation" parameterType="SalesShippingInformation" useGeneratedKeys="true" keyProperty="shippingInformationId">

182
ruoyi-admin/src/main/resources/templates/sales/salesShippingInformationShipping/add.html

@ -0,0 +1,182 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('新增销售出货资料')" />
<th:block th:include="include :: select2-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-salesShippingInformationShipping-add">
<div class="form-group">
<label class="col-sm-3 control-label is-required">销售订单号:</label>
<div class="col-sm-8">
<select class="form-control" id="salesOrderCode" name="salesOrderCode" required>
<option value="">请选择</option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">客户名称:</label>
<div class="col-sm-8">
<select class="form-control" id="customerName" name="customerName" required>
<option value="">请选择</option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">客户订单号:</label>
<div class="col-sm-8">
<input name="salesOrderNumber" class="form-control" type="text" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">收货联系人(Ship to):</label>
<div class="col-sm-8">
<input name="customerContact" class="form-control" type="text" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">收货地址(Ship to):</label>
<div class="col-sm-8">
<input name="customerContactAddress" class="form-control" type="text" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">收货联系人(Bill to):</label>
<div class="col-sm-8">
<input name="customerContactBillto" class="form-control" type="text" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">收货地址(Bill to):</label>
<div class="col-sm-8">
<input name="contactAddressBillto" class="form-control" type="text" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">原产国:</label>
<div class="col-sm-8">
<input name="originCountry" class="form-control" type="text" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">贸易条款:</label>
<div class="col-sm-8">
<input name="tradeTerms" class="form-control" type="text" required>
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: select2-js" />
<script th:inline="javascript">
var prefix = ctx + "sales/salesShippingInformationShipping"
$("#form-salesShippingInformationShipping-add").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/add", $('#form-salesShippingInformationShipping-add').serialize());
}
}
$(function () {
selectSalesOrderCodes();
selectCustomerNames();
});
function selectSalesOrderCodes() {
// 销售订单编号下拉框
$("#salesOrderCode").select2({
theme: "bootstrap",
allowClear: true,
placeholder: "请选择销售订单号",
ajax: {
type: "get",
url: prefix + "/getSalesOrderCodeSelectList",
dataType: "json",
delay: 250,
timeout: 10000, // 设置超时时间为10秒
cache: true,
processResults: function (res, params) {
var options = [];
if (res.code == 0) {
var resultList = res.data;
console.log(resultList);
for (var i = 0, len = resultList.length; i < len; i++) {
var option = resultList[i];
option.id = resultList[i]["salesOrderCode"];
option.text = resultList[i]["salesOrderCode"];
options.push(option);
}
return {
results: options
}
}
;
return {
results: []
};
},
escapeMarkup: function (markup) {
return markup;
},
minimumInputLength: 1,
}
});
}
// $('#salesOrderCode').on('select2:select', function (e) {
// var data = e.params.data;
// // $("input[name='materialName']").val(data.materialName);
// // materilalSelect(data);
// });
function selectCustomerNames(){
$("select[name='customerName']").select2({
theme: "bootstrap",
allowClear: true,
placeholder: "请选择客户",
ajax:{
type: "get",
url:ctx + "system/customer/matchCustomerList",
dataType:"json",
delay:250,
timeout: 10000, // 设置超时时间为10秒
cache:true,
processResults: function (res, params) {
var options = [];
if(res.code==0){
var resultList = res.data;
customerList = resultList;
// console.log(customerList);
for(var i= 0, len=resultList.length;i<len;i++){
var option = resultList[i];
option.id = resultList[i]["enterpriseName"];
option.text = resultList[i]["enterpriseName"];
options.push(option);
}
return {
results: options
}
};
return {
results: [],
// pagination: {
// }
};
},
escapeMarkup: function (markup) { return markup; },
minimumInputLength: 1
}
});
}
</script>
</body>
</html>

200
ruoyi-admin/src/main/resources/templates/sales/salesShippingInformationShipping/salesShippingInformationShipping.html

@ -0,0 +1,200 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
<th:block th:include="include :: header('销售出货单列表')" />
</head>
<body class="gray-bg">
<div class="container-div">
<div class="row">
<div class="col-sm-12 search-collapse">
<form id="formId">
<div class="select-list">
<ul>
<li>
<label>出货资料单号:</label>
<input type="text" name="shippingInformationCode"/>
</li>
<li>
<label>销售订单号:</label>
<input type="text" name="salesOrderCode"/>
</li>
<li>
<label>生产订单号:</label>
<input type="text" name="makeNo"/>
</li>
<li>
<label>出货单号:</label>
<input type="text" name="shippingCode"/>
</li>
<li>
<label>客户名称:</label>
<input type="text" name="customerName"/>
</li>
<li class="select-time">
<label>录入时间:</label>
<input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginCreateTime]"/>
<span>-</span>
<input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endCreateTime]"/>
</li>
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
</li>
</ul>
</div>
</form>
</div>
<div class="btn-group-sm" id="toolbar" role="group">
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="sales:salesShippingInformationShipping:add">
<i class="fa fa-plus"></i> 添加
</a>
<a class="btn btn-success" onclick="exportShippingInfinity()" shiro:hasPermission="sales:salesShippingInformationShipping:export">
<i class="fa fa-download"></i> 导出Infinity
</a>
<a class="btn btn-success" onclick="exportShippingVantritek()" shiro:hasPermission="sales:salesShippingInformationShipping:export">
<i class="fa fa-download"></i> 导出Vantritek
</a>
</div>
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table"></table>
</div>
</div>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var supplementDocumentFlag = [[${@permission.hasPermi('sales:salesShippingInformationShipping:supplementDocument')}]];
var prefix = ctx + "sales/salesShippingInformationShipping";
$(function() {
var options = {
url: prefix + "/list",
createUrl: prefix + "/add",
updateUrl: prefix + "/edit/{id}",
exportUrl: prefix + "/export",
modalName: "销售出货单",
columns: [{
checkbox: true
},
{
title: '出货资料单id',
field: 'shippingInformationId',
visible: false
},
{
title: '出货资料单号',
field: 'shippingInformationCode',
},
{
title: '关联销售订单号',
field: 'salesOrderCode',
},
{
title: '关联生产订单号',
field: 'makeNo',
},
{
title: '出货单号',
field: 'shippingCode',
},
{
title: '业务人员',
field: 'businessMembers',
},
{
title: '客户名称',
field: 'customerName',
},
{
title: '录入时间',
field: 'createTime',
},
{
title: '录入人',
field: 'createBy',
},
{
title: '更新人',
field: 'updateBy',
},
{
title: '上次更新时间',
field: 'updateTime',
},
{
title: '操作',
align: 'center',
formatter: function(value, row, index) {
var actions = [];
actions.push('<a class="' + supplementDocumentFlag + '" href="javascript:void(0)" onclick="supplementDocument(\'' + row.shippingInformationId + '\')"><i class="fa fa-edit"></i>补充单据</a> ');
actions.push('<a href="javascript:void(0)" onclick="detail(\'' + row.shippingInformationId + '\')"><i class="fa fa-edit"></i>详情</a> ');
var actionLinks = actions.join('');
return $.table.dropdownToggle(actionLinks);
}
}]
};
$.table.init(options);
});
//详情
function detail(shippingInformationId) {
var url = prefix + '/shippingDetail/' + shippingInformationId;
$.modal.open("详情", url);
}
//补充单据
function supplementDocument(shippingInformationId) {
var url = prefix + '/supplementDocument/' + shippingInformationId;
$.modal.open("补充单据", url);
}
//导出出货单1
function exportShippingInfinity() {
// 获取选中的行
const selectedRows = $("#bootstrap-table").bootstrapTable('getSelections');
if (selectedRows.length !== 1) {
showWarning("请先选择一条销售出货单");
return;
}
const row = selectedRows[0];
// 使用 $.modal.confirm 显示确认对话框
$.modal.confirm("确定导出这条数据的出货单吗?", function() {
// 如果用户点击确定,继续导出
var shippingInformationCode = row.shippingInformationCode;
window.location.href = prefix + "/exportShippingInfinity/" + shippingInformationCode;
$('#bootstrap-table').bootstrapTable('refresh'); // 刷新表格
});
}
//导出出货单2
function exportShippingVantritek() {
// 获取选中的行
const selectedRows = $("#bootstrap-table").bootstrapTable('getSelections');
if (selectedRows.length !== 1) {
showWarning("请先选择一条销售出货单");
return;
}
const row = selectedRows[0];
// 使用 $.modal.confirm 显示确认对话框
$.modal.confirm("确定导出这条数据的出货单吗?", function() {
// 如果用户点击确定,继续导出
var shippingInformationCode = row.shippingInformationCode;
window.location.href = prefix + "/exportShippingVantritek/" + shippingInformationCode;
$('#bootstrap-table').bootstrapTable('refresh'); // 刷新表格
});
}
</script>
</body>
</html>

186
ruoyi-admin/src/main/resources/templates/sales/salesShippingInformationShipping/shippingDetail.html

@ -0,0 +1,186 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('修改销售出货单')" />
<th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-salesShippingInformationShipping-detail" th:object="${salesShippingInformation}">
<input name="shippingInformationId" th:field="*{shippingInformationId}" type="hidden">
<div class="form-group">
<label class="col-sm-3 control-label">出货资料单号:</label>
<div class="col-sm-8">
<input name="shippingInformationCode" th:field="*{shippingInformationCode}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">销售订单号:</label>
<div class="col-sm-8">
<input name="salesOrderCode" th:field="*{salesOrderCode}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">生产订单号:</label>
<div class="col-sm-8">
<input name="makeNo" th:field="*{makeNo}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">出货单号:</label>
<div class="col-sm-8">
<input name="shippingCode" th:field="*{shippingCode}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">业务人员:</label>
<div class="col-sm-8">
<input name="businessMembers" th:field="*{businessMembers}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">客户名称:</label>
<div class="col-sm-8">
<input name="customerName" th:field="*{customerName}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">客户订单号:</label>
<div class="col-sm-8">
<input name="salesOrderNumber" th:field="*{salesOrderNumber}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">送货日期:</label>
<div class="col-sm-8">
<div class="input-group date">
<input name="shippingDate" th:value="${#dates.format(salesShippingInformation.shippingDate, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text" disabled>
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">收货联系人(Ship to):</label>
<div class="col-sm-8">
<input name="customerContact" th:field="*{customerContact}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">收货地址(Ship to):</label>
<div class="col-sm-8">
<input name="customerContactAddress" th:field="*{customerContactAddress}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">收货联系人(Bill to):</label>
<div class="col-sm-8">
<input name="customerContactBillto" th:field="*{customerContactBillto}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">收货地址(Bill to):</label>
<div class="col-sm-8">
<input name="contactAddressBillto" th:field="*{contactAddressBillto}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">原产国:</label>
<div class="col-sm-8">
<input name="originCountry" th:field="*{originCountry}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">贸易条款:</label>
<div class="col-sm-8">
<input name="tradeTerms" th:field="*{tradeTerms}" class="form-control" type="text" readonly>
</div>
</div>
<div class="col-sm-12 select-table table-striped ">
<table id="bootstrap-table"></table>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<script th:inline="javascript">
var prefix = ctx + "sales/salesShippingInformationShipping";
$("#form-salesShippingInformationShippingInvoice-detail").validate({
focusCleanup: true
});
$("input[name='shippingDate']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
var salesShippingInformation = [[${salesShippingInformation}]];
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/shippingDetail", $('#form-salesShippingInformationShipping-detail').serialize());
}
}
//物料出库历史详细信息展示列表
$(function() {
var options = {
modalName: "单据详情",
url: prefix + "/getShippingDetailList",
queryParams: queryParams,
showSearch: false,
showRefresh: false,
showToggle: false,
showColumns: false,
pagination: false, // 设置不分页
columns: [
{
title: '出货资料详情id',
field: 'shippingInformationDetailId',
visible: false
},
{
title: '料号',
field: 'materialNo',
},
{
title: '型号',
field: 'materialModel',
},
{
title: '单位',
field: 'materialUnit',
},
{
title: '描述',
field: 'materialDescribe',
},
{
title: '物料数',
field: 'materialNum',
},
{
title: '备注',
field: 'remark',
}
]
};
$.table.init(options);
})
function queryParams(params) {
var curParams = {
// 传递参数查询参数
shippingInformationCode: salesShippingInformation.shippingInformationCode
};
console.log(curParams);
return curParams;
}
</script>
</body>
</html>

237
ruoyi-admin/src/main/resources/templates/sales/salesShippingInformationShipping/supplementDocument.html

@ -0,0 +1,237 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('修改销售出货单')" />
<th:block th:include="include :: datetimepicker-css" />
<th:block th:include="include :: bootstrap-editable-css"/>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-salesShippingInformationShipping-supplement" th:object="${salesShippingInformation}">
<input name="shippingInformationId" th:field="*{shippingInformationId}" type="hidden">
<div class="form-group">
<label class="col-sm-3 control-label">出货资料单号:</label>
<div class="col-sm-8">
<input name="shippingInformationCode" th:field="*{shippingInformationCode}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">销售订单号:</label>
<div class="col-sm-8">
<input name="salesOrderCode" th:field="*{salesOrderCode}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">生产订单号:</label>
<div class="col-sm-8">
<input name="makeNo" th:field="*{makeNo}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">出货单号:</label>
<div class="col-sm-8">
<input name="shippingCode" th:field="*{shippingCode}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">业务人员:</label>
<div class="col-sm-8">
<input name="businessMembers" th:field="*{businessMembers}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">客户名称:</label>
<div class="col-sm-8">
<input name="customerName" th:field="*{customerName}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">客户订单号:</label>
<div class="col-sm-8">
<input name="salesOrderNumber" th:field="*{salesOrderNumber}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">送货日期:</label>
<div class="col-sm-8">
<div class="input-group date">
<input name="shippingDate" th:value="${#dates.format(salesShippingInformation.shippingDate, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text" disabled>
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">收货联系人(Ship to):</label>
<div class="col-sm-8">
<input name="customerContact" th:field="*{customerContact}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">收货地址(Ship to):</label>
<div class="col-sm-8">
<input name="customerContactAddress" th:field="*{customerContactAddress}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">收货联系人(Bill to):</label>
<div class="col-sm-8">
<input name="customerContactBillto" th:field="*{customerContactBillto}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">收货地址(Bill to):</label>
<div class="col-sm-8">
<input name="contactAddressBillto" th:field="*{contactAddressBillto}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">原产国:</label>
<div class="col-sm-8">
<input name="originCountry" th:field="*{originCountry}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">贸易条款:</label>
<div class="col-sm-8">
<input name="tradeTerms" th:field="*{tradeTerms}" class="form-control" type="text" readonly>
</div>
</div>
<div class="col-sm-12 select-table table-striped ">
<table id="bootstrap-table"></table>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<th:block th:include="include :: bootstrap-table-editable-js" />
<script th:inline="javascript">
var prefix = ctx + "sales/salesShippingInformationShipping";
$("#form-salesShippingInformationShippingInvoice-supplement").validate({
focusCleanup: true
});
$("input[name='shippingDate']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
var salesShippingInformation = [[${salesShippingInformation}]];
function submitHandler() {
if ($.validate.form()) {
const shippingData = $("#form-salesShippingInformationShipping-supplement").serializeArray().reduce((obj, item) => {
obj[item.name] = item.value;
return obj;
}, {});
var table = $('#bootstrap-table').bootstrapTable("getData");
var materialDataList = table.map(function(item) {
// 根据实际字段名调整
return {
"shippingInformationDetailId":item.shippingInformationDetailId,
"materialNum":item.materialNum,
"remark":item.remark,
// ...其他字段
};
});
const combinedData = Object.assign({}, shippingData, {
shippingInformationDetails: materialDataList,
});
// 合并表单数据和表格数据
console.log(combinedData)
// 使用 JSON.stringify() 序列化数据
const jsonData = JSON.stringify(combinedData);
// 发送 AJAX 请求到后端接口
$.operate.saveJson(prefix + "/supplementDocument", jsonData);
}
}
//物料出库历史详细信息展示列表
$(function() {
var options = {
modalName: "单据详情",
url: prefix + "/getShippingDetailList",
queryParams: queryParams,
showSearch: false,
showRefresh: false,
showToggle: false,
showColumns: false,
pagination: false, // 设置不分页
columns: [
{
title: '出货资料详情id',
field: 'shippingInformationDetailId',
visible: false
},
{
title: '料号',
field: 'materialNo',
},
{
title: '型号',
field: 'materialModel',
},
{
title: '描述',
field: 'materialDescribe',
},
{
title: '物料数',
field: 'materialNum',
editable: {
type: 'text',
},
},
{
title: '备注',
field: 'remark',
editable: {
type: 'text',
},
formatter: function (value, row) {
// 检查 row 是否存在
if (!row) {
return "";
}
// 检查 remark 是否存在
if (row.remark === undefined || row.remark === null) {
return "";
}
// 根据 remark 的值决定返回值
if (row.remark) {
return row.remark;
} else {
return value;
}
}
},
]
};
$.table.init(options);
})
function queryParams(params) {
var curParams = {
// 传递参数查询参数
shippingInformationCode: salesShippingInformation.shippingInformationCode
};
console.log(curParams);
return curParams;
}
</script>
</body>
</html>

35
ruoyi-common/src/main/java/com/ruoyi/common/utils/NumberChineseFormatterUtils.java

@ -0,0 +1,35 @@
package com.ruoyi.common.utils;
/**
* 数字转中文类
**/
public class NumberChineseFormatterUtils {
private static final String[] CHINESE_NUMBERS = {"零", "壹", "贰", "叁", "肆", "伍", "陆", "柒", "捌", "玖"};
private static final String[] LEVELS = {"", "拾", "佰", "仟"};
public static String toChinese(int num) {
if (num == 0) return CHINESE_NUMBERS[0];
StringBuilder result = new StringBuilder();
int unitPos = 0;
boolean skipZero = true;
while (num > 0) {
int n = num % 10;
if (n == 0) {
if (!skipZero) {
result.insert(0, CHINESE_NUMBERS[n]);
skipZero = true;
}
} else {
skipZero = false;
result.insert(0, LEVELS[unitPos]);
result.insert(0, CHINESE_NUMBERS[n]);
}
num /= 10;
unitPos = (unitPos + 1) % 4;
}
return result.toString();
}
}
Loading…
Cancel
Save