wangming преди 1 година
родител
ревизия
61bb7677d2

+ 7 - 0
business-common/src/main/java/com/rongwei/bscommon/sys/service/ZhcxProjectManageService.java

@@ -2,6 +2,7 @@ package com.rongwei.bscommon.sys.service;
 
 import com.rongwei.bsentity.domain.ZhcxProjectManageDo;
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.rongwei.rwcommonentity.commonservers.domain.SysFileItemDo;
 
 /**
  * <p>
@@ -13,4 +14,10 @@ import com.baomidou.mybatisplus.extension.service.IService;
  */
 public interface ZhcxProjectManageService extends IService<ZhcxProjectManageDo> {
 
+    /**
+     * 生成汇总文件
+     *
+     * @param projectId
+     */
+    SysFileItemDo genSummaryFiles(String projectId);
 }

+ 24 - 0
business-common/src/main/java/com/rongwei/bscommon/sys/service/impl/ZhcxProjectManageServiceImpl.java

@@ -4,6 +4,10 @@ import com.rongwei.bsentity.domain.ZhcxProjectManageDo;
 import com.rongwei.bscommon.sys.dao.ZhcxProjectManageDao;
 import com.rongwei.bscommon.sys.service.ZhcxProjectManageService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.rongwei.rwcommoncomponent.file.dto.NewFileDto;
+import com.rongwei.rwcommoncomponent.file.service.SysFileItemService;
+import com.rongwei.rwcommonentity.commonservers.domain.SysFileItemDo;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 /**
@@ -17,4 +21,24 @@ import org.springframework.stereotype.Service;
 @Service
 public class ZhcxProjectManageServiceImpl extends ServiceImpl<ZhcxProjectManageDao, ZhcxProjectManageDo> implements ZhcxProjectManageService {
 
+    @Autowired
+    private SysFileItemService fileItemService;
+
+    /**
+     * 生成汇总文件
+     *
+     * @param projectId
+     */
+    @Override
+    public SysFileItemDo genSummaryFiles(String projectId) {
+
+        ZhcxProjectManageDo manageDo = getById(projectId);
+
+        NewFileDto newFileDto = NewFileDto.builder()
+                .fileName(manageDo.getProjectCode().concat(manageDo.getProjectEname()))
+                .suffix("xlsx")
+                .build();
+        SysFileItemDo fileItemDo = fileItemService.newBlankFile(newFileDto);
+        return fileItemDo;
+    }
 }

+ 43 - 0
business-server/src/main/java/com/rongwei/bsserver/controller/ZhcxProjectManageController.java

@@ -0,0 +1,43 @@
+package com.rongwei.bsserver.controller;
+
+
+import com.rongwei.bscommon.sys.service.ZhcxProjectManageService;
+import com.rongwei.bsentity.domain.ZhcxProjectManageDo;
+import com.rongwei.rwcommon.base.R;
+import com.rongwei.rwcommonentity.commonservers.domain.SysFileItemDo;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ * 项目管理表 前端控制器
+ * </p>
+ *
+ * @author wm
+ * @since 2024-06-28
+ */
+@RestController
+@RequestMapping("/zhcxProjectManage")
+@Api(tags = "项目管理")
+public class ZhcxProjectManageController {
+
+    @Autowired
+    private ZhcxProjectManageService service;
+    /**
+     * 复制新增
+     * @param projectManageDo
+     * @return
+     */
+    @PostMapping("/genSummaryFiles")
+    @ApiOperation("生成汇总文件")
+    public R genSummaryFiles(@RequestBody ZhcxProjectManageDo projectManageDo){
+        SysFileItemDo itemDo = service.genSummaryFiles(projectManageDo.getId());
+        return R.ok(itemDo);
+    }
+}
+

BIN
business-server/src/main/resources/template/newfile.xlsx