From 01f7b8b3baea652f29e534f78cdcae33bb1ae060 Mon Sep 17 00:00:00 2001
From: luohairen <3399054449@qq.com>
Date: 星期四, 28 十一月 2024 21:03:42 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 business/src/main/java/com/ycl/domain/form/ProjectInvestmentPolicyComplianceForm.java         |   13 +-
 business/src/main/java/com/ycl/domain/form/DocumentInfoForm.java                              |   12 ++
 business/src/main/java/com/ycl/service/impl/ProjectUnitRegistrationInfoServiceImpl.java       |   29 +++++
 business/src/main/java/com/ycl/domain/vo/ProjectInvestmentPolicyComplianceVO.java             |   17 +--
 business/src/main/resources/mapper/ProjectInvestmentPolicyComplianceMapper.xml                |   21 +---
 business/src/main/java/com/ycl/service/impl/ProjectInvestmentInfoServiceImpl.java             |    7 +
 business/src/main/java/com/ycl/service/impl/ProjectInvestmentPolicyComplianceServiceImpl.java |   55 ++++++++++-
 business/src/main/java/com/ycl/controller/ProjectInfoController.java                          |   15 ++
 common/src/main/java/com/ycl/common/enums/business/FileTypeEnum.java                          |    2 
 business/src/main/java/com/ycl/service/impl/ProjectInfoServiceImpl.java                       |   34 ++++++
 business/src/main/java/com/ycl/domain/entity/ProjectInvestmentPolicyCompliance.java           |   24 +---
 business/src/main/java/com/ycl/service/impl/ProjectInvestmentFundingServiceImpl.java          |    7 +
 business/src/main/java/com/ycl/service/ProjectInfoService.java                                |    5 +
 13 files changed, 172 insertions(+), 69 deletions(-)

diff --git a/business/src/main/java/com/ycl/controller/ProjectInfoController.java b/business/src/main/java/com/ycl/controller/ProjectInfoController.java
index cac7115..22c73e9 100644
--- a/business/src/main/java/com/ycl/controller/ProjectInfoController.java
+++ b/business/src/main/java/com/ycl/controller/ProjectInfoController.java
@@ -4,6 +4,7 @@
 import com.ycl.common.group.Add;
 import com.ycl.common.group.Update;
 import com.ycl.common.utils.ProjectCodeGenerator;
+import com.ycl.domain.form.DocumentInfoForm;
 import com.ycl.domain.form.ProjectInfoForm;
 import com.ycl.domain.query.ProjectInfoQuery;
 import com.ycl.service.ProjectInfoService;
@@ -37,7 +38,12 @@
     public Result add(@RequestBody @Validated(Add.class) ProjectInfoForm form) {
         return projectInfoService.add(form);
     }
-
+    @PostMapping("/document")
+    @ApiOperation(value = "娣诲姞鐩稿叧鏂囦欢", notes = "娣诲姞鐩稿叧鏂囦欢")
+//    @PreAuthorize("hasAuthority('projectInfo:add')")
+    public Result addDoc(@RequestBody @Validated(Add.class) DocumentInfoForm form) {
+        return projectInfoService.addDoc(form);
+    }
     @PutMapping
     @ApiOperation(value = "淇敼", notes = "淇敼")
 //    @PreAuthorize("hasAuthority('projectInfo:edit')")
@@ -72,7 +78,12 @@
     public Result detail(@PathVariable("id") Integer id) {
         return projectInfoService.detail(id);
     }
-
+    @GetMapping("/document/{id}")
+    @ApiOperation(value = "鐩稿叧鏂囦欢璇︽儏", notes = "鐩稿叧鏂囦欢璇︽儏")
+//    @PreAuthorize("hasAuthority('projectInfo:detail')")
+    public Result docDetail(@PathVariable("id") Integer id) {
+        return projectInfoService.docDetail(id);
+    }
     @GetMapping("/list")
 //    @PreAuthorize("hasAuthority('projectInfo:list')")
     @ApiOperation(value = "鍒楄〃", notes = "鍒楄〃")
diff --git a/business/src/main/java/com/ycl/domain/entity/ProjectInvestmentPolicyCompliance.java b/business/src/main/java/com/ycl/domain/entity/ProjectInvestmentPolicyCompliance.java
index bc9563f..64bf1e5 100644
--- a/business/src/main/java/com/ycl/domain/entity/ProjectInvestmentPolicyCompliance.java
+++ b/business/src/main/java/com/ycl/domain/entity/ProjectInvestmentPolicyCompliance.java
@@ -23,37 +23,25 @@
     /** 椤圭洰id */
     private Long projectId;
 
-    @TableField("policy_compliance_attachment")
-    /** 绗﹀悎浜т笟鏀跨瓥闄勪欢 */
-    private String policyComplianceAttachment;
-
     @TableField("belongs_to_industry_adjustment_directory")
     /** 鏄惁灞炰簬銆婁骇涓氱粨鏋勮皟鏁存寚瀵肩洰褰曘�嬩笅鐨勯」鐩� */
-    private String belongsToIndustryAdjustmentDirectory;
-
-    @TableField("belongs_to_allowed_projects")
-    /** 鏄惁灞炰簬鏈垪鍏ャ�婁骇涓氱粨鏋勮皟鏁存寚瀵肩洰褰曘�嬬殑鍏佽绫婚」鐩� */
-    private String belongsToAllowedProjects;
+    private Boolean belongsToIndustryAdjustmentDirectory;
 
     @TableField("belongs_to_western_encouraged_directory")
     /** 鏄惁灞炰簬銆婅タ閮ㄥ湴鍖洪紦鍔辩被浜т笟鐩綍銆嬬殑椤圭洰 */
-    private Integer belongsToWesternEncouragedDirectory;
+    private Boolean belongsToWesternEncouragedDirectory;
 
     @TableField("not_banned_or_controlled_project")
     /** 鏄惁涓嶅睘浜庝骇涓氭斂绛栫姝㈡姇璧勫缓璁炬垨瀹炶鏍稿噯銆佸鎵圭鐞嗙殑椤圭洰 */
-    private Integer notBannedOrControlledProject;
+    private Boolean notBannedOrControlledProject;
 
     @TableField("information_is_true")
     /** 濉姤淇℃伅鏄惁鐪熷疄 */
-    private Integer informationIsTrue;
+    private Boolean informationIsTrue;
 
     @TableField("special_planning_compliance")
     /** 涓撻」瑙勫垝澶嶅悎鎯呭喌 */
     private String specialPlanningCompliance;
-
-    @TableField("energy_consumption")
-    /** 椤圭洰鑳借�楁儏鍐� */
-    private String energyConsumption;
 
     @TableField("annual_energy_consumption")
     /** 椤圭洰骞寸患鍚堣兘婧愭秷璐归噺锛堟爣鍑嗙叅褰撻噺鍊硷級 */
@@ -65,11 +53,11 @@
 
     @TableField("energy_check")
     /** 鑺傝兘瀹℃煡锛�1闇�瑕侊紝0涓嶉渶瑕侊級 */
-    private String energyCheck;
+    private Boolean energyCheck;
 
     @TableField("no_only_check_type")
     /** 涓嶅啀鍗曠嫭杩涜鑺傝兘瀹℃煡鐨勭被鍨� */
-    private String noOnlyCheckType;
+    private Integer noOnlyCheckType;
 
     @TableField("remarks")
     /** 澶囨敞 */
diff --git a/business/src/main/java/com/ycl/domain/form/DocumentInfoForm.java b/business/src/main/java/com/ycl/domain/form/DocumentInfoForm.java
new file mode 100644
index 0000000..6141521
--- /dev/null
+++ b/business/src/main/java/com/ycl/domain/form/DocumentInfoForm.java
@@ -0,0 +1,12 @@
+package com.ycl.domain.form;
+
+import com.ycl.domain.entity.File;
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+public class DocumentInfoForm {
+    private List<File> fileList;
+    private Long projectId;
+}
diff --git a/business/src/main/java/com/ycl/domain/form/ProjectInvestmentPolicyComplianceForm.java b/business/src/main/java/com/ycl/domain/form/ProjectInvestmentPolicyComplianceForm.java
index b6d7306..38b59a6 100644
--- a/business/src/main/java/com/ycl/domain/form/ProjectInvestmentPolicyComplianceForm.java
+++ b/business/src/main/java/com/ycl/domain/form/ProjectInvestmentPolicyComplianceForm.java
@@ -2,16 +2,18 @@
 
 import com.ycl.common.group.Update;
 import com.ycl.common.group.Add;
+import com.ycl.domain.entity.File;
 import com.ycl.system.domain.base.AbsForm;
 import com.ycl.domain.entity.ProjectInvestmentPolicyCompliance;
 import org.springframework.beans.BeanUtils;
-import javax.validation.constraints.NotBlank;
 import javax.validation.constraints.NotNull;
 import org.springframework.lang.NonNull;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
+
 import java.util.Date;
+import java.util.List;
 
 /**
  * 鎶曡祫椤圭洰浜т笟鏀跨瓥绗﹀悎鎯呭喌琛ㄨ〃鍗�
@@ -27,7 +29,7 @@
     private Long projectId;
 
     @ApiModelProperty("绗﹀悎浜т笟鏀跨瓥闄勪欢")
-    private String policyComplianceAttachment;
+    private List<File> fileList;
 
     @ApiModelProperty("鏄惁灞炰簬銆婁骇涓氱粨鏋勮皟鏁存寚瀵肩洰褰曘�嬩笅鐨勯」鐩�")
     private Boolean belongsToIndustryAdjustmentDirectory;
@@ -47,9 +49,6 @@
     @ApiModelProperty("涓撻」瑙勫垝澶嶅悎鎯呭喌")
     private String specialPlanningCompliance;
 
-    @ApiModelProperty("椤圭洰鑳借�楁儏鍐�")
-    private String energyConsumption;
-
     @ApiModelProperty("椤圭洰骞寸患鍚堣兘婧愭秷璐归噺锛堟爣鍑嗙叅褰撻噺鍊硷級")
     private String annualEnergyConsumption;
 
@@ -57,10 +56,10 @@
     private String annualElectricityConsumption;
 
     @ApiModelProperty("鑺傝兘瀹℃煡锛�1闇�瑕侊紝0涓嶉渶瑕侊級")
-    private String energyCheck;
+    private Boolean energyCheck;
 
     @ApiModelProperty("涓嶅啀鍗曠嫭杩涜鑺傝兘瀹℃煡鐨勭被鍨�")
-    private String noOnlyCheckType;
+    private Integer noOnlyCheckType;
 
     @ApiModelProperty("澶囨敞")
     private String remarks;
diff --git a/business/src/main/java/com/ycl/domain/vo/ProjectInvestmentPolicyComplianceVO.java b/business/src/main/java/com/ycl/domain/vo/ProjectInvestmentPolicyComplianceVO.java
index 61b1e88..4c4cbe2 100644
--- a/business/src/main/java/com/ycl/domain/vo/ProjectInvestmentPolicyComplianceVO.java
+++ b/business/src/main/java/com/ycl/domain/vo/ProjectInvestmentPolicyComplianceVO.java
@@ -1,5 +1,6 @@
 package com.ycl.domain.vo;
 
+import com.ycl.domain.entity.File;
 import com.ycl.system.domain.base.AbsVo;
 import com.ycl.domain.entity.ProjectInvestmentPolicyCompliance;
 import java.util.List;
@@ -26,15 +27,11 @@
 
     /** 绗﹀悎浜т笟鏀跨瓥闄勪欢 */
     @ApiModelProperty("绗﹀悎浜т笟鏀跨瓥闄勪欢")
-    private String policyComplianceAttachment;
+    private List<File> fileList;
 
     /** 鏄惁灞炰簬銆婁骇涓氱粨鏋勮皟鏁存寚瀵肩洰褰曘�嬩笅鐨勯」鐩� */
     @ApiModelProperty("鏄惁灞炰簬銆婁骇涓氱粨鏋勮皟鏁存寚瀵肩洰褰曘�嬩笅鐨勯」鐩�")
     private Boolean belongsToIndustryAdjustmentDirectory;
-
-    /** 鏄惁灞炰簬鏈垪鍏ャ�婁骇涓氱粨鏋勮皟鏁存寚瀵肩洰褰曘�嬬殑鍏佽绫婚」鐩� */
-    @ApiModelProperty("鏄惁灞炰簬鏈垪鍏ャ�婁骇涓氱粨鏋勮皟鏁存寚瀵肩洰褰曘�嬬殑鍏佽绫婚」鐩�")
-    private Boolean belongsToAllowedProjects;
 
     /** 鏄惁灞炰簬銆婅タ閮ㄥ湴鍖洪紦鍔辩被浜т笟鐩綍銆嬬殑椤圭洰 */
     @ApiModelProperty("鏄惁灞炰簬銆婅タ閮ㄥ湴鍖洪紦鍔辩被浜т笟鐩綍銆嬬殑椤圭洰")
@@ -46,15 +43,11 @@
 
     /** 濉姤淇℃伅鏄惁鐪熷疄 */
     @ApiModelProperty("濉姤淇℃伅鏄惁鐪熷疄")
-    private Integer informationIsTrue;
+    private Boolean informationIsTrue;
 
     /** 涓撻」瑙勫垝澶嶅悎鎯呭喌 */
     @ApiModelProperty("涓撻」瑙勫垝澶嶅悎鎯呭喌")
     private String specialPlanningCompliance;
-
-    /** 椤圭洰鑳借�楁儏鍐� */
-    @ApiModelProperty("椤圭洰鑳借�楁儏鍐�")
-    private String energyConsumption;
 
     /** 椤圭洰骞寸患鍚堣兘婧愭秷璐归噺锛堟爣鍑嗙叅褰撻噺鍊硷級 */
     @ApiModelProperty("椤圭洰骞寸患鍚堣兘婧愭秷璐归噺锛堟爣鍑嗙叅褰撻噺鍊硷級")
@@ -66,11 +59,11 @@
 
     /** 鑺傝兘瀹℃煡锛�1闇�瑕侊紝0涓嶉渶瑕侊級 */
     @ApiModelProperty("鑺傝兘瀹℃煡锛�1闇�瑕侊紝0涓嶉渶瑕侊級")
-    private String energyCheck;
+    private Boolean energyCheck;
 
     /** 涓嶅啀鍗曠嫭杩涜鑺傝兘瀹℃煡鐨勭被鍨� */
     @ApiModelProperty("涓嶅啀鍗曠嫭杩涜鑺傝兘瀹℃煡鐨勭被鍨�")
-    private String noOnlyCheckType;
+    private Integer noOnlyCheckType;
 
     /** 澶囨敞 */
     @ApiModelProperty("澶囨敞")
diff --git a/business/src/main/java/com/ycl/service/ProjectInfoService.java b/business/src/main/java/com/ycl/service/ProjectInfoService.java
index bd22f9e..5e3a90f 100644
--- a/business/src/main/java/com/ycl/service/ProjectInfoService.java
+++ b/business/src/main/java/com/ycl/service/ProjectInfoService.java
@@ -3,6 +3,7 @@
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.ycl.common.base.Result;
 import com.ycl.domain.entity.ProjectInfo;
+import com.ycl.domain.form.DocumentInfoForm;
 import com.ycl.domain.form.ProjectInfoForm;
 import com.ycl.domain.query.ProjectInfoQuery;
 import com.ycl.domain.vo.IndexCountVO;
@@ -70,4 +71,8 @@
     IndexCountVO getIndexCount(IndexDTO indexDTO);
 
     Map<String,Integer> countExceptionProject(IndexDTO indexDTO);
+
+    Result docDetail(Integer id);
+
+    Result addDoc(DocumentInfoForm form);
 }
diff --git a/business/src/main/java/com/ycl/service/impl/ProjectInfoServiceImpl.java b/business/src/main/java/com/ycl/service/impl/ProjectInfoServiceImpl.java
index 1cddb79..26368cf 100644
--- a/business/src/main/java/com/ycl/service/impl/ProjectInfoServiceImpl.java
+++ b/business/src/main/java/com/ycl/service/impl/ProjectInfoServiceImpl.java
@@ -8,6 +8,7 @@
 import com.ycl.common.utils.SecurityUtils;
 import com.ycl.domain.entity.File;
 import com.ycl.domain.entity.ProjectInfo;
+import com.ycl.domain.form.DocumentInfoForm;
 import com.ycl.domain.form.ProjectInfoForm;
 import com.ycl.domain.query.ProjectInfoQuery;
 import com.ycl.domain.vo.*;
@@ -81,7 +82,8 @@
         ProjectInfoForm.getEntityByForm(form,entity);
         Long userId = SecurityUtils.getUserId();
         entity.setUpdateBy(userId);
-
+        //鏇存柊椤圭洰淇℃伅
+        baseMapper.updateById(entity);
         List<File> fileList = form.getFileList();
         fileList.forEach(item->{
             item.setBusId(entity.getId());
@@ -94,8 +96,6 @@
         fileMapper.delete(fileQueryWrapper);
         //鏇挎崲鎴愮幇鏈�
         fileService.saveBatch(fileList);
-        //鏇存柊椤圭洰淇℃伅
-        baseMapper.updateById(entity);
         return Result.ok("淇敼鎴愬姛");
     }
 
@@ -211,4 +211,32 @@
         map.put("processExceptionProject", 0);
         return map;
     }
+
+    @Override
+    public Result docDetail(Integer id) {
+        DocumentInfoForm documentInfoForm = new DocumentInfoForm();
+        QueryWrapper<File> fileQueryWrapper = new QueryWrapper<>();
+        fileQueryWrapper.eq("type",FileTypeEnum.DOCUMENT_INFO.getType());
+        fileQueryWrapper.eq("bus_id",id);
+        List<File> files = fileMapper.selectList(fileQueryWrapper);
+        documentInfoForm.setFileList(files);
+        return Result.ok().data(documentInfoForm);
+    }
+
+    @Override
+    public Result addDoc(DocumentInfoForm form) {
+        List<File> fileList = form.getFileList();
+        fileList.forEach(item->{
+            item.setBusId(form.getProjectId());
+            item.setType(FileTypeEnum.DOCUMENT_INFO);
+        });
+        //鍒犻櫎鍘熸湁鏂囦欢
+        QueryWrapper<File> fileQueryWrapper = new QueryWrapper<>();
+        fileQueryWrapper.eq("type",FileTypeEnum.DOCUMENT_INFO.getType());
+        fileQueryWrapper.eq("bus_id",form.getProjectId());
+        fileMapper.delete(fileQueryWrapper);
+        //鏇挎崲鎴愮幇鏈�
+        fileService.saveBatch(fileList);
+        return Result.ok();
+    }
 }
diff --git a/business/src/main/java/com/ycl/service/impl/ProjectInvestmentFundingServiceImpl.java b/business/src/main/java/com/ycl/service/impl/ProjectInvestmentFundingServiceImpl.java
index ff2a93b..a23d64c 100644
--- a/business/src/main/java/com/ycl/service/impl/ProjectInvestmentFundingServiceImpl.java
+++ b/business/src/main/java/com/ycl/service/impl/ProjectInvestmentFundingServiceImpl.java
@@ -46,6 +46,7 @@
         entity.setCreateBy(userId);
         entity.setUpdateBy(userId);
         baseMapper.insert(entity);
+        //閬垮厤鏂板涓�涓悗閲嶅鏂板杩斿洖id缁欏墠绔垽鏂�
         return Result.ok("娣诲姞鎴愬姛").data(entity.getId());
     }
 
@@ -111,8 +112,10 @@
         QueryWrapper<ProjectInvestmentFunding> queryWrapper = new QueryWrapper<>();
         queryWrapper.eq("project_id",id);
         ProjectInvestmentFunding entity = baseMapper.selectOne(queryWrapper);
-        Assert.notNull(entity, "璁板綍涓嶅瓨鍦�");
-        ProjectInvestmentFundingVO vo = ProjectInvestmentFundingVO.getVoByEntity(entity, null);
+        ProjectInvestmentFundingVO vo =new ProjectInvestmentFundingVO();
+        if(entity!=null){
+            vo = ProjectInvestmentFundingVO.getVoByEntity(entity, null);
+        }
         return Result.ok().data(vo);
     }
 
diff --git a/business/src/main/java/com/ycl/service/impl/ProjectInvestmentInfoServiceImpl.java b/business/src/main/java/com/ycl/service/impl/ProjectInvestmentInfoServiceImpl.java
index ce9d181..710c56e 100644
--- a/business/src/main/java/com/ycl/service/impl/ProjectInvestmentInfoServiceImpl.java
+++ b/business/src/main/java/com/ycl/service/impl/ProjectInvestmentInfoServiceImpl.java
@@ -45,6 +45,7 @@
         entity.setUpdateBy(userId);
 
         baseMapper.insert(entity);
+        //閬垮厤鏂板涓�涓悗閲嶅鏂板杩斿洖id缁欏墠绔垽鏂�
         return Result.ok("娣诲姞鎴愬姛").data(entity.getId());
     }
 
@@ -110,8 +111,10 @@
         QueryWrapper<ProjectInvestmentInfo> queryWrapper = new QueryWrapper<>();
         queryWrapper.eq("project_id",id);
         ProjectInvestmentInfo entity = baseMapper.selectOne(queryWrapper);
-        Assert.notNull(entity, "璁板綍涓嶅瓨鍦�");
-        ProjectInvestmentInfoVO vo = ProjectInvestmentInfoVO.getVoByEntity(entity, null);
+        ProjectInvestmentInfoVO vo = new ProjectInvestmentInfoVO();
+        if(entity!=null) {
+            vo = ProjectInvestmentInfoVO.getVoByEntity(entity, null);
+        }
         return Result.ok().data(vo);
     }
 
diff --git a/business/src/main/java/com/ycl/service/impl/ProjectInvestmentPolicyComplianceServiceImpl.java b/business/src/main/java/com/ycl/service/impl/ProjectInvestmentPolicyComplianceServiceImpl.java
index 8299d67..ddf8c91 100644
--- a/business/src/main/java/com/ycl/service/impl/ProjectInvestmentPolicyComplianceServiceImpl.java
+++ b/business/src/main/java/com/ycl/service/impl/ProjectInvestmentPolicyComplianceServiceImpl.java
@@ -1,8 +1,16 @@
 package com.ycl.service.impl;
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.ycl.common.enums.business.FileTypeEnum;
+import com.ycl.common.utils.SecurityUtils;
+import com.ycl.domain.entity.File;
 import com.ycl.domain.entity.ProjectInvestmentPolicyCompliance;
+import com.ycl.domain.entity.ProjectUnitRegistrationInfo;
+import com.ycl.domain.vo.ProjectUnitRegistrationInfoVO;
+import com.ycl.mapper.FileMapper;
 import com.ycl.mapper.ProjectInvestmentPolicyComplianceMapper;
+import com.ycl.service.FileService;
 import com.ycl.service.ProjectInvestmentPolicyComplianceService;
 import com.ycl.common.base.Result;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -13,6 +21,7 @@
 import lombok.RequiredArgsConstructor;
 import com.ycl.framework.utils.PageUtil;
 import org.springframework.beans.BeanUtils;
+import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.Assert;
 
 import java.util.List;
@@ -29,17 +38,30 @@
 public class ProjectInvestmentPolicyComplianceServiceImpl extends ServiceImpl<ProjectInvestmentPolicyComplianceMapper, ProjectInvestmentPolicyCompliance> implements ProjectInvestmentPolicyComplianceService {
 
     private final ProjectInvestmentPolicyComplianceMapper projectInvestmentPolicyComplianceMapper;
-
+    private final FileService fileService;
+    private final FileMapper fileMapper;
     /**
      * 娣诲姞
      * @param form
      * @return
      */
     @Override
+    @Transactional(rollbackFor = Exception.class)
     public Result add(ProjectInvestmentPolicyComplianceForm form) {
         ProjectInvestmentPolicyCompliance entity = ProjectInvestmentPolicyComplianceForm.getEntityByForm(form, null);
+        Long userId = SecurityUtils.getUserId();
+        entity.setCreateBy(userId);
+        entity.setUpdateBy(userId);
         baseMapper.insert(entity);
-        return Result.ok("娣诲姞鎴愬姛");
+        //娣诲姞鏂囦欢
+        List<File> fileList = form.getFileList();
+        fileList.forEach(item->{
+            item.setBusId(entity.getId());
+            item.setType(FileTypeEnum.INVEST_POLICY);
+        });
+        fileService.saveBatch(fileList);
+        //閬垮厤鏂板涓�涓悗閲嶅鏂板杩斿洖id缁欏墠绔垽鏂�
+        return Result.ok("娣诲姞鎴愬姛").data(entity.getId());
     }
 
     /**
@@ -50,11 +72,24 @@
     @Override
     public Result update(ProjectInvestmentPolicyComplianceForm form) {
         ProjectInvestmentPolicyCompliance entity = baseMapper.selectById(form.getId());
-
         // 涓虹┖鎶汭llegalArgumentException锛屽仛鍏ㄥ眬寮傚父澶勭悊
         Assert.notNull(entity, "璁板綍涓嶅瓨鍦�");
         BeanUtils.copyProperties(form, entity);
+        Long userId = SecurityUtils.getUserId();
+        entity.setUpdateBy(userId);
         baseMapper.updateById(entity);
+        List<File> fileList = form.getFileList();
+        fileList.forEach(item->{
+            item.setBusId(entity.getId());
+            item.setType(FileTypeEnum.INVEST_POLICY);
+        });
+        //鍒犻櫎鍘熸湁鏂囦欢
+        QueryWrapper<File> fileQueryWrapper = new QueryWrapper<>();
+        fileQueryWrapper.eq("type",FileTypeEnum.INVEST_POLICY.getType());
+        fileQueryWrapper.eq("bus_id",entity.getId());
+        fileMapper.delete(fileQueryWrapper);
+        //鏇挎崲鎴愮幇鏈�
+        fileService.saveBatch(fileList);
         return Result.ok("淇敼鎴愬姛");
     }
 
@@ -99,8 +134,18 @@
      */
     @Override
     public Result detail(Integer id) {
-        ProjectInvestmentPolicyComplianceVO vo = baseMapper.getById(id);
-        Assert.notNull(vo, "璁板綍涓嶅瓨鍦�");
+        QueryWrapper<ProjectInvestmentPolicyCompliance> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("project_id", id);
+        ProjectInvestmentPolicyCompliance entity = baseMapper.selectOne(queryWrapper);
+        ProjectInvestmentPolicyComplianceVO vo = new ProjectInvestmentPolicyComplianceVO();
+        if (entity != null) {
+            vo = ProjectInvestmentPolicyComplianceVO.getVoByEntity(entity, null);
+            QueryWrapper<File> fileQueryWrapper = new QueryWrapper<>();
+            fileQueryWrapper.eq("type",FileTypeEnum.INVEST_POLICY.getType());
+            fileQueryWrapper.eq("bus_id",vo.getId());
+            List<File> files = fileMapper.selectList(fileQueryWrapper);
+            vo.setFileList(files);
+        }
         return Result.ok().data(vo);
     }
 
diff --git a/business/src/main/java/com/ycl/service/impl/ProjectUnitRegistrationInfoServiceImpl.java b/business/src/main/java/com/ycl/service/impl/ProjectUnitRegistrationInfoServiceImpl.java
index 13893b9..0b5678b 100644
--- a/business/src/main/java/com/ycl/service/impl/ProjectUnitRegistrationInfoServiceImpl.java
+++ b/business/src/main/java/com/ycl/service/impl/ProjectUnitRegistrationInfoServiceImpl.java
@@ -1,7 +1,11 @@
 package com.ycl.service.impl;
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.ycl.common.utils.SecurityUtils;
+import com.ycl.domain.entity.ProjectInvestmentInfo;
 import com.ycl.domain.entity.ProjectUnitRegistrationInfo;
+import com.ycl.domain.vo.ProjectInvestmentInfoVO;
 import com.ycl.mapper.ProjectUnitRegistrationInfoMapper;
 import com.ycl.service.ProjectUnitRegistrationInfoService;
 import com.ycl.common.base.Result;
@@ -32,18 +36,25 @@
 
     /**
      * 娣诲姞
+     *
      * @param form
      * @return
      */
     @Override
     public Result add(ProjectUnitRegistrationInfoForm form) {
         ProjectUnitRegistrationInfo entity = ProjectUnitRegistrationInfoForm.getEntityByForm(form, null);
+        Long userId = SecurityUtils.getUserId();
+        entity.setCreateBy(userId);
+        entity.setUpdateBy(userId);
+
         baseMapper.insert(entity);
-        return Result.ok("娣诲姞鎴愬姛");
+        //閬垮厤鏂板涓�涓悗閲嶅鏂板杩斿洖id缁欏墠绔垽鏂�
+        return Result.ok("娣诲姞鎴愬姛").data(entity.getId());
     }
 
     /**
      * 淇敼
+     *
      * @param form
      * @return
      */
@@ -54,12 +65,15 @@
         // 涓虹┖鎶汭llegalArgumentException锛屽仛鍏ㄥ眬寮傚父澶勭悊
         Assert.notNull(entity, "璁板綍涓嶅瓨鍦�");
         BeanUtils.copyProperties(form, entity);
+        Long userId = SecurityUtils.getUserId();
+        entity.setUpdateBy(userId);
         baseMapper.updateById(entity);
         return Result.ok("淇敼鎴愬姛");
     }
 
     /**
      * 鎵归噺鍒犻櫎
+     *
      * @param ids
      * @return
      */
@@ -71,6 +85,7 @@
 
     /**
      * id鍒犻櫎
+     *
      * @param id
      * @return
      */
@@ -82,6 +97,7 @@
 
     /**
      * 鍒嗛〉鏌ヨ
+     *
      * @param query
      * @return
      */
@@ -94,18 +110,25 @@
 
     /**
      * 鏍规嵁id鏌ユ壘
+     *
      * @param id
      * @return
      */
     @Override
     public Result detail(Integer id) {
-        ProjectUnitRegistrationInfoVO vo = baseMapper.getById(id);
-        Assert.notNull(vo, "璁板綍涓嶅瓨鍦�");
+        QueryWrapper<ProjectUnitRegistrationInfo> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("project_id", id);
+        ProjectUnitRegistrationInfo entity = baseMapper.selectOne(queryWrapper);
+        ProjectUnitRegistrationInfoVO vo = new ProjectUnitRegistrationInfoVO();
+        if (entity != null) {
+            vo = ProjectUnitRegistrationInfoVO.getVoByEntity(entity, null);
+        }
         return Result.ok().data(vo);
     }
 
     /**
      * 鍒楄〃
+     *
      * @return
      */
     @Override
diff --git a/business/src/main/resources/mapper/ProjectInvestmentPolicyComplianceMapper.xml b/business/src/main/resources/mapper/ProjectInvestmentPolicyComplianceMapper.xml
index f6df228..2ef6d19 100644
--- a/business/src/main/resources/mapper/ProjectInvestmentPolicyComplianceMapper.xml
+++ b/business/src/main/resources/mapper/ProjectInvestmentPolicyComplianceMapper.xml
@@ -5,21 +5,18 @@
     <!-- 閫氱敤鏌ヨ鏄犲皠缁撴灉 -->
     <resultMap id="BaseResultMap" type="com.ycl.domain.vo.ProjectInvestmentPolicyComplianceVO">
         <result column="project_id" property="projectId" />
-        <result column="policy_compliance_attachment" property="policyComplianceAttachment" />
         <result column="belongs_to_industry_adjustment_directory" property="belongsToIndustryAdjustmentDirectory" />
-        <result column="belongs_to_allowed_projects" property="belongsToAllowedProjects" />
         <result column="belongs_to_western_encouraged_directory" property="belongsToWesternEncouragedDirectory" />
         <result column="not_banned_or_controlled_project" property="notBannedOrControlledProject" />
         <result column="information_is_true" property="informationIsTrue" />
         <result column="special_planning_compliance" property="specialPlanningCompliance" />
-        <result column="energy_consumption" property="energyConsumption" />
         <result column="annual_energy_consumption" property="annualEnergyConsumption" />
         <result column="annual_electricity_consumption" property="annualElectricityConsumption" />
         <result column="energy_check" property="energyCheck" />
         <result column="no_only_check_type" property="noOnlyCheckType" />
         <result column="remarks" property="remarks" />
-        <result column="gmt_create_time" property="gmtCreateTime" />
-        <result column="gmt_update_time" property="gmtUpdateTime" />
+        <result column="gmt_create" property="gmtCreate" />
+        <result column="gmt_update" property="gmtUpdate" />
         <result column="create_by" property="createBy" />
         <result column="update_by" property="updateBy" />
     </resultMap>
@@ -33,21 +30,18 @@
     <select id="getById" resultMap="BaseResultMap">
         SELECT
             TPIPC.project_id,
-            TPIPC.policy_compliance_attachment,
             TPIPC.belongs_to_industry_adjustment_directory,
-            TPIPC.belongs_to_allowed_projects,
             TPIPC.belongs_to_western_encouraged_directory,
             TPIPC.not_banned_or_controlled_project,
             TPIPC.information_is_true,
             TPIPC.special_planning_compliance,
-            TPIPC.energy_consumption,
             TPIPC.annual_energy_consumption,
             TPIPC.annual_electricity_consumption,
             TPIPC.energy_check,
             TPIPC.no_only_check_type,
             TPIPC.remarks,
-            TPIPC.gmt_create_time,
-            TPIPC.gmt_update_time,
+            TPIPC.gmt_create,
+            TPIPC.gmt_update,
             TPIPC.create_by,
             TPIPC.update_by,
             TPIPC.id
@@ -61,21 +55,18 @@
     <select id="getPage" resultMap="BaseResultMap">
         SELECT
             TPIPC.project_id,
-            TPIPC.policy_compliance_attachment,
             TPIPC.belongs_to_industry_adjustment_directory,
-            TPIPC.belongs_to_allowed_projects,
             TPIPC.belongs_to_western_encouraged_directory,
             TPIPC.not_banned_or_controlled_project,
             TPIPC.information_is_true,
             TPIPC.special_planning_compliance,
-            TPIPC.energy_consumption,
             TPIPC.annual_energy_consumption,
             TPIPC.annual_electricity_consumption,
             TPIPC.energy_check,
             TPIPC.no_only_check_type,
             TPIPC.remarks,
-            TPIPC.gmt_create_time,
-            TPIPC.gmt_update_time,
+            TPIPC.gmt_create,
+            TPIPC.gmt_update,
             TPIPC.create_by,
             TPIPC.update_by,
             TPIPC.id
diff --git a/common/src/main/java/com/ycl/common/enums/business/FileTypeEnum.java b/common/src/main/java/com/ycl/common/enums/business/FileTypeEnum.java
index 771c5df..88a8fe9 100644
--- a/common/src/main/java/com/ycl/common/enums/business/FileTypeEnum.java
+++ b/common/src/main/java/com/ycl/common/enums/business/FileTypeEnum.java
@@ -13,6 +13,8 @@
 @Getter
 public enum FileTypeEnum {
     PROJECT_INFO("project_info", "椤圭洰鍩烘湰淇℃伅"),
+    INVEST_POLICY("invest_policy","鎶曡祫椤圭洰浜т笟鏀跨瓥绗﹀悎鎯呭喌"),
+    DOCUMENT_INFO("document_info","鐩稿叧鏂囦欢"),
     PROJECT_COMPLETE_REPORT("project_complete_report", "椤圭洰绔e伐鎶ュ憡"),
     PROJECT_SITUATION_DESCRIPTION("project_situation_description", "椤圭洰鎯呭喌璇存槑"),
     PROJECT_PROGRESS_INFO_REPORT("project_progress_info_report", "椤圭洰杩涘害璁″垝椤逛笂鎶�");

--
Gitblit v1.8.0