瀏覽代碼

Signed-off-by: ljx <809268652@qq.com>修改B类导入部分数据为空问题

ljx 2 年之前
父節點
當前提交
7b9314a0b8

+ 5 - 0
ruoyi-system/pom.xml

@@ -23,6 +23,11 @@
             <artifactId>ruoyi-common</artifactId>
         </dependency>
 
+        <dependency>
+            <groupId>org.projectlombok</groupId>
+            <artifactId>lombok</artifactId>
+        </dependency>
+
     </dependencies>
 
 </project>

+ 12 - 130
ruoyi-system/src/main/java/com/ruoyi/system/domain/ContractTable.java

@@ -2,6 +2,10 @@ package com.ruoyi.system.domain;
 
 import java.util.Date;
 import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 import org.apache.commons.lang3.builder.ToStringStyle;
 import com.ruoyi.common.annotation.Excel;
@@ -13,6 +17,10 @@ import com.ruoyi.common.core.domain.BaseEntity;
  * @author ruoyi
  * @date 2022-11-25
  */
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+@Builder
 public class ContractTable extends BaseEntity
 {
     private static final long serialVersionUID = 1L;
@@ -26,11 +34,11 @@ public class ContractTable extends BaseEntity
 
     /** 姓名或者单位 */
     @Excel(name = "姓名或者单位",type = Excel.Type.ALL)
-    private String dName;
+    private String name;
 
     /** 身份证或者编码 */
     @Excel(name = "身份证或者编码",type = Excel.Type.ALL)
-    private String dCode;
+    private String code;
 
     /** 证书编码 */
     @Excel(name = "证书编码",type = Excel.Type.ALL)
@@ -51,11 +59,11 @@ public class ContractTable extends BaseEntity
 
     /** 邮箱 */
     @Excel(name = "邮箱",type = Excel.Type.ALL)
-    private String dEmail;
+    private String email;
 
     /** 手机号 */
     @Excel(name = "手机号",type = Excel.Type.ALL)
-    private String dPhone;
+    private String phone;
 
     /** 导入系统的时间戳 */
     private Date updateDate;
@@ -64,130 +72,4 @@ public class ContractTable extends BaseEntity
     @Excel(name = "证书文字",type = Excel.Type.ALL)
     private String certContent;
 
-    public void setId(Long id) 
-    {
-        this.id = id;
-    }
-
-    public Long getId() 
-    {
-        return id;
-    }
-    public void setCertType(Long certType) 
-    {
-        this.certType = certType;
-    }
-
-    public Long getCertType() 
-    {
-        return certType;
-    }
-    public void setdName(String dName) 
-    {
-        this.dName = dName;
-    }
-
-    public String getdName() 
-    {
-        return dName;
-    }
-    public void setdCode(String dCode) 
-    {
-        this.dCode = dCode;
-    }
-
-    public String getdCode() 
-    {
-        return dCode;
-    }
-    public void setCertId(String certId) 
-    {
-        this.certId = certId;
-    }
-
-    public String getCertId() 
-    {
-        return certId;
-    }
-    public void setCertMajor(Integer certMajor) 
-    {
-        this.certMajor = certMajor;
-    }
-
-    public Integer getCertMajor() 
-    {
-        return certMajor;
-    }
-    public void setIssueDate(Date issueDate) 
-    {
-        this.issueDate = issueDate;
-    }
-
-    public Date getIssueDate() 
-    {
-        return issueDate;
-    }
-    public void setValidTerm(String validTerm) 
-    {
-        this.validTerm = validTerm;
-    }
-
-    public String getValidTerm() 
-    {
-        return validTerm;
-    }
-    public void setdEmail(String dEmail) 
-    {
-        this.dEmail = dEmail;
-    }
-
-    public String getdEmail() 
-    {
-        return dEmail;
-    }
-    public void setdPhone(String dPhone) 
-    {
-        this.dPhone = dPhone;
-    }
-
-    public String getdPhone() 
-    {
-        return dPhone;
-    }
-    public void setUpdateDate(Date updateDate) 
-    {
-        this.updateDate = updateDate;
-    }
-
-    public Date getUpdateDate() 
-    {
-        return updateDate;
-    }
-    public void setCertContent(String certContent) 
-    {
-        this.certContent = certContent;
-    }
-
-    public String getCertContent() 
-    {
-        return certContent;
-    }
-
-    @Override
-    public String toString() {
-        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
-            .append("id", getId())
-            .append("certType", getCertType())
-            .append("dName", getdName())
-            .append("dCode", getdCode())
-            .append("certId", getCertId())
-            .append("certMajor", getCertMajor())
-            .append("issueDate", getIssueDate())
-            .append("validTerm", getValidTerm())
-            .append("dEmail", getdEmail())
-            .append("dPhone", getdPhone())
-            .append("updateDate", getUpdateDate())
-            .append("certContent", getCertContent())
-            .toString();
-    }
 }

+ 5 - 5
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ContractTableServiceImpl.java

@@ -117,14 +117,14 @@ public class ContractTableServiceImpl implements IContractTableService
             try
             {
                 // 验证是否存在这个用户
-                ContractTable u = contractTableMapper.selectContractTableByCode(con.getdCode());
+                ContractTable u = contractTableMapper.selectContractTableByCode(con.getCode());
                 if (StringUtils.isNull(u))
                 {
                     BeanValidators.validateWithException(validator, con);
                     con.setCreateBy(operName);
                     this.insertContractTable(con);
                     successNum++;
-                    successMsg.append("<br/>" + successNum + "、身份证或者编码 " + con.getdCode() + " 导入成功");
+                    successMsg.append("<br/>" + successNum + "、身份证或者编码 " + con.getCode() + " 导入成功");
                 }
                 else if (isUpdateSupport)
                 {
@@ -132,18 +132,18 @@ public class ContractTableServiceImpl implements IContractTableService
                     con.setUpdateBy(operName);
                     this.updateContractTable(con);
                     successNum++;
-                    successMsg.append("<br/>" + successNum + "、身份证或者编码 " + con.getdCode() + " 更新成功");
+                    successMsg.append("<br/>" + successNum + "、身份证或者编码 " + con.getCode() + " 更新成功");
                 }
                 else
                 {
                     failureNum++;
-                    failureMsg.append("<br/>" + failureNum + "、身份证或者编码 " + con.getdCode() + " 已存在");
+                    failureMsg.append("<br/>" + failureNum + "、身份证或者编码 " + con.getCode() + " 已存在");
                 }
             }
             catch (Exception e)
             {
                 failureNum++;
-                String msg = "<br/>" + failureNum + "、身份证或者编码 " + con.getdCode() + " 导入失败:";
+                String msg = "<br/>" + failureNum + "、身份证或者编码 " + con.getCode() + " 导入失败:";
                 failureMsg.append(msg + e.getMessage());
             }
         }

+ 22 - 22
ruoyi-system/src/main/resources/mapper/system/ContractTableMapper.xml

@@ -7,32 +7,32 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <resultMap type="ContractTable" id="ContractTableResult">
         <result property="id"    column="id"    />
         <result property="certType"    column="cert_type"    />
-        <result property="dName"    column="d_name"    />
-        <result property="dCode"    column="d_code"    />
+        <result property="name"    column="name"    />
+        <result property="code"    column="code"    />
         <result property="certId"    column="cert_id"    />
         <result property="certMajor"    column="cert_major"    />
         <result property="issueDate"    column="issue_date"    />
         <result property="validTerm"    column="valid_term"    />
-        <result property="dEmail"    column="d_email"    />
-        <result property="dPhone"    column="d_phone"    />
+        <result property="email"    column="email"    />
+        <result property="phone"    column="phone"    />
         <result property="updateDate"    column="update_date"    />
         <result property="certContent"    column="cert_content"    />
     </resultMap>
 
     <sql id="selectContractTableVo">
-        select id, cert_type, d_name, d_code, cert_id, cert_major, issue_date, valid_term, d_email, d_phone, update_date, cert_content from contract_table
+        select id, cert_type, name, code, cert_id, cert_major, issue_date, valid_term, email, phone, update_date, cert_content from contract_table
     </sql>
 
     <select id="selectContractTableList" parameterType="ContractTable" resultMap="ContractTableResult">
         <include refid="selectContractTableVo"/>
         <where>  
             <if test="certType != null "> and cert_type = #{certType}</if>
-            <if test="dName != null  and dName != ''"> and d_name like concat('%', #{dName}, '%')</if>
-            <if test="dCode != null  and dCode != ''"> and d_code = #{dCode}</if>
+            <if test="name != null  and name != ''"> and name like concat('%', #{name}, '%')</if>
+            <if test="code != null  and code != ''"> and code = #{code}</if>
             <if test="certId != null  and certId != ''"> and cert_id = #{certId}</if>
             <if test="certMajor != null "> and cert_major = #{certMajor}</if>
-            <if test="dEmail != null  and dEmail != ''"> and d_email = #{dEmail}</if>
-            <if test="dPhone != null  and dPhone != ''"> and d_phone = #{dPhone}</if>
+            <if test="email != null  and email != ''"> and email = #{email}</if>
+            <if test="phone != null  and phone != ''"> and phone = #{phone}</if>
         </where>
     </select>
     
@@ -43,7 +43,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     <select id="selectContractTableByCode" parameterType="String" resultMap="ContractTableResult">
         <include refid="selectContractTableVo"/>
-        where d_code = #{dCode}
+        where code = #{code}
     </select>
 
         
@@ -51,27 +51,27 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         insert into contract_table
         <trim prefix="(" suffix=")" suffixOverrides=",">
             <if test="certType != null">cert_type,</if>
-            <if test="dName != null and dName != ''">d_name,</if>
-            <if test="dCode != null">d_code,</if>
+            <if test="name != null and name != ''">name,</if>
+            <if test="code != null">code,</if>
             <if test="certId != null and certId != ''">cert_id,</if>
             <if test="certMajor != null">cert_major,</if>
             <if test="issueDate != null">issue_date,</if>
             <if test="validTerm != null and validTerm != ''">valid_term,</if>
-            <if test="dEmail != null">d_email,</if>
-            <if test="dPhone != null">d_phone,</if>
+            <if test="email != null">email,</if>
+            <if test="phone != null">phone,</if>
             <if test="updateDate != null">update_date,</if>
             <if test="certContent != null">cert_content,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="certType != null">#{certType},</if>
-            <if test="dName != null and dName != ''">#{dName},</if>
-            <if test="dCode != null">#{dCode},</if>
+            <if test="name != null and name != ''">#{name},</if>
+            <if test="code != null">#{code},</if>
             <if test="certId != null and certId != ''">#{certId},</if>
             <if test="certMajor != null">#{certMajor},</if>
             <if test="issueDate != null">#{issueDate},</if>
             <if test="validTerm != null and validTerm != ''">#{validTerm},</if>
-            <if test="dEmail != null">#{dEmail},</if>
-            <if test="dPhone != null">#{dPhone},</if>
+            <if test="email != null">#{email},</if>
+            <if test="phone != null">#{phone},</if>
             <if test="updateDate != null">#{updateDate},</if>
             <if test="certContent != null">#{certContent},</if>
          </trim>
@@ -81,14 +81,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         update contract_table
         <trim prefix="SET" suffixOverrides=",">
             <if test="certType != null">cert_type = #{certType},</if>
-            <if test="dName != null and dName != ''">d_name = #{dName},</if>
-            <if test="dCode != null">d_code = #{dCode},</if>
+            <if test="name != null and name != ''">name = #{name},</if>
+            <if test="code != null">code = #{code},</if>
             <if test="certId != null and certId != ''">cert_id = #{certId},</if>
             <if test="certMajor != null">cert_major = #{certMajor},</if>
             <if test="issueDate != null">issue_date = #{issueDate},</if>
             <if test="validTerm != null and validTerm != ''">valid_term = #{validTerm},</if>
-            <if test="dEmail != null">d_email = #{dEmail},</if>
-            <if test="dPhone != null">d_phone = #{dPhone},</if>
+            <if test="email != null">email = #{email},</if>
+            <if test="phone != null">phone = #{phone},</if>
             <if test="updateDate != null">update_date = #{updateDate},</if>
             <if test="certContent != null">cert_content = #{certContent},</if>
         </trim>