From 814f0712ce59dc0aee73779a8ff645e3ec5f394a Mon Sep 17 00:00:00 2001
From: buhuazhen <hua100783@gmail.com>
Date: 星期三, 22 四月 2026 18:11:53 +0800
Subject: [PATCH] feat(production): 新增印刷定印单及相关DTO和Mapper实现
---
src/main/java/com/ruoyi/production/service/ProductionPrintOrderService.java | 21 ++
src/main/java/com/ruoyi/production/dto/MaterialInfoDto.java | 27 +++
src/main/java/com/ruoyi/production/dto/SaveProductionPrintOrderDto.java | 23 ++
src/main/resources/mapper/production/ProductOrderMapper.xml | 1
src/main/resources/mapper/production/ProductionPrintOrderMapper.xml | 7
src/main/java/com/ruoyi/production/dto/ProductOrderDto.java | 2
src/main/java/com/ruoyi/production/service/impl/ProductionPrintOrderServiceImpl.java | 49 ++++++
src/main/java/com/ruoyi/production/dto/PlateMakingDto.java | 26 +++
src/main/java/com/ruoyi/production/pojo/ProductionPrintOrder.java | 219 +++++++++++++++++++++++++++
src/main/java/com/ruoyi/production/mapper/ProductionPrintOrderMapper.java | 18 ++
src/main/java/com/ruoyi/production/dto/ProductionPrintOrderDto.java | 23 ++
src/main/java/com/ruoyi/production/dto/ProcessContentDto.java | 25 +++
12 files changed, 441 insertions(+), 0 deletions(-)
diff --git a/src/main/java/com/ruoyi/production/dto/MaterialInfoDto.java b/src/main/java/com/ruoyi/production/dto/MaterialInfoDto.java
new file mode 100644
index 0000000..070f7e4
--- /dev/null
+++ b/src/main/java/com/ruoyi/production/dto/MaterialInfoDto.java
@@ -0,0 +1,27 @@
+package com.ruoyi.production.dto;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+
+/**
+ * @author buhuazhen
+ * @date 2026/4/22
+ * @email 3038525872@qq.com
+ */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class MaterialInfoDto implements Serializable {
+ private Long id;
+ private String name;
+ private String model;
+ private String num;
+ private String numSuffix = "寮�";
+ private String unit;
+ private String unitSuffix = "鍏�/kg";
+ private String price;
+ private String totalAmount;
+}
diff --git a/src/main/java/com/ruoyi/production/dto/PlateMakingDto.java b/src/main/java/com/ruoyi/production/dto/PlateMakingDto.java
new file mode 100644
index 0000000..18879e0
--- /dev/null
+++ b/src/main/java/com/ruoyi/production/dto/PlateMakingDto.java
@@ -0,0 +1,26 @@
+package com.ruoyi.production.dto;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+
+/**
+ * 鍒剁増DTO
+ * @author buhuazhen
+ * @date 2026/4/22
+ * @email 3038525872@qq.com
+ */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class PlateMakingDto implements Serializable {
+ private String designProductionFee; // 璁捐鍒朵綔璐�
+ private String impositionFee; // 鎷肩増璐�
+ private String filmOutputFee; // 鍑虹墖璐�
+ private String proofingFee; // 鎵撴牱璐�
+ private String doctorBladePlateFee; // 鍒垁鐗堣垂
+ private String hotEmbossingPlateFee; // 鐑�/鍑哥増璐�
+ private String subtotalFee; // 灏忚
+}
diff --git a/src/main/java/com/ruoyi/production/dto/ProcessContentDto.java b/src/main/java/com/ruoyi/production/dto/ProcessContentDto.java
new file mode 100644
index 0000000..29affdf
--- /dev/null
+++ b/src/main/java/com/ruoyi/production/dto/ProcessContentDto.java
@@ -0,0 +1,25 @@
+package com.ruoyi.production.dto;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+
+/**
+ * 宸ュ簭鍔犲伐鍐呭Dto
+ * @author buhuazhen
+ * @date 2026/4/22
+ * @email 3038525872@qq.com
+ */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class ProcessContentDto implements Serializable {
+ private String id;
+ private Long processId; // 宸ュ簭id
+ private String processContent; // 宸ヨ壓鍔犲伐鍐呭
+ private String openCount; // 寮�鏁�
+ private String processPositive; // 宸ヨ壓姝f暟
+ private String allowanceQty; // 鍔犳斁鏁�
+}
diff --git a/src/main/java/com/ruoyi/production/dto/ProductOrderDto.java b/src/main/java/com/ruoyi/production/dto/ProductOrderDto.java
index dc2185a..d5dd777 100644
--- a/src/main/java/com/ruoyi/production/dto/ProductOrderDto.java
+++ b/src/main/java/com/ruoyi/production/dto/ProductOrderDto.java
@@ -57,4 +57,6 @@
//鏄惁鍙戣揣(鍙拌处椤甸潰棰滆壊鎺у埗)
private Boolean isFh;
+
+ private Long saleLedgerId;
}
diff --git a/src/main/java/com/ruoyi/production/dto/ProductionPrintOrderDto.java b/src/main/java/com/ruoyi/production/dto/ProductionPrintOrderDto.java
new file mode 100644
index 0000000..b4eaff1
--- /dev/null
+++ b/src/main/java/com/ruoyi/production/dto/ProductionPrintOrderDto.java
@@ -0,0 +1,23 @@
+package com.ruoyi.production.dto;
+
+import com.ruoyi.production.pojo.ProductionPrintOrder;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+
+/**
+ * @author buhuazhen
+ * @date 2026/4/22
+ * @email 3038525872@qq.com
+ */
+@EqualsAndHashCode(callSuper = true)
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class ProductionPrintOrderDto extends ProductionPrintOrder implements Serializable {
+
+
+}
diff --git a/src/main/java/com/ruoyi/production/dto/SaveProductionPrintOrderDto.java b/src/main/java/com/ruoyi/production/dto/SaveProductionPrintOrderDto.java
new file mode 100644
index 0000000..9351dc3
--- /dev/null
+++ b/src/main/java/com/ruoyi/production/dto/SaveProductionPrintOrderDto.java
@@ -0,0 +1,23 @@
+package com.ruoyi.production.dto;
+
+import com.ruoyi.production.pojo.ProductionPrintOrder;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+
+/**
+ * 鐢ㄤ簬淇濆瓨鐨刣to
+ * @author buhuazhen
+ * @date 2026/4/22
+ * @email 3038525872@qq.com
+ */
+@EqualsAndHashCode(callSuper = true)
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class SaveProductionPrintOrderDto extends ProductionPrintOrder implements Serializable {
+ private String notNeed;
+}
diff --git a/src/main/java/com/ruoyi/production/mapper/ProductionPrintOrderMapper.java b/src/main/java/com/ruoyi/production/mapper/ProductionPrintOrderMapper.java
new file mode 100644
index 0000000..caf81bb
--- /dev/null
+++ b/src/main/java/com/ruoyi/production/mapper/ProductionPrintOrderMapper.java
@@ -0,0 +1,18 @@
+package com.ruoyi.production.mapper;
+
+import com.ruoyi.production.pojo.ProductionPrintOrder;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+* @author buhuazhen
+* @description 閽堝琛ㄣ�恜roduction_print_order(鍗板埛瀹氬嵃鍗�)銆戠殑鏁版嵁搴撴搷浣淢apper
+* @createDate 2026-04-22 15:14:51
+* @Entity com.ruoyi.production.pojo.ProductionPrintOrder
+*/
+public interface ProductionPrintOrderMapper extends BaseMapper<ProductionPrintOrder> {
+
+}
+
+
+
+
diff --git a/src/main/java/com/ruoyi/production/pojo/ProductionPrintOrder.java b/src/main/java/com/ruoyi/production/pojo/ProductionPrintOrder.java
new file mode 100644
index 0000000..25b0cfd
--- /dev/null
+++ b/src/main/java/com/ruoyi/production/pojo/ProductionPrintOrder.java
@@ -0,0 +1,219 @@
+package com.ruoyi.production.pojo;
+
+import com.baomidou.mybatisplus.annotation.*;
+
+import java.io.Serializable;
+import java.time.LocalDateTime;
+import java.util.List;
+
+import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
+import com.ruoyi.production.dto.MaterialInfoDto;
+import com.ruoyi.production.dto.PlateMakingDto;
+import com.ruoyi.production.dto.ProcessContentDto;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ * 鍗板埛瀹氬嵃鍗�
+ * @TableName production_print_order
+ */
+@TableName(value ="production_print_order",autoResultMap = true)
+@Data
+public class ProductionPrintOrder implements Serializable {
+ /**
+ *
+ */
+ @TableId(value = "id", type = IdType.AUTO)
+ private Long id;
+
+ /**
+ * 瀵瑰簲鐨勯攢鍞鍗�
+ */
+ @TableField(value = "sales_ledger_id")
+ private Long salesLedgerId;
+
+ /**
+ * 瀵瑰簲鐨勭敓浜у伐鍗�
+ */
+ @TableField(value = "product_order")
+ private Long productOrder;
+
+ /**
+ * 鍒跺崟鏃ユ湡
+ */
+ @TableField(value = "print_order_time")
+ private LocalDateTime printOrderTime;
+
+ /**
+ * 瀹屾垚鏃ユ湡
+ */
+ @TableField(value = "finish_time")
+ private LocalDateTime finishTime;
+
+ /**
+ * 缂栧彿 搴旇涓簊ale鐨勫悎鍚屽彿
+ */
+ @TableField(value = "no")
+ private String no;
+
+ /**
+ * 鎴愬搧灏哄
+ */
+ @TableField(value = "finished_size")
+ private String finishedSize;
+
+ /**
+ * 浠嬬粛淇� 瀛樺湪 , 琛ㄧず澶氫釜
+ */
+ @TableField(value = "introduction_letter")
+ private String introductionLetter;
+
+ /**
+ * 浜у搧鍚嶇О
+ */
+ @TableField(value = "product_name")
+ private String productName;
+
+ /**
+ * 浜у搧璇存槑
+ */
+ @TableField(value = "product_description")
+ private String productDescription;
+
+ /**
+ * 鍒囨枡灏哄
+ */
+ @TableField(value = "cut_size")
+ private String cutSize;
+
+ /**
+ * 鍒囨枡灏哄鏁伴噺
+ */
+ @TableField(value = "cut_num")
+ private String cutNum;
+
+ /**
+ * 姝f暟
+ */
+ @TableField(value = "positive_qty")
+ private String positiveQty;
+
+ /**
+ * 鍔犳斁鏁�
+ */
+ @TableField(value = "allowance_qty")
+ private String allowanceQty;
+
+ /**
+ * 鍒剁増
+ */
+ @TableField(value = "plate_making",typeHandler = JacksonTypeHandler.class)
+ private List<PlateMakingDto> plateMaking;
+
+ /**
+ * 宸ュ簭鍔犲伐鍐呭
+ */
+ @TableField(value = "process_content",typeHandler = JacksonTypeHandler.class)
+ private List<ProcessContentDto> processContent;
+
+ /**
+ * 鏉愭枡淇℃伅
+ */
+ @TableField(value = "material_info",typeHandler = JacksonTypeHandler.class)
+ private List<MaterialInfoDto> materialInfo;
+
+ /**
+ * 宸ヨ壓瑕佹眰
+ */
+ @TableField(value = "process_requirement")
+ private String processRequirement;
+
+ /**
+ * 閫佽揣鍦扮偣
+ */
+ @TableField(value = "delivery_address")
+ private String deliveryAddress;
+
+ /**
+ * 鑱旂郴浜�
+ */
+ @TableField(value = "contact_name")
+ private String contactName;
+
+ /**
+ * 鍖呰瑕佹眰
+ */
+ @TableField(value = "packaging_requirement")
+ private String packagingRequirement;
+
+ /**
+ * 鍔犲伐鍚庡昂瀵�
+ */
+ @TableField(value = "post_process_size")
+ private String postProcessSize;
+
+ /**
+ * 璁㈣揣鏁伴噺
+ */
+ @TableField(value = "order_qty")
+ private String orderQty;
+
+ /**
+ * 瀹為檯浜や粯鏁伴噺
+ */
+ @TableField(value = "actual_delivery_qty")
+ private String actualDeliveryQty;
+
+ /**
+ * 鐢熶骇閮ㄩ棬
+ */
+ @TableField(value = "production_dept")
+ private String productionDept;
+
+ /**
+ * 鎶�鏈儴
+ */
+ @TableField(value = "technical_dept")
+ private String technicalDept;
+
+ /**
+ * 搴撴埧
+ */
+ @TableField(value = "warehouse_dept")
+ private String warehouseDept;
+
+ /**
+ *
+ */
+ @TableField(value = "create_time")
+ private LocalDateTime createTime;
+
+ /**
+ *
+ */
+ @TableField(value = "update_time")
+ private LocalDateTime updateTime;
+
+ @TableField(exist = false)
+ private static final long serialVersionUID = 1L;
+
+ /**
+ *
+ */
+ @TableField(value = "create_user",fill = FieldFill.INSERT)
+ @ApiModelProperty(value="鍒涘缓浜�")
+ private Integer createUser;
+
+ /**
+ *
+ */
+ @TableField(value = "update_user",fill = FieldFill.INSERT_UPDATE)
+ @ApiModelProperty(value="鏇存柊浜�")
+ private Integer updateUser;
+
+ @TableField(value = "create_user_name", fill = FieldFill.INSERT)
+ private String createUserName;
+
+ @TableField(value = "update_user_name", fill = FieldFill.INSERT_UPDATE)
+ private String updateUserName;
+}
\ No newline at end of file
diff --git a/src/main/java/com/ruoyi/production/service/ProductionPrintOrderService.java b/src/main/java/com/ruoyi/production/service/ProductionPrintOrderService.java
new file mode 100644
index 0000000..c4fd1b8
--- /dev/null
+++ b/src/main/java/com/ruoyi/production/service/ProductionPrintOrderService.java
@@ -0,0 +1,21 @@
+package com.ruoyi.production.service;
+
+import com.ruoyi.production.dto.SaveProductionPrintOrderDto;
+import com.ruoyi.production.pojo.ProductionPrintOrder;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+* @author buhuazhen
+* @description 閽堝琛ㄣ�恜roduction_print_order(鍗板埛瀹氬嵃鍗�)銆戠殑鏁版嵁搴撴搷浣淪ervice
+* @createDate 2026-04-22 15:14:51
+*/
+public interface ProductionPrintOrderService extends IService<ProductionPrintOrder> {
+
+ /**
+ * 淇濆瓨
+ * @param dto
+ */
+ void save(SaveProductionPrintOrderDto dto);
+
+
+}
diff --git a/src/main/java/com/ruoyi/production/service/impl/ProductionPrintOrderServiceImpl.java b/src/main/java/com/ruoyi/production/service/impl/ProductionPrintOrderServiceImpl.java
new file mode 100644
index 0000000..47dea54
--- /dev/null
+++ b/src/main/java/com/ruoyi/production/service/impl/ProductionPrintOrderServiceImpl.java
@@ -0,0 +1,49 @@
+package com.ruoyi.production.service.impl;
+
+import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.core.util.IdUtil;
+import cn.hutool.core.util.StrUtil;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.ruoyi.production.dto.ProcessContentDto;
+import com.ruoyi.production.dto.SaveProductionPrintOrderDto;
+import com.ruoyi.production.pojo.ProductionPrintOrder;
+import com.ruoyi.production.service.ProductionPrintOrderService;
+import com.ruoyi.production.mapper.ProductionPrintOrderMapper;
+import lombok.RequiredArgsConstructor;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.List;
+
+/**
+* @author buhuazhen
+* @description 閽堝琛ㄣ�恜roduction_print_order(鍗板埛瀹氬嵃鍗�)銆戠殑鏁版嵁搴撴搷浣淪ervice瀹炵幇
+* @createDate 2026-04-22 15:14:51
+*/
+@Service
+@RequiredArgsConstructor
+public class ProductionPrintOrderServiceImpl extends ServiceImpl<ProductionPrintOrderMapper, ProductionPrintOrder>
+ implements ProductionPrintOrderService{
+
+ private final ProductionPrintOrderMapper productionPrintOrderMapper;
+
+ @Override
+ @Transactional
+ public void save(SaveProductionPrintOrderDto dto) {
+ ProductionPrintOrder productionPrintOrder = BeanUtil.copyProperties(dto, ProductionPrintOrder.class);
+
+ List<ProcessContentDto> processContentDtoList = productionPrintOrder.getProcessContent();
+ // 缁欐病鏈塱d鐨勪俊鎭缃畊uid
+ processContentDtoList.forEach(processContentDto -> {
+ if (StrUtil.isBlank(processContentDto.getId())) {
+ processContentDto.setId(IdUtil.simpleUUID());
+ }
+ });
+
+ int i = dto.getId() == null ? productionPrintOrderMapper.insert(productionPrintOrder) : productionPrintOrderMapper.updateById(productionPrintOrder);
+ }
+}
+
+
+
+
diff --git a/src/main/resources/mapper/production/ProductOrderMapper.xml b/src/main/resources/mapper/production/ProductOrderMapper.xml
index 6b993bf..6f99253 100644
--- a/src/main/resources/mapper/production/ProductOrderMapper.xml
+++ b/src/main/resources/mapper/production/ProductOrderMapper.xml
@@ -22,6 +22,7 @@
pm.unit,
ppr.process_route_code,
pb.bom_no,
+ sl.id as sales_ledger_id,
ROUND(po.complete_quantity / po.quantity * 100, 2) AS completionStatus,
DATEDIFF(sl.delivery_date, CURDATE()) AS delivery_days_diff,
sl.delivery_date,
diff --git a/src/main/resources/mapper/production/ProductionPrintOrderMapper.xml b/src/main/resources/mapper/production/ProductionPrintOrderMapper.xml
new file mode 100644
index 0000000..2f3d49b
--- /dev/null
+++ b/src/main/resources/mapper/production/ProductionPrintOrderMapper.xml
@@ -0,0 +1,7 @@
+<?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="com.ruoyi.production.mapper.ProductionPrintOrderMapper">
+
+</mapper>
--
Gitblit v1.9.3