Compare commits

...

3 Commits

Author SHA1 Message Date
曹鹏飞 acdac8e11d refactor(delivery): 优化发货清单导出功能
- 移除手动序号生成逻辑
- 使用服务层方法替代流式处理转换
- 简化数据获取流程
- 提高代码可读性
- 减少内存占用
- 提升性能表现
2026-03-09 11:36:22 +08:00
曹鹏飞 0d3883a884 style(label): 调整物料标签模板样式并优化数据显示
- 移除二维码容器多余边距设置
- 调整表格列宽以改善布局显示效果
- 客户名称列取消固定宽度以支持自适应
- 将实际数量字段替换为格式化后的数量文本显示
- 为物料清单图片添加固定宽度样式
- 新增数量格式化工具类集成到数据传输对象中
2026-03-09 11:36:15 +08:00
曹鹏飞 b300ba14a2 refactor(location): 将 binService 重命名为 wmsBinService 2026-03-05 10:23:37 +08:00
6 changed files with 29 additions and 24 deletions

View File

@ -8,11 +8,7 @@ import com.nflg.wms.common.constant.BarCodeProcessStage;
import com.nflg.wms.common.pojo.ApiResult; import com.nflg.wms.common.pojo.ApiResult;
import com.nflg.wms.common.pojo.PageData; import com.nflg.wms.common.pojo.PageData;
import com.nflg.wms.common.pojo.dto.InventoryDTO; import com.nflg.wms.common.pojo.dto.InventoryDTO;
import com.nflg.wms.common.pojo.dto.PackageChildDTO;
import com.nflg.wms.common.pojo.dto.PackageDTO;
import com.nflg.wms.common.pojo.qo.*; import com.nflg.wms.common.pojo.qo.*;
import com.nflg.wms.common.pojo.vo.PackingScanVO;
import com.nflg.wms.common.pojo.vo.PackingVO;
import com.nflg.wms.common.pojo.vo.QrCodeVO; import com.nflg.wms.common.pojo.vo.QrCodeVO;
import com.nflg.wms.common.pojo.vo.TransferOrderVO; import com.nflg.wms.common.pojo.vo.TransferOrderVO;
import com.nflg.wms.common.util.UserUtil; import com.nflg.wms.common.util.UserUtil;
@ -45,7 +41,7 @@ public class LocationTransferController extends BaseController {
private IWmsQrCodeMasterService qrCodeMasterService; private IWmsQrCodeMasterService qrCodeMasterService;
@Resource @Resource
private IWmsBinService binService; private IWmsBinService wmsBinService;
@Resource @Resource
private IWmsWarehouseService warehouseService; private IWmsWarehouseService warehouseService;
@ -122,7 +118,7 @@ public class LocationTransferController extends BaseController {
.collect(Collectors.toList()).size(); .collect(Collectors.toList()).size();
VUtil.trueThrowBusinessError(count > 0).throwMessage("存在相同储位的二维码"); VUtil.trueThrowBusinessError(count > 0).throwMessage("存在相同储位的二维码");
WmsBin wmsBin = binService.lambdaQuery().eq(WmsBin::getNo, request.getBinLocation()) WmsBin wmsBin = wmsBinService.lambdaQuery().eq(WmsBin::getNo, request.getBinLocation())
.one(); .one();
VUtil.trueThrowBusinessError(ObjectUtil.isNull(wmsBin)).throwMessage("无效的储位"); VUtil.trueThrowBusinessError(ObjectUtil.isNull(wmsBin)).throwMessage("无效的储位");
WmsWarehouse wmsWarehouse = warehouseService.lambdaQuery().eq(WmsWarehouse::getId, wmsBin.getWarehouseId()) WmsWarehouse wmsWarehouse = warehouseService.lambdaQuery().eq(WmsWarehouse::getId, wmsBin.getWarehouseId())

View File

@ -1,5 +1,6 @@
package com.nflg.wms.common.pojo.vo; package com.nflg.wms.common.pojo.vo;
import com.nflg.wms.common.util.NumberUtil;
import lombok.Data; import lombok.Data;
import java.math.BigDecimal; import java.math.BigDecimal;
@ -34,6 +35,15 @@ public class ShipmentMaterialCodeQRVO {
*/ */
private BigDecimal num; private BigDecimal num;
/**
* 应发数量文本
*/
private String numText;
public String getNumText() {
return NumberUtil.format(num);
}
/** /**
* 实发数量 * 实发数量
*/ */

View File

@ -202,17 +202,17 @@ public class DeliveryController extends BaseController {
public void exportItemToExcel(HttpServletResponse response, @RequestParam Long id) throws IOException { public void exportItemToExcel(HttpServletResponse response, @RequestParam Long id) throws IOException {
WmsShipmentDelivery delivery = deliveryService.getById(id); WmsShipmentDelivery delivery = deliveryService.getById(id);
VUtil.trueThrowBusinessError(Objects.isNull(delivery)).throwMessage("清单不存在"); VUtil.trueThrowBusinessError(Objects.isNull(delivery)).throwMessage("清单不存在");
AtomicInteger index = new AtomicInteger(1); // AtomicInteger index = new AtomicInteger(1);
List<ShipmentMaterialCodeItemVO> list = deliveryItemService.lambdaQuery() // List<ShipmentMaterialCodeItemVO> list = deliveryItemService.lambdaQuery()
.eq(WmsShipmentDeliveryItem::getDeliveryId, id) // .eq(WmsShipmentDeliveryItem::getDeliveryId, id)
.orderByAsc(WmsShipmentDeliveryItem::getId) // .orderByAsc(WmsShipmentDeliveryItem::getId)
.list() // .list()
.stream().map(item -> { // .stream().map(item -> {
ShipmentMaterialCodeItemVO vo = Convert.convert(ShipmentMaterialCodeItemVO.class, item); // ShipmentMaterialCodeItemVO vo = Convert.convert(ShipmentMaterialCodeItemVO.class, item);
vo.setIndex(index.getAndIncrement()); // vo.setIndex(index.getAndIncrement());
return vo; // return vo;
}).toList(); // }).toList();
// List<ShipmentMaterialCodeItemVO> list = deliveryItemService.getItemsVO(id); List<ShipmentMaterialCodeItemVO> list = deliveryItemService.getItemsVO(id);
response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE); response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE);
response.setHeader(HttpHeaders.CONTENT_DISPOSITION, "attachment;filename=" + URLEncoder.encode("发货清单-" + delivery.getNo() + ".xlsx", StandardCharsets.UTF_8)); response.setHeader(HttpHeaders.CONTENT_DISPOSITION, "attachment;filename=" + URLEncoder.encode("发货清单-" + delivery.getNo() + ".xlsx", StandardCharsets.UTF_8));
new Workbook() new Workbook()

View File

@ -39,7 +39,6 @@
.qrcode { .qrcode {
width: 380px; width: 380px;
height: 380px; height: 380px;
margin: 10px;
} }
.lst{ .lst{
width: 800px; width: 800px;
@ -54,16 +53,16 @@
<img alt="" class="qrcode" th:src="${ext.qrCode}"/> <img alt="" class="qrcode" th:src="${ext.qrCode}"/>
<div style="font-size: 16pt" th:text="${info.no}">0PC7B724KV6FM</div> <div style="font-size: 16pt" th:text="${info.no}">0PC7B724KV6FM</div>
</td> </td>
<td style="width: 110px;"> <td style="width: 140px;">
机台编号 机台编号
</td> </td>
<td style="width: 180px;" th:text="${info.no}"> <td style="width: 200px;" th:text="${info.no}">
26LBZ4000L001 26LBZ4000L001
</td> </td>
<td style="width: 110px;"> <td style="width: 140px;">
客户名称 客户名称
</td> </td>
<td style="width: 400px;text-align: left" th:text="${info.customerName}"> <td style="text-align: left" th:text="${info.customerName}">
北京市京联鑫路用材料有限公司 北京市京联鑫路用材料有限公司
</td> </td>
</tr> </tr>
@ -77,13 +76,13 @@
<td> <td>
数量 数量
</td> </td>
<td th:text="${info.actualNum}"> <td th:text="${info.numText}">
10 10
</td> </td>
</tr> </tr>
<tr> <tr>
<td colspan="4"> <td colspan="4">
<img alt="" src="https://img-s.msn.cn/tenant/amp/entityid/AA1VWN3Q.img?w=768&h=333&m=6" class="lst" th:src="${ext.lst}"/> <img style="width: 750px;" alt="" src="https://img-s.msn.cn/tenant/amp/entityid/AA1VWN3Q.img?w=768&h=333&m=6" class="lst" th:src="${ext.lst}"/>
</td> </td>
</tr> </tr>
</table> </table>