Browse Source

Merge branch 'invest-dev' of http://git.dgtis.com/15896567520/RuoYi-flowable-master into invest-dev

armg 1 year ago
parent
commit
5cbd756f9e

+ 15 - 2
ruoyi-admin/src/main/java/com/ruoyi/web/controller/invest/TProjectChannelController.java

@@ -107,8 +107,8 @@ public class TProjectChannelController extends BaseController
         if(!tUnifyFileList.isEmpty()){
             for (TUnifyFile tUnifyFile:
                     tUnifyFileList) {
-                tUnifyFile.setFileBusinessId(tProjectChannel.getId());//公司ID
-                tUnifyFile.setUploadType(String.valueOf(FileType.CHANNEL.ordinal()));//文件类型:公司信息
+                tUnifyFile.setFileBusinessId(tProjectChannel.getId());//渠道ID
+                tUnifyFile.setUploadType(String.valueOf(FileType.CHANNEL.ordinal()));//文件类型:渠道
                 tUnifyFile.setCreateBy(getNickName());
                 tUnifyFileService.insertTUnifyFile(tUnifyFile);
             }
@@ -125,6 +125,19 @@ public class TProjectChannelController extends BaseController
     @PutMapping
     public AjaxResult edit(@RequestBody TProjectChannel tProjectChannel)
     {
+        // todo 保存附件信息
+        List<TUnifyFile> tUnifyFileList = tProjectChannel.getListFile();
+        if(!tUnifyFileList.isEmpty()){
+            for (TUnifyFile tUnifyFile:
+                    tUnifyFileList) {
+                if(tUnifyFile.getId() == null){
+                    tUnifyFile.setFileBusinessId(tProjectChannel.getId());//渠道ID
+                    tUnifyFile.setUploadType(String.valueOf(FileType.CHANNEL.ordinal()));//文件类型:渠道
+                    tUnifyFile.setCreateBy(getNickName());
+                    tUnifyFileService.insertTUnifyFile(tUnifyFile);
+                }
+            }
+        }
         return toAjax(tProjectChannelService.updateTProjectChannel(tProjectChannel));
     }
 

+ 13 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/invest/TProjectCompanyController.java

@@ -125,6 +125,19 @@ public class TProjectCompanyController extends BaseController
     @PutMapping
     public AjaxResult edit(@RequestBody TProjectCompany tProjectCompany)
     {
+        // todo 保存附件信息
+        List<TUnifyFile> tUnifyFileList = tProjectCompany.getListFile();
+        if(!tUnifyFileList.isEmpty()){
+            for (TUnifyFile tUnifyFile:
+                    tUnifyFileList) {
+                if(tUnifyFile.getId() == null){
+                    tUnifyFile.setFileBusinessId(tProjectCompany.getId());//公司ID
+                    tUnifyFile.setUploadType(String.valueOf(FileType.COMPANY.ordinal()));//文件类型:公司信息
+                    tUnifyFile.setCreateBy(getNickName());
+                    tUnifyFileService.insertTUnifyFile(tUnifyFile);
+                }
+            }
+        }
         return toAjax(tProjectCompanyService.updateTProjectCompany(tProjectCompany));
     }
 

+ 15 - 2
ruoyi-admin/src/main/java/com/ruoyi/web/controller/invest/TProjectContractController.java

@@ -108,8 +108,8 @@ public class TProjectContractController extends BaseController
         if(!tUnifyFileList.isEmpty()){
             for (TUnifyFile tUnifyFile:
                     tUnifyFileList) {
-                tUnifyFile.setFileBusinessId(tProjectContract.getId());//公司ID
-                tUnifyFile.setUploadType(String.valueOf(FileType.CONTRACT.ordinal()));//文件类型:公司信息
+                tUnifyFile.setFileBusinessId(tProjectContract.getId());//合同ID
+                tUnifyFile.setUploadType(String.valueOf(FileType.CONTRACT.ordinal()));//文件类型:合同
                 tUnifyFile.setCreateBy(getNickName());
                 tUnifyFileService.insertTUnifyFile(tUnifyFile);
             }
@@ -126,6 +126,19 @@ public class TProjectContractController extends BaseController
     @PutMapping
     public AjaxResult edit(@RequestBody TProjectContract tProjectContract)
     {
+        // todo 保存附件信息
+        List<TUnifyFile> tUnifyFileList = tProjectContract.getListFile();
+        if(!tUnifyFileList.isEmpty()){
+            for (TUnifyFile tUnifyFile:
+                    tUnifyFileList) {
+                if(tUnifyFile.getId() == null){
+                    tUnifyFile.setFileBusinessId(tProjectContract.getId());//合同ID
+                    tUnifyFile.setUploadType(String.valueOf(FileType.CONTRACT.ordinal()));//文件类型:合同
+                    tUnifyFile.setCreateBy(getNickName());
+                    tUnifyFileService.insertTUnifyFile(tUnifyFile);
+                }
+            }
+        }
         return toAjax(tProjectContractService.updateTProjectContract(tProjectContract));
     }
 

+ 0 - 1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/invest/TProjectPoolController.java

@@ -208,7 +208,6 @@ public class TProjectPoolController extends BaseController
         // todo 增加项目创建记录
         TProjectCirculation tProjectCirculation = new TProjectCirculation();
         tProjectCirculation.setProjectPoolId(tProjectPool.getId());
-        tProjectCirculation.setStageName("项目报备");
         tProjectCirculation.setCreateBy(getNickName());
         tProjectCirculationService.insertTProjectCirculation(tProjectCirculation);
 

+ 2 - 2
ruoyi-admin/src/main/java/com/ruoyi/web/controller/invest/TProjectRecordController.java

@@ -159,8 +159,8 @@ public class TProjectRecordController extends BaseController
     @ApiOperation("根据项目ID获取跟进记录")
     @PreAuthorize("@ss.hasPermi('invest:meeting:query')")
     @GetMapping(value = "/listPorjectId")
-    public AjaxResult listPorjectId(String porjectId)
+    public AjaxResult listPorjectId(String projectId)
     {
-        return success(tProjectRecordService.listPorjectId(porjectId));
+        return success(tProjectRecordService.listProjectId(projectId));
     }
 }

+ 1 - 1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/TUnifyFileController.java

@@ -43,7 +43,7 @@ import org.springframework.web.multipart.MultipartFile;
  * @author ruoyi
  * @date 2024-02-23
  */
-@Api("附件管理")
+@Api(tags = "附件管理")
 @RestController
 @RequestMapping("/system/file")
 public class TUnifyFileController extends BaseController

+ 18 - 18
ruoyi-system/src/main/java/com/ruoyi/invest/domain/TProjectPool.java

@@ -27,18 +27,18 @@ public class TProjectPool extends BaseEntity
 
     /** 项目名称 */
     @Excel(name = "项目名称")
-    private String porjectName;
+    private String projectName;
 
     /** 所属组别 */
     @Excel(name = "所属组别")
-    private String porjectGroup;
+    private String projectGroup;
 
     /** 录入日期 */
     private Date recordDate;
 
     /** 项目编号 */
     @Excel(name = "项目编号")
-    private String porjectCode;
+    private String projectCode;
 
     /** 渠道 */
     @Excel(name = "渠道")
@@ -164,23 +164,23 @@ public class TProjectPool extends BaseEntity
     {
         return id;
     }
-    public void setPorjectName(String porjectName) 
+    public void setProjectName(String projectName)
     {
-        this.porjectName = porjectName;
+        this.projectName = projectName;
     }
 
-    public String getPorjectName() 
+    public String getProjectName()
     {
-        return porjectName;
+        return projectName;
     }
-    public void setPorjectGroup(String porjectGroup) 
+    public void setProjectGroup(String projectGroup)
     {
-        this.porjectGroup = porjectGroup;
+        this.projectGroup = projectGroup;
     }
 
-    public String getPorjectGroup() 
+    public String getProjectGroup()
     {
-        return porjectGroup;
+        return projectGroup;
     }
     public void setRecordDate(Date recordDate) 
     {
@@ -191,14 +191,14 @@ public class TProjectPool extends BaseEntity
     {
         return recordDate;
     }
-    public void setPorjectCode(String porjectCode) 
+    public void setProjectCode(String projectCode)
     {
-        this.porjectCode = porjectCode;
+        this.projectCode = projectCode;
     }
 
-    public String getPorjectCode() 
+    public String getProjectCode()
     {
-        return porjectCode;
+        return projectCode;
     }
     public void setChannel(String channel) 
     {
@@ -462,10 +462,10 @@ public class TProjectPool extends BaseEntity
     public String toString() {
         return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
             .append("id", getId())
-            .append("porjectName", getPorjectName())
-            .append("porjectGroup", getPorjectGroup())
+            .append("projectName", getProjectName())
+            .append("projectGroup", getProjectGroup())
             .append("recordDate", getRecordDate())
-            .append("porjectCode", getPorjectCode())
+            .append("projectCode", getProjectCode())
             .append("channel", getChannel())
             .append("contactDate", getContactDate())
             .append("projectDate", getProjectDate())

+ 19 - 6
ruoyi-system/src/main/java/com/ruoyi/invest/domain/TProjectRecord.java

@@ -30,7 +30,7 @@ public class TProjectRecord extends BaseEntity
     /** 项目ID */
     @ApiModelProperty("项目ID")
     @Excel(name = "项目ID")
-    private String porjectId;
+    private String projectId;
 
     /** 联系人 */
     @ApiModelProperty("联系人")
@@ -70,6 +70,11 @@ public class TProjectRecord extends BaseEntity
      */
     private List<TUnifyFile> listFile;
 
+    /**
+     * 项目池信息
+     */
+    private TProjectPool tProjectPool;
+
     public void setId(String id) 
     {
         this.id = id;
@@ -79,14 +84,14 @@ public class TProjectRecord extends BaseEntity
     {
         return id;
     }
-    public void setPorjectId(String porjectId) 
+    public void setProjectId(String projectId)
     {
-        this.porjectId = porjectId;
+        this.projectId = projectId;
     }
 
-    public String getPorjectId() 
+    public String getProjectId()
     {
-        return porjectId;
+        return projectId;
     }
     public void setContacts(String contacts) 
     {
@@ -160,11 +165,19 @@ public class TProjectRecord extends BaseEntity
         this.listFile = listFile;
     }
 
+    public TProjectPool gettProjectPool() {
+        return tProjectPool;
+    }
+
+    public void settProjectPool(TProjectPool tProjectPool) {
+        this.tProjectPool = tProjectPool;
+    }
+
     @Override
     public String toString() {
         return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
             .append("id", getId())
-            .append("porjectId", getPorjectId())
+            .append("projectId", getProjectId())
             .append("contacts", getContacts())
             .append("realityUpDate", getRealityUpDate())
             .append("upPerson", getUpPerson())

+ 2 - 2
ruoyi-system/src/main/java/com/ruoyi/invest/mapper/TProjectRecordMapper.java

@@ -70,8 +70,8 @@ public interface TProjectRecordMapper
 
     /**
      * 根据项目ID获取跟进记录
-     * @param porjectId
+     * @param projectId
      * @return
      */
-    List<TProjectRecord> listPorjectId(String porjectId);
+    List<TProjectRecord> listProjectId(String projectId);
 }

+ 1 - 1
ruoyi-system/src/main/java/com/ruoyi/invest/service/ITProjectRecordService.java

@@ -74,5 +74,5 @@ public interface ITProjectRecordService
      * @param porjectId
      * @return
      */
-    public List<TProjectRecord> listPorjectId(String porjectId);
+    public List<TProjectRecord> listProjectId(String porjectId);
 }

+ 3 - 3
ruoyi-system/src/main/java/com/ruoyi/invest/service/impl/TProjectRecordServiceImpl.java

@@ -109,11 +109,11 @@ public class TProjectRecordServiceImpl implements ITProjectRecordService
 
     /**
      * 根据项目ID获取跟进记录
-     * @param porjectId
+     * @param projectId
      * @return
      */
     @Override
-    public List<TProjectRecord> listPorjectId(String porjectId) {
-        return tProjectRecordMapper.listPorjectId(porjectId);
+    public List<TProjectRecord> listProjectId(String projectId) {
+        return tProjectRecordMapper.listProjectId(projectId);
     }
 }

File diff suppressed because it is too large
+ 16 - 16
ruoyi-system/src/main/resources/mapper/invest/TProjectPoolMapper.xml


+ 26 - 14
ruoyi-system/src/main/resources/mapper/invest/TProjectRecordMapper.xml

@@ -6,7 +6,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     
     <resultMap type="TProjectRecord" id="TProjectRecordResult">
         <result property="id"    column="id"    />
-        <result property="porjectId"    column="porject_id"    />
+        <result property="projectId"    column="project_id"    />
         <result property="contacts"    column="contacts"    />
         <result property="realityUpDate"    column="reality_up_date"    />
         <result property="upPerson"    column="up_person"    />
@@ -18,34 +18,46 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="createTime"    column="create_time"    />
         <result property="updateBy"    column="update_by"    />
         <result property="updateTime"    column="update_time"    />
+
+        <association property="tProjectPool" javaType="TProjectPool"  resultMap="TProjectPoolResult" />
+
+    </resultMap>
+
+    <resultMap type="TProjectPool" id="TProjectPoolResult">
+        <result property="projectName"    column="project_name"    />
+        <result property="projectStage"    column="project_stage"    />
+        <result property="projectState"    column="project_state"    />
     </resultMap>
 
     <sql id="selectTProjectRecordVo">
-        select id, porject_id, contacts, reality_up_date, up_person, up_way, up_content, mark, del_flag, create_by, create_time, update_by, update_time from t_project_record
+        select a.id, a.project_id, a.contacts, a.reality_up_date, a.up_person, a.up_way, a.up_content, a.mark, a.del_flag, a.create_by, a.create_time, a.update_by, a.update_time,
+               b.project_name, b.project_stage, b.project_state
+        from t_project_record a
+            left join t_project_pool b ON a.project_id = b.id
     </sql>
 
     <select id="selectTProjectRecordList" parameterType="TProjectRecord" resultMap="TProjectRecordResult">
         <include refid="selectTProjectRecordVo"/>
         <where>
-            del_flag = 0
-            <if test="porjectId != null  and porjectId != ''"> and porject_id = #{porjectId}</if>
-            <if test="contacts != null  and contacts != ''"> and contacts = #{contacts}</if>
-            <if test="realityUpDate != null "> and reality_up_date = #{realityUpDate}</if>
-            <if test="upPerson != null  and upPerson != ''"> and up_person = #{upPerson}</if>
-            <if test="upWay != null  and upWay != ''"> and up_way = #{upWay}</if>
+            a.del_flag = 0
+            <if test="projectId != null  and projectId != ''"> and a.project_id = #{projectId}</if>
+            <if test="contacts != null  and contacts != ''"> and a.contacts = #{contacts}</if>
+            <if test="realityUpDate != null "> and a.reality_up_date = #{realityUpDate}</if>
+            <if test="upPerson != null  and upPerson != ''"> and a.up_person = #{upPerson}</if>
+            <if test="upWay != null  and upWay != ''"> and a.up_way = #{upWay}</if>
         </where>
     </select>
     
     <select id="selectTProjectRecordById" parameterType="String" resultMap="TProjectRecordResult">
         <include refid="selectTProjectRecordVo"/>
-        where id = #{id}
+        where a.id = #{id}
     </select>
         
     <insert id="insertTProjectRecord" parameterType="TProjectRecord">
         insert into t_project_record
         <trim prefix="(" suffix=")" suffixOverrides=",">
             <if test="id != null">id,</if>
-            <if test="porjectId != null">porject_id,</if>
+            <if test="projectId != null">project_id,</if>
             <if test="contacts != null">contacts,</if>
             <if test="realityUpDate != null">reality_up_date,</if>
             <if test="upPerson != null">up_person,</if>
@@ -60,7 +72,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="id != null">#{id},</if>
-            <if test="porjectId != null">#{porjectId},</if>
+            <if test="projectId != null">#{projectId},</if>
             <if test="contacts != null">#{contacts},</if>
             <if test="realityUpDate != null">#{realityUpDate},</if>
             <if test="upPerson != null">#{upPerson},</if>
@@ -78,7 +90,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <update id="updateTProjectRecord" parameterType="TProjectRecord">
         update t_project_record
         <trim prefix="SET" suffixOverrides=",">
-            <if test="porjectId != null">porject_id = #{porjectId},</if>
+            <if test="projectId != null">project_id = #{projectId},</if>
             <if test="contacts != null">contacts = #{contacts},</if>
             <if test="realityUpDate != null">reality_up_date = #{realityUpDate},</if>
             <if test="upPerson != null">up_person = #{upPerson},</if>
@@ -114,9 +126,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </foreach>
     </update>
 
-    <select id="listPorjectId" parameterType="String" resultMap="TProjectRecordResult">
+    <select id="listProjectId" parameterType="String" resultMap="TProjectRecordResult">
         <include refid="selectTProjectRecordVo"/>
-        where porject_id = #{porjectId} and del_flag = 0
+        where a.project_id = #{projectId} and a.del_flag = 0
     </select>