Ver código fonte

新增添加装运单打印表

lingpeng.li 2 dias atrás
pai
commit
0f422c5ad9

+ 21 - 0
zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/storageBill/controller/StorageBillController.java

@@ -59,8 +59,10 @@ import org.jeecg.modules.billet.rollOutShipp.service.IRollOutShippService;
 import org.jeecg.modules.billet.stackingAndLoadingVehicles.entity.StackingAndLoadingVehicles;
 import org.jeecg.modules.billet.stackingAndLoadingVehicles.service.IStackingAndLoadingVehiclesService;
 import org.jeecg.modules.billet.storageBill.dto.HotChargingQueryDTO;
+import org.jeecg.modules.billet.storageBill.dto.StorageBillPrintAddDTO;
 import org.jeecg.modules.billet.storageBill.dto.StorageCenterQueryDTO;
 import org.jeecg.modules.billet.storageBill.entity.*;
+import org.jeecg.modules.billet.storageBill.service.IStorageBillPrintService;
 import org.jeecg.modules.billet.storageBill.service.IStorageBillService;
 import org.jeecg.modules.billet.storageBill.vo.*;
 import org.jeecg.modules.billet.storageCarLog.entity.StorageCarLog;
@@ -164,6 +166,10 @@ public class StorageBillController extends JeecgController<StorageBill, IStorage
 
 	@Autowired
 	private IRollDeputyCrossDetailsService rollDeputyCrossDetailsService;
+
+	@Autowired
+	private IStorageBillPrintService storageBillPrintService;
+
 	/**
 	 * 分页列表查询
 	 *
@@ -2462,4 +2468,19 @@ public class StorageBillController extends JeecgController<StorageBill, IStorage
 		return false;
 	}
 
+
+	/**
+	 *   添加
+	 *
+	 * @param addDTO
+	 * @return
+	 */
+	@AutoLog(value = "装运单打印表-添加")
+	@ApiOperation(value="装运单打印表-添加", notes="装运单打印表-添加")
+	@PostMapping(value = "/saveStorageBillPrint")
+	public Result<String> saveStorageBillPrint(@RequestBody StorageBillPrintAddDTO addDTO) {
+		storageBillPrintService.saveStorageBillPrint(addDTO);
+		return Result.OK("添加成功!");
+	}
+
 }

+ 79 - 0
zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/storageBill/dto/StorageBillPrintAddDTO.java

@@ -0,0 +1,79 @@
+package org.jeecg.modules.billet.storageBill.dto;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import org.jeecgframework.poi.excel.annotation.Excel;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.math.BigDecimal;
+import java.util.Date;
+import java.util.Map;
+
+@Data
+public class StorageBillPrintAddDTO {
+
+    /**
+     * 目的地
+     */
+    @Excel(name = "目的地", width = 15)
+    @ApiModelProperty(value = "目的地")
+    private String destination;
+    /**
+     * 到站时间
+     */
+    @Excel(name = "到站时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "到站时间")
+    private Date arrivalTime;
+    /**
+     * 车牌号
+     */
+    @Excel(name = "车牌号", width = 15)
+    @ApiModelProperty(value = "车牌号")
+    private String licensePlate;
+    /**
+     * 牌号
+     */
+    @Excel(name = "牌号", width = 15)
+    @ApiModelProperty(value = "牌号")
+    private String brandNum;
+    /**
+     * 炉号
+     */
+    @Excel(name = "炉号", width = 15)
+    @ApiModelProperty(value = "炉号")
+    private Map<String, Integer> heatNo;
+    /**
+     * 定尺
+     */
+    @Excel(name = "定尺", width = 15)
+    @ApiModelProperty(value = "定尺")
+    private String size;
+    /**
+     * 名称
+     */
+    @Excel(name = "名称", width = 15)
+    @ApiModelProperty(value = "名称")
+    private String name;
+    /**
+     * 支数
+     */
+    @Excel(name = "支数", width = 15)
+    @ApiModelProperty(value = "支数")
+    private Integer amountTotal;
+    /**
+     * 重量
+     */
+    @Excel(name = "重量", width = 15)
+    @ApiModelProperty(value = "重量")
+    private BigDecimal weight;
+    /**
+     * 装运单ID
+     */
+    @Excel(name = "装运单ID", width = 15)
+    @ApiModelProperty(value = "装运单ID")
+    private String storageBillId;
+
+}

+ 130 - 0
zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/storageBill/entity/StorageBillPrint.java

@@ -0,0 +1,130 @@
+package org.jeecg.modules.billet.storageBill.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import org.jeecgframework.poi.excel.annotation.Excel;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * @Description: 装运单打印表
+ * @Author: jeecg-boot
+ * @Date: 2025-06-16
+ * @Version: V1.0
+ */
+@Data
+@TableName("storage_bill_print")
+@Accessors(chain = true)
+@EqualsAndHashCode(callSuper = false)
+@ApiModel(value = "storage_bill_print对象", description = "装运单打印表")
+public class StorageBillPrint implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键
+     */
+    @TableId(type = IdType.ASSIGN_ID)
+    @ApiModelProperty(value = "主键")
+    private String id;
+    /**
+     * 创建人
+     */
+    @ApiModelProperty(value = "创建人")
+    private String createBy;
+    /**
+     * 创建日期
+     */
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "创建日期")
+    private java.util.Date createTime;
+    /**
+     * 更新人
+     */
+    @ApiModelProperty(value = "更新人")
+    private String updateBy;
+    /**
+     * 更新日期
+     */
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "更新日期")
+    private Date updateTime;
+    /**
+     * 所属部门
+     */
+    @ApiModelProperty(value = "所属部门")
+    private String sysOrgCode;
+    /**
+     * 目的地
+     */
+    @Excel(name = "目的地", width = 15)
+    @ApiModelProperty(value = "目的地")
+    private String destination;
+    /**
+     * 到站时间
+     */
+    @Excel(name = "到站时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "到站时间")
+    private Date arrivalTime;
+    /**
+     * 车牌号
+     */
+    @Excel(name = "车牌号", width = 15)
+    @ApiModelProperty(value = "车牌号")
+    private String licensePlate;
+    /**
+     * 牌号
+     */
+    @Excel(name = "牌号", width = 15)
+    @ApiModelProperty(value = "牌号")
+    private String brandNum;
+    /**
+     * 炉号
+     */
+    @Excel(name = "炉号", width = 15)
+    @ApiModelProperty(value = "炉号")
+    private String heatNo;
+    /**
+     * 定尺
+     */
+    @Excel(name = "定尺", width = 15)
+    @ApiModelProperty(value = "定尺")
+    private String size;
+    /**
+     * 名称
+     */
+    @Excel(name = "名称", width = 15)
+    @ApiModelProperty(value = "名称")
+    private String name;
+    /**
+     * 支数
+     */
+    @Excel(name = "支数", width = 15)
+    @ApiModelProperty(value = "支数")
+    private Integer amountTotal;
+    /**
+     * 重量
+     */
+    @Excel(name = "重量", width = 15)
+    @ApiModelProperty(value = "重量")
+    private BigDecimal weight;
+    /**
+     * 装运单ID
+     */
+    @Excel(name = "装运单ID", width = 15)
+    @ApiModelProperty(value = "装运单ID")
+    private String storageBillId;
+}

+ 14 - 0
zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/storageBill/mapper/StorageBillPrintMapper.java

@@ -0,0 +1,14 @@
+package org.jeecg.modules.billet.storageBill.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.jeecg.modules.billet.storageBill.entity.StorageBillPrint;
+
+/**
+ * @Description: 装运单打印表
+ * @Author: jeecg-boot
+ * @Date:   2025-06-16
+ * @Version: V1.0
+ */
+public interface StorageBillPrintMapper extends BaseMapper<StorageBillPrint> {
+
+}

+ 5 - 0
zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/storageBill/mapper/xml/StorageBillPrintMapper.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.jeecg.modules.demo.storageBillPrint.mapper.StorageBillPrintMapper">
+
+</mapper>

+ 16 - 0
zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/storageBill/service/IStorageBillPrintService.java

@@ -0,0 +1,16 @@
+package org.jeecg.modules.billet.storageBill.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import org.jeecg.modules.billet.storageBill.dto.StorageBillPrintAddDTO;
+import org.jeecg.modules.billet.storageBill.entity.StorageBillPrint;
+
+/**
+ * @Description: 装运单打印表
+ * @Author: jeecg-boot
+ * @Date: 2025-06-16
+ * @Version: V1.0
+ */
+public interface IStorageBillPrintService extends IService<StorageBillPrint> {
+
+    void saveStorageBillPrint(StorageBillPrintAddDTO addDTO);
+}

+ 44 - 0
zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/storageBill/service/impl/StorageBillPrintServiceImpl.java

@@ -0,0 +1,44 @@
+package org.jeecg.modules.billet.storageBill.service.impl;
+
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import org.jeecg.modules.billet.storageBill.dto.StorageBillPrintAddDTO;
+import org.jeecg.modules.billet.storageBill.entity.StorageBillPrint;
+import org.jeecg.modules.billet.storageBill.mapper.StorageBillPrintMapper;
+import org.jeecg.modules.billet.storageBill.service.IStorageBillPrintService;
+import org.springframework.beans.BeanUtils;
+import org.springframework.stereotype.Service;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+
+/**
+ * @Description: 装运单打印表
+ * @Author: jeecg-boot
+ * @Date:   2025-06-16
+ * @Version: V1.0
+ */
+@Service
+public class StorageBillPrintServiceImpl extends ServiceImpl<StorageBillPrintMapper, StorageBillPrint> implements IStorageBillPrintService {
+
+    @Override
+    public void saveStorageBillPrint(StorageBillPrintAddDTO addDTO) {
+        StorageBillPrint storageBillPrint = new StorageBillPrint();
+
+        // 复制除 heatNo 之外的字段
+        BeanUtils.copyProperties(addDTO, storageBillPrint, "heatNo");
+
+        // heatNo Map 转为 JSON 字符串
+        if (addDTO.getHeatNo() != null) {
+            try {
+                ObjectMapper objectMapper = new ObjectMapper();
+                String heatNoJson = objectMapper.writeValueAsString(addDTO.getHeatNo());
+                storageBillPrint.setHeatNo(heatNoJson);
+            } catch (JsonProcessingException e) {
+                throw new RuntimeException("heatNo JSON 转换失败", e);
+            }
+        }
+
+        this.save(storageBillPrint);
+    }
+
+}