From eee53d706bc20edd58b26807e1e41ff8aa05fbc7 Mon Sep 17 00:00:00 2001
From: BAOLH <baolh@yhzhg.cn>
Date: Thu, 26 Feb 2026 09:01:05 +0000
Subject: [PATCH] 新增合同邮寄相关(补充)

---
 eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/contract/service/dto/ContractMailDto.java          |   30 ++++++++++
 eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/contract/service/impl/ContractMailServiceImpl.java |   13 ++++
 eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/contract/domain/ContractMail.java                  |   32 ++++++++++
 eladmin-web-master/src/views/contract/contractMail/index.vue                                                       |  100 +++++++++++++++++++++++++++++++++
 4 files changed, 174 insertions(+), 1 deletions(-)

diff --git a/eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/contract/domain/ContractMail.java b/eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/contract/domain/ContractMail.java
index 7cb2df2..f487de9 100644
--- a/eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/contract/domain/ContractMail.java
+++ b/eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/contract/domain/ContractMail.java
@@ -66,6 +66,38 @@
     @ApiModelProperty(value = "备注信息")
     private String remarks;
 
+    @Column(name = "`first_id`")
+    @ApiModelProperty(value = "甲方信息ID")
+    private Long firstId;
+
+    @Column(name = "`second_id`")
+    @ApiModelProperty(value = "乙方信息ID")
+    private Long secondId;
+
+    @Column(name = "`mail_sender_name`")
+    @ApiModelProperty(value = "寄件人姓名")
+    private String mailSenderName;
+
+    @Column(name = "`mail_sender_tel`")
+    @ApiModelProperty(value = "寄件人联系方式")
+    private String mailSenderTel;
+
+    @Column(name = "`mail_sender_addr`")
+    @ApiModelProperty(value = "寄件地址")
+    private String mailSenderAddr;
+
+    @Column(name = "`mail_consignee_name`")
+    @ApiModelProperty(value = "收件人姓名")
+    private String mailConsigneeName;
+
+    @Column(name = "`mail_consignee_tel`")
+    @ApiModelProperty(value = "收件人联系方式")
+    private String mailConsigneeTel;
+
+    @Column(name = "`mail_consignee_addr`")
+    @ApiModelProperty(value = "收件地址")
+    private String mailConsigneeAddr;
+
     public void copy(ContractMail source){
         BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
     }
diff --git a/eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/contract/service/dto/ContractMailDto.java b/eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/contract/service/dto/ContractMailDto.java
index c159dc3..33af5eb 100644
--- a/eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/contract/service/dto/ContractMailDto.java
+++ b/eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/contract/service/dto/ContractMailDto.java
@@ -51,6 +51,36 @@
     /** 备注信息 */
     private String remarks;
 
+    /** 甲方信息ID */
+    private Long firstId;
+
+    /** 乙方信息ID */
+    private Long secondId;
+
+    /** 寄件人姓名 */
+    private String mailSenderName;
+
+    /** 寄件人联系方式 */
+    private String mailSenderTel;
+
+    /** 寄件地址 */
+    private String mailSenderAddr;
+
+    /** 收件人姓名 */
+    private String mailConsigneeName;
+
+    /** 收件人联系方式 */
+    private String mailConsigneeTel;
+
+    /** 收件地址 */
+    private String mailConsigneeAddr;
+
     /** 合同名称 */
     private String contractName;
+
+    /** 甲方名称 */
+    private String firstName;
+
+    /** 乙方名称 */
+    private String secondName;
 }
\ No newline at end of file
diff --git a/eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/contract/service/impl/ContractMailServiceImpl.java b/eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/contract/service/impl/ContractMailServiceImpl.java
index 7039184..f186a48 100644
--- a/eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/contract/service/impl/ContractMailServiceImpl.java
+++ b/eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/contract/service/impl/ContractMailServiceImpl.java
@@ -16,8 +16,12 @@
 package me.zhengjie.modules.contract.service.impl;
 
 import me.zhengjie.modules.contract.domain.Contract;
+import me.zhengjie.modules.contract.domain.ContractFirst;
 import me.zhengjie.modules.contract.domain.ContractMail;
+import me.zhengjie.modules.contract.domain.ContractSecond;
+import me.zhengjie.modules.contract.repository.ContractFirstRepository;
 import me.zhengjie.modules.contract.repository.ContractRepository;
+import me.zhengjie.modules.contract.repository.ContractSecondRepository;
 import me.zhengjie.utils.ValidationUtil;
 import me.zhengjie.utils.FileUtil;
 import lombok.RequiredArgsConstructor;
@@ -52,6 +56,8 @@
 
     private final ContractMailRepository contractMailRepository;
     private final ContractRepository contractRepository;
+    private final ContractFirstRepository contractFirstRepository;
+    private final ContractSecondRepository contractSecondRepository;
     private final ContractMailMapper contractMailMapper;
 
     @Override
@@ -64,8 +70,15 @@
                 ContractMailDto contractMailDto = contractMailMapper.toDto(t);
                 // 查询合同数据
                 Contract contract = contractRepository.findById(t.getContractId()).orElseGet(Contract::new);
+                // 查询合同数据
+                ContractFirst contractFirst = contractFirstRepository.findById(t.getFirstId()).orElseGet(ContractFirst::new);
+                // 查询合同数据
+                ContractSecond contractSecond = contractSecondRepository.findById(t.getSecondId()).orElseGet(ContractSecond::new);
+
                 // DTO赋值
                 contractMailDto.setContractName(contract.getContractName());
+                contractMailDto.setFirstName(contractFirst.getFirstName());
+                contractMailDto.setSecondName(contractSecond.getSecondName());
                 // 返回处理好的DTO
                 return contractMailDto;
             }
diff --git a/eladmin-web-master/src/views/contract/contractMail/index.vue b/eladmin-web-master/src/views/contract/contractMail/index.vue
index 225b375..919c2c5 100644
--- a/eladmin-web-master/src/views/contract/contractMail/index.vue
+++ b/eladmin-web-master/src/views/contract/contractMail/index.vue
@@ -28,6 +28,26 @@
       <!--表单组件-->
       <el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="540px">
         <el-form ref="form" :model="form" :rules="rules" size="small" label-width="120px">
+          <el-form-item label="甲方" prop="firstId">
+            <el-select v-model="form.firstId" filterable clearable placeholder="请选择" style="width: 370px;">
+              <el-option
+                v-for="fItem in firstList"
+                :key="'form_first_' + fItem.firstId"
+                :label="fItem.firstName"
+                :value="fItem.firstId"
+              />
+            </el-select>
+          </el-form-item>
+          <el-form-item label="乙方" prop="secondId">
+            <el-select v-model="form.secondId" filterable clearable placeholder="请选择" style="width: 370px;">
+              <el-option
+                v-for="sItem in secondList"
+                :key="'form_second_' + sItem.secondId"
+                :label="sItem.secondName"
+                :value="sItem.secondId"
+              />
+            </el-select>
+          </el-form-item>
           <el-form-item label="所属合同" prop="contractId">
             <el-select v-model="form.contractId" filterable clearable placeholder="请选择" style="width: 370px;">
               <el-option
@@ -37,6 +57,24 @@
                 :value="item.contractId"
               />
             </el-select>
+          </el-form-item>
+          <el-form-item label="寄件人姓名" prop="mailSenderName">
+            <el-input v-model="form.mailSenderName" placeholder="请输入" style="width: 370px;" />
+          </el-form-item>
+          <el-form-item label="寄件人电话" prop="mailSenderTel">
+            <el-input v-model="form.mailSenderTel" placeholder="请输入" style="width: 370px;" />
+          </el-form-item>
+          <el-form-item label="寄件地址" prop="mailSenderAddr">
+            <el-input v-model="form.mailSenderAddr" placeholder="请输入" style="width: 370px;" />
+          </el-form-item>
+          <el-form-item label="收件人姓名" prop="mailConsigneeName">
+            <el-input v-model="form.mailConsigneeName" placeholder="请输入" style="width: 370px;" />
+          </el-form-item>
+          <el-form-item label="收件人电话" prop="mailConsigneeTel">
+            <el-input v-model="form.mailConsigneeTel" placeholder="请输入" style="width: 370px;" />
+          </el-form-item>
+          <el-form-item label="收件地址" prop="mailConsigneeAddr">
+            <el-input v-model="form.mailConsigneeAddr" placeholder="请输入" style="width: 370px;" />
           </el-form-item>
           <el-form-item label="邮件发送时间" prop="mailSendTime">
             <el-date-picker v-model="form.mailSendTime" type="date" placeholder="请选择" style="width: 370px;" />
@@ -69,7 +107,13 @@
       <!--表格渲染-->
       <el-table ref="table" v-loading="crud.loading" :data="crud.data" size="small" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
         <el-table-column type="selection" width="55" />
+        <el-table-column prop="firstName" label="甲方名称" :show-overflow-tooltip="true" />
+        <el-table-column prop="secondName" label="乙方名称" :show-overflow-tooltip="true" />
         <el-table-column prop="contractName" label="所属合同" :show-overflow-tooltip="true" />
+        <el-table-column prop="mailSenderName" label="寄件人姓名" />
+        <el-table-column prop="mailSenderTel" label="寄件人电话" />
+        <el-table-column prop="mailConsigneeName" label="收件人姓名" />
+        <el-table-column prop="mailConsigneeTel" label="收件人电话" />
         <el-table-column prop="mailSendTime" label="邮件发送时间">
           <template slot-scope="scope">
             {{ parseTime(scope.row.mailSendTime, '{y}年{m}月{d}日') }}
@@ -97,6 +141,8 @@
 <script>
 import crudContractMail from '@/api/contract/contractMail'
 import crudContract from '@/api/contract/contract'
+import crudContractFirst from '@/api/contract/contractFirst'
+import crudContractSecond from '@/api/contract/contractSecond'
 import CRUD, { presenter, header, form, crud } from '@crud/crud'
 import rrOperation from '@crud/RR.operation'
 import crudOperation from '@crud/CRUD.operation'
@@ -104,7 +150,7 @@
 import pagination from '@crud/Pagination'
 import constant from '../../../utils/constant'
 
-const defaultForm = { id: null, contractId: null, mailSendTime: null, mailTrackingNo: null, mailMethod: null, mailContent: null, remarks: null, createBy: null, updateBy: null, createTime: null, updateTime: null, contractName: null }
+const defaultForm = { id: null, contractId: null, mailSendTime: null, mailTrackingNo: null, mailMethod: null, mailContent: null, remarks: null, createBy: null, updateBy: null, createTime: null, updateTime: null, firstId: null, secondId: null, mailSenderName: null, mailSenderTel: null, mailSenderAddr: null, mailConsigneeName: null, mailConsigneeTel: null, mailConsigneeAddr: null, contractName: null, firstName: null, secondName: null }
 export default {
   name: 'ContractMail',
   components: { pagination, crudOperation, rrOperation, udOperation },
@@ -136,10 +182,38 @@
         ],
         mailContent: [
           { required: true, message: '请输入邮件内容', trigger: 'blur' }
+        ],
+        firstId: [
+          { required: true, message: '请选择甲方', trigger: 'change' }
+        ],
+        secondId: [
+          { required: true, message: '请选择乙方', trigger: 'change' }
+        ],
+        mailSenderName: [
+          { required: true, message: '请输入寄件人姓名', trigger: 'blur' }
+        ],
+        mailSenderTel: [
+          { required: true, message: '请输入寄件人电话', trigger: 'blur' }
+        ],
+        mailSenderAddr: [
+          { required: true, message: '请输入寄件地址', trigger: 'blur' }
+        ],
+        mailConsigneeName: [
+          { required: true, message: '请输入收件人姓名', trigger: 'blur' }
+        ],
+        mailConsigneeTel: [
+          { required: true, message: '请输入收件人电话', trigger: 'blur' }
+        ],
+        mailConsigneeAddr: [
+          { required: true, message: '请输入收件地址', trigger: 'blur' }
         ]
       },
       // 合同数据
       contractList: [],
+      // 甲方数据
+      firstList: [],
+      // 乙方数据
+      secondList: [],
       // 字典:邮寄类型
       mailMethod: constant.MAIL_METHOD
     }
@@ -150,6 +224,10 @@
       const that = this
       // 获取合同数据
       that.getContractList()
+      // 获取甲方数据
+      that.getFirstList()
+      // 获取乙方数据
+      that.getSecondList()
       return true
     },
 
@@ -161,6 +239,26 @@
         // 获取合同数据
         that.contractList = res
       })
+    },
+
+    // 获取甲方数据
+    getFirstList() {
+      const that = this
+      // 获取甲方数据
+      crudContractFirst.getAll().then(res => {
+        // 获取甲方数据
+        that.firstList = res
+      })
+    },
+
+    // 获取乙方数据
+    getSecondList() {
+      const that = this
+      // 获取乙方数据
+      crudContractSecond.getAll().then(res => {
+        // 获取乙方数据
+        that.secondList = res
+      })
     }
   }
 }

--
Gitblit v1.9.3