Browse Source

提交变更文件

changchun
zhouhaibin 7 months ago
parent
commit
4a371816c3
  1. 30
      huzhou/src/main/java/com/easy/admin/common/util/CommonUtils.java
  2. 199
      huzhou/src/main/java/com/easy/admin/modules/huzhou/controller/HuzhouProjectController.java
  3. 49
      huzhou/src/main/java/com/easy/admin/modules/huzhou/controller/HuzhouWorkreportController.java
  4. 7
      huzhou/src/main/java/com/easy/admin/modules/huzhou/dao/HuzhouProjectinfoHistoryMapper.java
  5. 30
      huzhou/src/main/java/com/easy/admin/modules/huzhou/dao/HuzhouProjectinfoMapper.java
  6. 5
      huzhou/src/main/java/com/easy/admin/modules/huzhou/dao/HuzhouWorkreportMapper.java
  7. 111
      huzhou/src/main/java/com/easy/admin/modules/huzhou/dao/mapping/HuzhouProjectinfoMapper.xml
  8. 135
      huzhou/src/main/java/com/easy/admin/modules/huzhou/dao/mapping/HuzhouWorkreportMapper.xml
  9. 8
      huzhou/src/main/java/com/easy/admin/modules/huzhou/entity/HuzhouProjectinfo.java
  10. 162
      huzhou/src/main/java/com/easy/admin/modules/huzhou/entity/HuzhouProjectinfoHistory.java
  11. 44
      huzhou/src/main/java/com/easy/admin/modules/huzhou/service/IHuzhouProjectinfoService.java
  12. 11
      huzhou/src/main/java/com/easy/admin/modules/huzhou/service/IHuzhouWorkreportService.java
  13. 294
      huzhou/src/main/java/com/easy/admin/modules/huzhou/service/impl/HuzhouProjectinfoServiceImpl.java
  14. 16
      huzhou/src/main/java/com/easy/admin/modules/huzhou/service/impl/HuzhouSubProjectinfoServiceImpl.java
  15. 39
      huzhou/src/main/java/com/easy/admin/modules/huzhou/service/impl/HuzhouWorkreportServiceImpl.java
  16. 15
      huzhou/src/main/java/com/easy/admin/modules/huzhou/vo/HuzhouProjectinfoOV.java
  17. 2
      huzhou/src/main/java/com/easy/admin/modules/huzhou/vo/ProjectApproveOV.java

30
huzhou/src/main/java/com/easy/admin/common/util/CommonUtils.java

@ -1,8 +1,13 @@
package com.easy.admin.common.util; package com.easy.admin.common.util;
import com.easy.admin.auth.model.SysRole;
import com.easy.admin.auth.model.SysUser;
import com.easy.admin.modules.huzhou.entity.HuzhouProjectinfo;
import com.easy.admin.util.ShiroUtil;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import java.util.List;
import java.util.regex.Matcher; import java.util.regex.Matcher;
import java.util.regex.Pattern; import java.util.regex.Pattern;
@ -70,5 +75,30 @@ public class CommonUtils {
} }
} }
/**
* 设置获取项目信息的权限
* @param projectinfo
* @return
*/
public static HuzhouProjectinfo setGetProjectInfoAuth(HuzhouProjectinfo projectinfo) {
SysUser currentUser = ShiroUtil.getCurrentUser();
List<SysRole> roleList = currentUser.getRoleList();
String roles = "";
for (SysRole role : roleList
) {
roles = role.getCode() + "," + roles;
}
//超级管理员和项目管理单位查看所有项目
if (roles.contains("manageOrg") || roles.contains("sys:admin")) {
} else if (roles.contains("supervisor")) {
//监管单位
projectinfo.setSupervisorContactor(currentUser.getId());
} else {
//其他人员查看自己有关的项目
projectinfo.setProjectContacts(currentUser.getId());
}
return projectinfo;
}
} }

199
huzhou/src/main/java/com/easy/admin/modules/huzhou/controller/HuzhouProjectController.java

@ -1,118 +1,86 @@
package com.easy.admin.modules.huzhou.controller; package com.easy.admin.modules.huzhou.controller;
import cn.hutool.core.util.RandomUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.easy.admin.auth.model.SysUser; import com.easy.admin.common.core.annotation.ResponseResult;
import com.easy.admin.auth.service.SysUserRoleService;
import com.easy.admin.auth.service.SysUserService;
import com.easy.admin.common.core.common.select.Select;
import com.easy.admin.common.core.exception.EasyException;
import com.easy.admin.modules.huzhou.vo.HuzhouProjectinfoOV; import com.easy.admin.modules.huzhou.vo.HuzhouProjectinfoOV;
import com.easy.admin.sys.service.SysDictService;
import com.easy.admin.util.PasswordUtil;
import com.easy.admin.util.ShiroUtil;
import org.activiti.engine.RuntimeService;
import org.activiti.engine.runtime.ProcessInstance;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.*;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import com.easy.admin.common.api.vo.Result; import com.easy.admin.common.api.vo.Result;
import com.easy.admin.modules.huzhou.common.HuzhouCommonUtils;
import com.easy.admin.modules.huzhou.common.TemplateExcelUtils;
import com.easy.admin.modules.huzhou.entity.*; import com.easy.admin.modules.huzhou.entity.*;
import com.easy.admin.modules.huzhou.service.*; import com.easy.admin.modules.huzhou.service.*;
import com.easy.admin.modules.huzhou.vo.ProjectApproveOV; import com.easy.admin.modules.huzhou.vo.ProjectApproveOV;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.*;
import java.lang.reflect.Method;
import java.math.BigDecimal;
import java.util.*;
import java.util.stream.Collectors;
@RestController @RestController
@RequestMapping("/huzhouProject") @RequestMapping("/huzhouProject")
public class HuzhouProjectController { public class HuzhouProjectController {
@Autowired
private SysUserService sysUserService;
@Autowired
private IWorkflowService workflowService;
@Autowired
private IHuzhouProcessinfoService processinfoService;
@Autowired
private RuntimeService runtimeService;
@Autowired @Autowired
private IHuzhouProjectinfoService projectinfoService; private IHuzhouProjectinfoService projectinfoService;
@Autowired @Autowired
private IHuzhouUserprojectService userprojectService; private IHuzhouUserprojectService userprojectService;
@Autowired
private SysDictService sysDictService;
/** /**
* 本地local miniominio 阿里alioss * 新增项目入库
* @param info 项目信息
* @return 返回值
*/ */
@Value(value="${jeecg.uploadType}")
private String uploadType;
@PostMapping("/submitProject") @PostMapping("/submitProject")
public Result<String> submitProject(@RequestBody HuzhouProjectinfo info){ public Result<String> submitProject(@RequestBody HuzhouProjectinfo info){
projectinfoService.submitProject(info); projectinfoService.submitProject(info);
return Result.ok("项目入库申请已发起成功"); return Result.ok("项目入库申请已发起成功");
} }
/**
* 批量导入项目
* @param multipartFile 表格文件
* @return 返回值
* @throws Exception 抛异常
*/
@PostMapping("/batchImportProjects") @PostMapping("/batchImportProjects")
public Result<?> batchImportProjects(@RequestParam(value = "file",required = false) MultipartFile multipartFile) throws Exception { public Result<?> batchImportProjects(@RequestParam(value = "file",required = false) MultipartFile multipartFile) throws Exception {
projectinfoService.batchImportProjects(multipartFile); projectinfoService.batchImportProjects(multipartFile);
//创建流程
return Result.OK("批量导入成功"); return Result.OK("批量导入成功");
} }
/**
* 项目审批
* @param projectApproveOV 审批数据
* @return 返回值
*/
@PostMapping("/approveProjectInfo") @PostMapping("/approveProjectInfo")
public Result<?> approveProjectInfo(@RequestBody ProjectApproveOV projectApproveOV){ public Result<?> approveProjectInfo(@RequestBody ProjectApproveOV projectApproveOV){
projectinfoService.approveProjectInfo(projectApproveOV); projectinfoService.approveProjectInfo(projectApproveOV);
return Result.ok("审批成功"); return Result.ok("审批成功");
} }
@PostMapping("/deleteProcesss") /**
public Result<?> deleteProcesss(String processInstanceId){ * 目前用于修改项目联系人
// runtimeService.deleteProcessInstance(processInstanceId,"发起人删除"); * @param huzhouProjectinfo 项目的全部信息
return Result.OK("流程删除成功"); * @return
} */
//弃用
@PostMapping("/modifyProjectInfo") @PostMapping("/modifyProjectInfo")
@Transactional @Transactional
public Result<?> modifyProjectInfo(@RequestBody HuzhouProjectinfo huzhouProjectinfo){ public Result<?> modifyProjectInfo(@RequestBody HuzhouProjectinfo huzhouProjectinfo){
projectinfoService.updateById(huzhouProjectinfo); projectinfoService.modifyProjectInfoContact(huzhouProjectinfo);//修改项目联系人
userprojectService.removeByProjectId(huzhouProjectinfo.getId(),"0");
userprojectService.saveFromProject(huzhouProjectinfo,"0");
return Result.ok("修改成功");
}
//弃用
@PostMapping("/modifyProjectInfoApproval")
public Result<?> modifyProjectInfoApproval(@RequestBody HuzhouProjectinfo huzhouProjectinfo){
WorkFlow workFlow = workflowService.createFlow("creatProjectinfo",huzhouProjectinfo.getId());
projectinfoService.updateById(huzhouProjectinfo);
userprojectService.removeByProjectId(huzhouProjectinfo.getId(),"0");
userprojectService.saveFromProject(huzhouProjectinfo,"0");
return Result.ok("修改成功"); return Result.ok("修改成功");
} }
/** /**
* 获取项目信息列表 * 获取项目信息列表
* @param projectinfo * @param projectinfo 查询条件
* @param pageNo * @param pageNo 页码
* @param pageSize * @param pageSize 页数
* @return * @return 结果
*/ */
@GetMapping("/getProjectInfoPageList") @GetMapping("/getProjectInfoPageList")
public Result<?> getProjectInfoPageList(HuzhouProjectinfo projectinfo, public Result<?> getProjectInfoPageList(HuzhouProjectinfo projectinfo,
@ -122,32 +90,43 @@ public class HuzhouProjectController {
IPage<HuzhouProjectinfo> pageList = projectinfoService.getProjectInfoPageList(projectinfo, pageNo, pageSize); IPage<HuzhouProjectinfo> pageList = projectinfoService.getProjectInfoPageList(projectinfo, pageNo, pageSize);
return Result.OK(pageList); return Result.OK(pageList);
} }
/**
* 获取项目信息列表并且携带子项目的信息
* @param projectinfo 项目查询条件
* @param pageNo 页码
* @param pageSize 每页多少条
* @return 返回值
*/
@ResponseResult
@GetMapping("/getProjectInfoAndChildPageList") @GetMapping("/getProjectInfoAndChildPageList")
public IPage<HuzhouProjectinfoOV> queryPageList(HuzhouProjectinfo projectinfo,
public Result<IPage<HuzhouProjectinfoOV>> queryPageList(HuzhouProjectinfo projectinfo,
@RequestParam(name="current", defaultValue="1") Integer pageNo, @RequestParam(name="current", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize){ @RequestParam(name="pageSize", defaultValue="10") Integer pageSize){
projectinfo.setStage(projectinfo.getStage()); projectinfo.setStage(projectinfo.getStage());
IPage<HuzhouProjectinfoOV> pageList = projectinfoService.getProjectInfoAndChildPageList(projectinfo, pageNo, pageSize); IPage<HuzhouProjectinfoOV> pageList = projectinfoService.getProjectInfoAndChildPageList(projectinfo, pageNo, pageSize);
return Result.OK(pageList); return pageList;
} }
/**
* 根据项目id获取项目信息
* @param projectid 项目id
* @return 返回值
*/
@GetMapping("/queryProjectInfoById") @GetMapping("/queryProjectInfoById")
public Result<?> queryProjectInfoById(String projectid){ public Result<?> queryProjectInfoById(String projectid){
//获取项目入库数据 //获取项目入库数据
Object projectInfo = projectinfoService.queryProjectInfoById(projectid); Object projectInfo = projectinfoService.queryProjectInfoById(projectid);
return Result.OK(projectInfo); return Result.OK(projectInfo);
}
//弃用
@GetMapping("/queryProjectInfoNewDataById")
public Result<?> queryProjectInfoNewDataById(String projectid){
//获取项目入库数据
Object projectInfo = projectinfoService.queryProjectInfoNewDataById(projectid);
return Result.OK(projectInfo);
} }
//项目计划列表信息 /**
* 项目计划列表信息
* @param projectinfo 查询条件
* @param pageNo 页码
* @param pageSize 每页条数
* @return 返回值
*/
@GetMapping("/projectApprovedPageList") @GetMapping("/projectApprovedPageList")
public Result<IPage<HuzhouProjectinfoOV>> queryProjectApprovedPage(HuzhouProjectinfo projectinfo, public Result<IPage<HuzhouProjectinfoOV>> queryProjectApprovedPage(HuzhouProjectinfo projectinfo,
@RequestParam(name="current", defaultValue="1") Integer pageNo, @RequestParam(name="current", defaultValue="1") Integer pageNo,
@ -157,29 +136,14 @@ public class HuzhouProjectController {
return Result.OK(infoPageList); return Result.OK(infoPageList);
} }
@GetMapping("/getIsbatchImportProjects") /**
public Result<?> getIsbatchImportProjects(String processInstanceId){ * 归档信息列表
List<HuzhouProcessinfo> processinfoList = processinfoService.getListByInstid(processInstanceId); * @param projectinfo 查询条件
if(processinfoList.size()>1){ * @param pageNo 页码
return Result.OK(true); * @param pageSize 每页条数
} * @return 返回值
return Result.OK(false); */
}
@GetMapping("/batchImportProjectPageListByInstid")
public Result<?> getBatchImportProjectsListByInstid(String processInstanceId,
@RequestParam(name="current", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize){
List<HuzhouProcessinfo> processinfoList = processinfoService.getListByInstid(processInstanceId);
List<String> projectidList = processinfoList.stream()
.map(HuzhouProcessinfo::getProjectid)
.collect(Collectors.toList());
LambdaQueryWrapper<HuzhouProjectinfo> projectinfoQueryWrapper = new LambdaQueryWrapper<>();
projectinfoQueryWrapper.in(HuzhouProjectinfo::getId,projectidList);
Page<HuzhouProjectinfo> huzhouProjectinfoPage = new Page<>(pageNo,pageSize);
Page<HuzhouProjectinfo> projectinfoPage = projectinfoService.page(huzhouProjectinfoPage, projectinfoQueryWrapper);
return Result.ok(projectinfoPage);
}
//归档
@GetMapping("/projectArchivePageList") @GetMapping("/projectArchivePageList")
public Result<?> projectArchivePageList(HuzhouProjectinfo projectinfo, public Result<?> projectArchivePageList(HuzhouProjectinfo projectinfo,
@RequestParam(name="current", defaultValue="1") Integer pageNo, @RequestParam(name="current", defaultValue="1") Integer pageNo,
@ -188,35 +152,12 @@ public class HuzhouProjectController {
IPage<HuzhouProjectinfoOV> pageList = projectinfoService.getProjectInfoAndChildPageList(projectinfo, pageNo, pageSize); IPage<HuzhouProjectinfoOV> pageList = projectinfoService.getProjectInfoAndChildPageList(projectinfo, pageNo, pageSize);
return Result.OK(pageList); return Result.OK(pageList);
} }
// @PostMapping("/submitProjectArchive")
// public Result<?> submitProjectArchive(@RequestBody HashMap<String,String> param){ /**
// String projectid = param.get("projectid"); * 批量导出项目信息
// WorkFlow workFlow = workflowService.createFlow("createProjectArchive",projectid); * @param response response
// HuzhouProjectinfo huzhouProjectinfo = new HuzhouProjectinfo(); * @param projectinfo 导出条件
// huzhouProjectinfo.setId(projectid); */
// huzhouProjectinfo.setStage("7");
// projectinfoService.updateById(huzhouProjectinfo);
// return Result.ok("项目入库申请已发起成功");
// }
// @PostMapping("/approveProjectArchive")
// public Result<?> approveProjectArchive(@RequestBody ProjectApproveOV approveOV
// ) throws Exception {
// String taskId =approveOV.getTaskId();
// String flag = approveOV.getFlag();
// String projectid =approveOV.getProjectid();
// String comment=approveOV.getComment();
// WorkFlow workFlow = workflowService.approveProjectInfo(taskId, flag, comment);
// if("3".equals(flag)){
// processinfoService.modifyStatusByProjectId(projectid,"0","createProjectArchive");
// return Result.ok("作废成功!");
// }
// ProcessInstance processInstance = runtimeService.createProcessInstanceQuery().processInstanceId(workFlow.getProcessInstanceId()).singleResult();
// if(processInstance==null&&"1".equals(flag)){
// projectinfoService.modifyStageById(projectid,"8");
// processinfoService.modifyStatusByProjectId(projectid,"2","createProjectArchive");
// }
// return Result.ok("审批成功");
// }
@GetMapping("/batchdownloadProject") @GetMapping("/batchdownloadProject")
public void batchdownloadProject(HttpServletResponse response,HuzhouProjectinfo projectinfo){ public void batchdownloadProject(HttpServletResponse response,HuzhouProjectinfo projectinfo){
projectinfoService.batchdownloadProject(response,projectinfo); projectinfoService.batchdownloadProject(response,projectinfo);

49
huzhou/src/main/java/com/easy/admin/modules/huzhou/controller/HuzhouWorkreportController.java

@ -1,8 +1,10 @@
package com.easy.admin.modules.huzhou.controller; package com.easy.admin.modules.huzhou.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.easy.admin.common.api.vo.Result; import com.easy.admin.common.api.vo.Result;
import com.easy.admin.common.core.exception.EasyException; import com.easy.admin.common.core.exception.EasyException;
import com.easy.admin.modules.huzhou.entity.HuzhouProjectinfo;
import com.easy.admin.modules.huzhou.entity.HuzhouWorkreport; import com.easy.admin.modules.huzhou.entity.HuzhouWorkreport;
import com.easy.admin.modules.huzhou.service.IHuzhouWorkreportService; import com.easy.admin.modules.huzhou.service.IHuzhouWorkreportService;
import com.easy.admin.modules.huzhou.vo.HuzhouWorkreportOV; import com.easy.admin.modules.huzhou.vo.HuzhouWorkreportOV;
@ -11,6 +13,7 @@ import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import java.io.IOException; import java.io.IOException;
import java.util.List;
@RestController @RestController
@ -18,10 +21,36 @@ import java.io.IOException;
public class HuzhouWorkreportController { public class HuzhouWorkreportController {
@Autowired @Autowired
private IHuzhouWorkreportService workreportService; private IHuzhouWorkreportService workreportService;
@PostMapping("setProjectWorkReport")
public void setProjectWorkReport(@RequestBody HuzhouProjectinfo huzhouProjectinfo){
workreportService.setProjectWorkReport(huzhouProjectinfo);
}
/**
* 获取未创建周月报类型的项目
* @param projectinfo 查询条件
* @param pageNo
* @param pageSize
* @return IPage<HuzhouProjectinfo>
*/
@GetMapping("getNoTypeWorkReportPageList")
public Result<?> getNoTypeWorkReportPageList(HuzhouProjectinfo projectinfo,@RequestParam(name="current", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize){
IPage<HuzhouProjectinfo> res=workreportService.getNoTypeWorkReportPageList(projectinfo,pageNo,pageSize);
return Result.ok(res);
}
/**
* 获取已创建的周月报项目
* @param workreportOV
* @param pageNo
* @param pageSize
* @return
*/
@GetMapping("/workreportPageList") @GetMapping("/workreportPageList")
public Result<?> workreportPageList(HuzhouWorkreportOV workreportOV,@RequestParam(name="current", defaultValue="1") Integer pageNo, public Result<?> workreportPageList(HuzhouProjectinfo huzhouProjectinfo,@RequestParam(name="current", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize){ @RequestParam(name="pageSize", defaultValue="10") Integer pageSize){
Page<HuzhouWorkreportOV> pageList = workreportService.getWorkreportPageList(workreportOV, pageNo, pageSize); Page<HuzhouProjectinfo> pageList = workreportService.getWorkreportPageList(huzhouProjectinfo, pageNo, pageSize);
return Result.ok(pageList); return Result.ok(pageList);
} }
@GetMapping("/getWorkreportById") @GetMapping("/getWorkreportById")
@ -42,12 +71,12 @@ public class HuzhouWorkreportController {
} }
throw new EasyException("修改失败"); throw new EasyException("修改失败");
} }
@PostMapping("/deleteWorkreport") // @PostMapping("/deleteWorkreport")
public Result<?> deleteContractinfo(@RequestBody HuzhouWorkreport workreport) throws IOException { // public Result<?> deleteContractinfo(@RequestBody HuzhouWorkreport workreport) throws IOException {
Boolean aBoolean = workreportService.deleteWorkreport(workreport); // Boolean aBoolean = workreportService.deleteWorkreport(workreport);
if(aBoolean){ // if(aBoolean){
return Result.ok("删除成功"); // return Result.ok("删除成功");
} // }
throw new EasyException("删除失败"); // throw new EasyException("删除失败");
} // }
} }

7
huzhou/src/main/java/com/easy/admin/modules/huzhou/dao/HuzhouProjectinfoHistoryMapper.java

@ -0,0 +1,7 @@
package com.easy.admin.modules.huzhou.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.easy.admin.modules.huzhou.entity.HuzhouProjectinfoHistory;
public interface HuzhouProjectinfoHistoryMapper extends BaseMapper<HuzhouProjectinfoHistory> {
}

30
huzhou/src/main/java/com/easy/admin/modules/huzhou/dao/HuzhouProjectinfoMapper.java

@ -2,11 +2,41 @@ package com.easy.admin.modules.huzhou.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.easy.admin.modules.huzhou.vo.HuzhouProjectinfoOV;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import com.easy.admin.modules.huzhou.entity.HuzhouProjectinfo; import com.easy.admin.modules.huzhou.entity.HuzhouProjectinfo;
import java.util.List;
import java.util.Map; import java.util.Map;
public interface HuzhouProjectinfoMapper extends BaseMapper<HuzhouProjectinfo> { public interface HuzhouProjectinfoMapper extends BaseMapper<HuzhouProjectinfo> {
/**
* 分页获取项目信息,不含子项目
* @param page 分页信息
* @param info 查询条件
* @return Page<HuzhouProjectinfo>
*/
Page<HuzhouProjectinfo> getProjectInfoPageList(Page page,HuzhouProjectinfo info); Page<HuzhouProjectinfo> getProjectInfoPageList(Page page,HuzhouProjectinfo info);
/**
* 获取项目信息列表
* @param info 查询条件
* @return List<HuzhouProjectinfo>
*/
List<HuzhouProjectinfo> getProjectInfoPageList(HuzhouProjectinfo info);
/**
* 获取项目信息和子项目信息支持分页
* @param page 分页信息
* @param info 查询条件
* @return Page<HuzhouProjectinfoOV>
*/
Page<HuzhouProjectinfoOV> getProjectAndChildInfoPageList(Page page, HuzhouProjectinfo info);
/**
* 获取项目信息和子项目信息列表
* @param info 查询条件
* @return List<HuzhouProjectinfoOV>
*/
List<HuzhouProjectinfoOV> getProjectAndChildInfoPageList( HuzhouProjectinfo info);
} }

5
huzhou/src/main/java/com/easy/admin/modules/huzhou/dao/HuzhouWorkreportMapper.java

@ -1,13 +1,16 @@
package com.easy.admin.modules.huzhou.dao; package com.easy.admin.modules.huzhou.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.easy.admin.modules.huzhou.entity.HuzhouProjectinfo;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import com.easy.admin.modules.huzhou.entity.HuzhouWorkreport; import com.easy.admin.modules.huzhou.entity.HuzhouWorkreport;
import com.easy.admin.modules.huzhou.vo.HuzhouWorkreportOV; import com.easy.admin.modules.huzhou.vo.HuzhouWorkreportOV;
public interface HuzhouWorkreportMapper extends BaseMapper<HuzhouWorkreport> { public interface HuzhouWorkreportMapper extends BaseMapper<HuzhouWorkreport> {
Page<HuzhouWorkreportOV> getWorkreportPageList(Page page, HuzhouWorkreportOV info); Page<HuzhouProjectinfo> getWorkreportPageList(Page page, HuzhouProjectinfo info);
IPage<HuzhouProjectinfo> getNoTypeWorkReportPageList(Page page, HuzhouProjectinfo info);
} }

111
huzhou/src/main/java/com/easy/admin/modules/huzhou/dao/mapping/HuzhouProjectinfoMapper.xml

@ -1,6 +1,60 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.easy.admin.modules.huzhou.dao.HuzhouProjectinfoMapper"> <mapper namespace="com.easy.admin.modules.huzhou.dao.HuzhouProjectinfoMapper">
<resultMap id="HuzhouProjectinfoMap" type="com.easy.admin.modules.huzhou.vo.HuzhouProjectinfoOV">
<result property="id" column="id" jdbcType="VARCHAR"/>
<result property="projectName" column="project_name" jdbcType="VARCHAR"/>
<result property="adminDivision" column="admin_division" jdbcType="VARCHAR"/>
<result property="description" column="description" jdbcType="VARCHAR"/>
<result property="projectType" column="project_type" jdbcType="VARCHAR"/>
<result property="dutyWorkplace" column="duty_workplace" jdbcType="VARCHAR"/>
<result property="constructionPeriod" column="construction_period" jdbcType="VARCHAR"/>
<result property="centralMoney" column="central_money" jdbcType="NUMERIC"/>
<result property="provincialMoney" column="provincial_money" jdbcType="NUMERIC"/>
<result property="cityMoney" column="city_money" jdbcType="NUMERIC"/>
<result property="countyMoney" column="county_money" jdbcType="NUMERIC"/>
<result property="reformName" column="reform_name" jdbcType="VARCHAR"/>
<result property="superLeader" column="super_leader" jdbcType="VARCHAR"/>
<result property="projectContacts" column="project_contacts" jdbcType="VARCHAR"/>
<result property="phone" column="phone" jdbcType="VARCHAR"/>
<result property="manageOrg" column="manage_org" jdbcType="VARCHAR"/>
<result property="manageContactor" column="manage_contactor" jdbcType="VARCHAR"/>
<result property="controler" column="controler" jdbcType="VARCHAR"/>
<result property="controlerContactor" column="controler_contactor" jdbcType="VARCHAR"/>
<result property="supervisor" column="supervisor" jdbcType="VARCHAR"/>
<result property="supervisorContactor" column="supervisor_contactor" jdbcType="VARCHAR"/>
<result property="owner" column="owner" jdbcType="VARCHAR"/>
<result property="ownerContactor" column="owner_contactor" jdbcType="VARCHAR"/>
<result property="consult" column="consult" jdbcType="VARCHAR"/>
<result property="consultContactor" column="consult_contactor" jdbcType="VARCHAR"/>
<result property="contructor" column="contructor" jdbcType="VARCHAR"/>
<result property="contructorContactor" column="contructor_contactor" jdbcType="VARCHAR"/>
<result property="stage" column="stage" jdbcType="VARCHAR"/>
<result property="createDate" column="create_date" jdbcType="TIMESTAMP"/>
<result property="createUser" column="create_user" jdbcType="VARCHAR"/>
<result property="editDate" column="edit_date" jdbcType="TIMESTAMP"/>
<result property="editUser" column="edit_user" jdbcType="VARCHAR"/>
<result property="workplaceProperties" column="workplace_properties" jdbcType="VARCHAR"/>
<result property="totalMoney" column="total_money" jdbcType="NUMERIC"/>
<result property="selfMoney" column="self_money" jdbcType="NUMERIC"/>
<result property="payamount2023Money" column="payamount2023_money" jdbcType="NUMERIC"/>
<result property="payamount2024Money" column="payamount2024_money" jdbcType="NUMERIC"/>
<result property="payamount2025Money" column="payamount2025_money" jdbcType="VARCHAR"/>
<collection property="children" ofType="com.easy.admin.modules.huzhou.entity.HuzhouSubProjectinfo" select="selectchildrenMapList" column="id"/>
</resultMap>
<resultMap id="childrenMap" type="com.easy.admin.modules.huzhou.entity.HuzhouSubProjectinfo">
<id property="id" column="sub_id" />
<result property="projectName" column="sub_project_name" jdbcType="VARCHAR"/>
<result property="adminDivision" column="sub_admin_division" jdbcType="VARCHAR"/>
<result property="description" column="sub_description" jdbcType="VARCHAR"/>
<result property="dutyWorkplace" column="sub_duty_workplace" jdbcType="VARCHAR"/>
<result property="constructionPeriod" column="sub_construction_period" jdbcType="VARCHAR"/>
<result property="reformName" column="sub_reform_name" jdbcType="VARCHAR"/>
<result property="superLeader" column="sub_super_leader" jdbcType="VARCHAR"/>
<result property="stage" column="sub_stage" jdbcType="VARCHAR"/>
<result property="workplaceProperties" column="sub_workplace_properties" jdbcType="VARCHAR"/>
</resultMap>
<!-- u.id,u.project_name,u.admin_division,u.duty_workplace,u.workplace_properties,u.reform_name,u.super_leader,u.stage-->
<select id="getProjectInfoPageList" resultType="com.easy.admin.modules.huzhou.entity.HuzhouProjectinfo" parameterType="com.easy.admin.modules.huzhou.entity.HuzhouProjectinfo"> <select id="getProjectInfoPageList" resultType="com.easy.admin.modules.huzhou.entity.HuzhouProjectinfo" parameterType="com.easy.admin.modules.huzhou.entity.HuzhouProjectinfo">
SELECT * from huzhou_projectinfo u SELECT * from huzhou_projectinfo u
<where> <where>
@ -56,4 +110,61 @@
</where> </where>
order by create_date desc order by create_date desc
</select> </select>
<select id="getProjectAndChildInfoPageList" resultMap="HuzhouProjectinfoMap" parameterType="com.easy.admin.modules.huzhou.entity.HuzhouProjectinfo">
SELECT * from huzhou_projectinfo u
<where>
<if test="info.projectContacts!=null and info.projectContacts!=''">
and u.id in(
select project_id from huzhou_userproject where user_id=#{info.projectContacts}
)
</if>
<if test="info.supervisorContactor!=null and info.supervisorContactor!=''">
and u.id in(
SELECT DISTINCT id from huzhou_projectinfo e where e.admin_division in(
SELECT DISTINCT a.admin_division from huzhou_projectinfo a where a.id in (select c.project_id from
huzhou_userproject c where c.user_id=#{info.supervisorContactor})
)
OR
e.super_leader in (
SELECT DISTINCT b.super_leader from huzhou_projectinfo b where b.id in (select d.project_id from
huzhou_userproject d where d.user_id=#{info.supervisorContactor})
)
)
</if>
<if test="info.projectName!=null and info.projectName!=''">
<bind name="tempStr" value="'%' + info.projectName + '%'" />
and u.project_name like #{tempStr}
</if>
<if test="info.adminDivision!=null and info.adminDivision!=''">
<bind name="tempStr" value="'%' + info.adminDivision + '%'" />
and u.admin_division like #{tempStr}
</if>
<if test="info.dutyWorkplace!=null and info.dutyWorkplace!=''">
<bind name="tempStr" value="'%' + info.dutyWorkplace + '%'" />
and u.duty_workplace like #{tempStr}
</if>
<if test="info.workplaceProperties!=null and info.workplaceProperties!=''">
<bind name="tempStr" value="'%' + info.workplaceProperties + '%'" />
and u.workplace_properties like #{tempStr}
</if>
<if test="info.dutyWorkplace!=null and info.dutyWorkplace!=''">
<bind name="tempStr" value="'%' + info.dutyWorkplace + '%'" />
and u.duty_workplace like #{tempStr}
</if>
<if test="info.reformName!=null and info.reformName!=''">
and u.reform_name = #{info.reformName}
</if>
<if test="info.superLeader!=null and info.superLeader!=''">
and u.super_leader = #{info.superLeader}
</if>
<if test="info.stage!=null and info.stage!=''">
and u.stage &gt;= #{info.stage}
</if>
</where>
</select>
<select id="selectchildrenMapList" resultType="com.easy.admin.modules.huzhou.entity.HuzhouSubProjectinfo">
select * from huzhou_sub_projectinfo where project_id = #{id}
</select>
</mapper> </mapper>

135
huzhou/src/main/java/com/easy/admin/modules/huzhou/dao/mapping/HuzhouWorkreportMapper.xml

@ -1,17 +1,51 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.easy.admin.modules.huzhou.dao.HuzhouWorkreportMapper"> <mapper namespace="com.easy.admin.modules.huzhou.dao.HuzhouWorkreportMapper">
<select id="getWorkreportPageList" resultType="com.easy.admin.modules.huzhou.vo.HuzhouWorkreportOV" parameterType="com.easy.admin.modules.huzhou.vo.HuzhouWorkreportOV"> <!-- <select id="getWorkreportPageList" resultType="com.easy.admin.modules.huzhou.vo.HuzhouWorkreportOV" parameterType="com.easy.admin.modules.huzhou.vo.HuzhouWorkreportOV">-->
select a.*,b.project_name from huzhou_workreport a LEFT JOIN huzhou_projectinfo b on a.projectid =b.id <!-- select a.*,b.project_name from huzhou_workreport a LEFT JOIN huzhou_projectinfo b on a.projectid =b.id-->
<!-- <where>-->
<!-- b.stage >= 2-->
<!-- <if test="info.projectContacts!=null and info.projectContacts!=''">-->
<!-- and b.id in(-->
<!-- select DISTINCT project_id from huzhou_userproject where user_id=#{info.projectContacts}-->
<!-- )-->
<!-- </if>-->
<!-- <if test="info.supervisorContactor!=null and info.supervisorContactor!=''">-->
<!-- and b.id in(-->
<!-- SELECT DISTINCT id from huzhou_projectinfo e where e.admin_division in(-->
<!-- SELECT DISTINCT a.admin_division from huzhou_projectinfo a where a.id in (select c.project_id from-->
<!-- huzhou_userproject c where c.user_id=#{info.supervisorContactor})-->
<!-- )-->
<!-- OR-->
<!-- e.super_leader in (-->
<!-- SELECT DISTINCT b.super_leader from huzhou_projectinfo b where b.id in (select d.project_id from-->
<!-- huzhou_userproject d where d.user_id=#{info.supervisorContactor})-->
<!-- )-->
<!-- )-->
<!-- </if>-->
<!-- <if test="info.documentName!=null and info.documentName!=''">-->
<!-- <bind name="tempStr" value="'%' + info.documentName + '%'" />-->
<!-- and a.document_name like #{tempStr}-->
<!-- </if>-->
<!-- <if test="info.projectName!=null and info.projectName!=''">-->
<!-- <bind name="tempStr" value="'%' + info.projectName + '%'" />-->
<!-- and b.project_name like #{tempStr}-->
<!-- </if>-->
<!-- </where>-->
<!-- order by b.project_name,a.create_date-->
<!-- </select>-->
<select id="getWorkreportPageList" resultType="com.easy.admin.modules.huzhou.entity.HuzhouProjectinfo" parameterType="com.easy.admin.modules.huzhou.entity.HuzhouProjectinfo">
SELECT * from huzhou_projectinfo u
<where> <where>
b.stage >= 2 u.report_type is not null
<if test="info.projectContacts!=null and info.projectContacts!=''"> <if test="info.projectContacts!=null and info.projectContacts!=''">
and b.id in( and u.id in(
select DISTINCT project_id from huzhou_userproject where user_id=#{info.projectContacts} select project_id from huzhou_userproject where user_id=#{info.projectContacts}
) )
</if> </if>
<if test="info.supervisorContactor!=null and info.supervisorContactor!=''"> <if test="info.supervisorContactor!=null and info.supervisorContactor!=''">
and b.id in( and u.id in(
SELECT DISTINCT id from huzhou_projectinfo e where e.admin_division in( SELECT DISTINCT id from huzhou_projectinfo e where e.admin_division in(
SELECT DISTINCT a.admin_division from huzhou_projectinfo a where a.id in (select c.project_id from SELECT DISTINCT a.admin_division from huzhou_projectinfo a where a.id in (select c.project_id from
huzhou_userproject c where c.user_id=#{info.supervisorContactor}) huzhou_userproject c where c.user_id=#{info.supervisorContactor})
@ -24,15 +58,94 @@
) )
) )
</if> </if>
<if test="info.documentName!=null and info.documentName!=''"> <if test="info.projectName!=null and info.projectName!=''">
<bind name="tempStr" value="'%' + info.documentName + '%'" /> <bind name="tempStr" value="'%' + info.projectName + '%'" />
and a.document_name like #{tempStr} and u.project_name like #{tempStr}
</if>
<if test="info.adminDivision!=null and info.adminDivision!=''">
<bind name="tempStr" value="'%' + info.adminDivision + '%'" />
and u.admin_division like #{tempStr}
</if>
<if test="info.dutyWorkplace!=null and info.dutyWorkplace!=''">
<bind name="tempStr" value="'%' + info.dutyWorkplace + '%'" />
and u.duty_workplace like #{tempStr}
</if>
<if test="info.workplaceProperties!=null and info.workplaceProperties!=''">
<bind name="tempStr" value="'%' + info.workplaceProperties + '%'" />
and u.workplace_properties like #{tempStr}
</if>
<if test="info.dutyWorkplace!=null and info.dutyWorkplace!=''">
<bind name="tempStr" value="'%' + info.dutyWorkplace + '%'" />
and u.duty_workplace like #{tempStr}
</if>
<if test="info.reformName!=null and info.reformName!=''">
and u.reform_name = #{info.reformName}
</if>
<if test="info.superLeader!=null and info.superLeader!=''">
and u.super_leader = #{info.superLeader}
</if>
<if test="info.stage!=null and info.stage!=''">
and u.stage &gt;= 2
</if>
</where>
order by create_date desc
</select>
<select id="getNoTypeWorkReportPageList" resultType="com.easy.admin.modules.huzhou.entity.HuzhouProjectinfo" parameterType="com.easy.admin.modules.huzhou.entity.HuzhouProjectinfo">
SELECT * from huzhou_projectinfo u
<where>
u.report_type is null
<if test="info.projectContacts!=null and info.projectContacts!=''">
and u.id in(
select project_id from huzhou_userproject where user_id=#{info.projectContacts}
)
</if>
<if test="info.supervisorContactor!=null and info.supervisorContactor!=''">
and u.id in(
SELECT DISTINCT id from huzhou_projectinfo e where e.admin_division in(
SELECT DISTINCT a.admin_division from huzhou_projectinfo a where a.id in (select c.project_id from
huzhou_userproject c where c.user_id=#{info.supervisorContactor})
)
OR
e.super_leader in (
SELECT DISTINCT b.super_leader from huzhou_projectinfo b where b.id in (select d.project_id from
huzhou_userproject d where d.user_id=#{info.supervisorContactor})
)
)
</if> </if>
<if test="info.projectName!=null and info.projectName!=''"> <if test="info.projectName!=null and info.projectName!=''">
<bind name="tempStr" value="'%' + info.projectName + '%'" /> <bind name="tempStr" value="'%' + info.projectName + '%'" />
and b.project_name like #{tempStr} and u.project_name like #{tempStr}
</if>
<if test="info.adminDivision!=null and info.adminDivision!=''">
<bind name="tempStr" value="'%' + info.adminDivision + '%'" />
and u.admin_division like #{tempStr}
</if>
<if test="info.dutyWorkplace!=null and info.dutyWorkplace!=''">
<bind name="tempStr" value="'%' + info.dutyWorkplace + '%'" />
and u.duty_workplace like #{tempStr}
</if>
<if test="info.workplaceProperties!=null and info.workplaceProperties!=''">
<bind name="tempStr" value="'%' + info.workplaceProperties + '%'" />
and u.workplace_properties like #{tempStr}
</if>
<if test="info.dutyWorkplace!=null and info.dutyWorkplace!=''">
<bind name="tempStr" value="'%' + info.dutyWorkplace + '%'" />
and u.duty_workplace like #{tempStr}
</if>
<if test="info.reformName!=null and info.reformName!=''">
and u.reform_name = #{info.reformName}
</if>
<if test="info.superLeader!=null and info.superLeader!=''">
and u.super_leader = #{info.superLeader}
</if>
<if test="info.stage!=null and info.stage!=''">
and u.stage &gt;= 2
</if> </if>
</where> </where>
order by b.project_name,a.create_date order by create_date desc
</select> </select>
</mapper> </mapper>

8
huzhou/src/main/java/com/easy/admin/modules/huzhou/entity/HuzhouProjectinfo.java

@ -2,9 +2,6 @@ package com.easy.admin.modules.huzhou.entity;
import lombok.Data; import lombok.Data;
import java.util.Date;
import java.io.Serializable;
/** /**
* (HuzhouProjectinfo)实体类 * (HuzhouProjectinfo)实体类
* *
@ -12,8 +9,7 @@ import java.io.Serializable;
* @since 2024-02-05 14:14:53 * @since 2024-02-05 14:14:53
*/ */
@Data @Data
public class HuzhouProjectinfo extends BaseEntity implements Serializable{ public class HuzhouProjectinfo extends BaseEntity {
private static final long serialVersionUID = 952171041224600588L;
/** /**
* 项目id * 项目id
*/ */
@ -150,7 +146,7 @@ public class HuzhouProjectinfo extends BaseEntity implements Serializable{
* 2025年支付 * 2025年支付
*/ */
private Double payamount2025Money; private Double payamount2025Money;
private String reportType;
} }

162
huzhou/src/main/java/com/easy/admin/modules/huzhou/entity/HuzhouProjectinfoHistory.java

@ -0,0 +1,162 @@
package com.easy.admin.modules.huzhou.entity;
import lombok.Data;
import java.util.Date;
import java.io.Serializable;
/**
* (HuzhouProjectinfoHistory)实体类
*
* @author makejava
* @since 2024-04-15 16:44:02
*/
@Data
public class HuzhouProjectinfoHistory extends BaseEntity {
/**
* id
*/
private String id;
/**
* 项目名称
*/
private String projectName;
/**
* 行政区划
*/
private String adminDivision;
/**
* 主要任务及标志性成果
*/
private String description;
/**
* 项目类型
*/
private String projectType;
/**
* 责任单位
*/
private String dutyWorkplace;
/**
* 建设年限
*/
private String constructionPeriod;
/**
* 中央资金
*/
private Double centralMoney;
/**
* 省级资金
*/
private Double provincialMoney;
/**
* 市级资金
*/
private Double cityMoney;
/**
* 区县级资金
*/
private Double countyMoney;
/**
* 所属改革任务
*/
private String reformName;
/**
* 上级指导处室
*/
private String superLeader;
/**
* 项目联系人
*/
private String projectContacts;
/**
* 联系电话
*/
private String phone;
/**
* 管理单位
*/
private String manageOrg;
/**
* 管理单位负责人
*/
private String manageContactor;
/**
* 监理单位
*/
private String controler;
/**
* 监理单位负责人
*/
private String controlerContactor;
/**
* 监管单位
*/
private String supervisor;
/**
* 监管单位负责人
*/
private String supervisorContactor;
/**
* 建设单位
*/
private String owner;
/**
* 建设单位负责人
*/
private String ownerContactor;
/**
* 咨询单位
*/
private String consult;
/**
* 咨询单位负责人
*/
private String consultContactor;
/**
* 承建单位
*/
private String contructor;
/**
* 承建单位负责人
*/
private String contructorContactor;
/**
* 项目阶段
*/
private String stage;
/**
* 单位属性
*/
private String workplaceProperties;
/**
* 总投资
*/
private String totalMoney;
/**
* 自筹资金
*/
private String selfMoney;
/**
* 2023年支付
*/
private Double payamount2023Money;
/**
* 2024年支付
*/
private Double payamount2024Money;
/**
* 2025年支付
*/
private Double payamount2025Money;
/**
* 项目id
*/
private String projectId;
}

44
huzhou/src/main/java/com/easy/admin/modules/huzhou/service/IHuzhouProjectinfoService.java

@ -22,22 +22,50 @@ import java.util.List;
* @since 2024-01-23 09:33:31 * @since 2024-01-23 09:33:31
*/ */
public interface IHuzhouProjectinfoService extends IService<HuzhouProjectinfo>{ public interface IHuzhouProjectinfoService extends IService<HuzhouProjectinfo>{
/**
// void submitProject(HuzhouProjectinfo info); * 修改项目阶段信息
* @param id 项目id
* @param stage 阶段
*/
void modifyStageById(String id,String stage); void modifyStageById(String id,String stage);
void modifyismodifyById(String id,String ismodify);
/**
* 分页查询项目信息列表
* @param projectinfo 条件
* @param pageNo 页面
* @param pageSize 页数
* @return 返回值
*/
IPage<HuzhouProjectinfo> getProjectInfoPageList(HuzhouProjectinfo projectinfo, Integer pageNo, Integer pageSize); IPage<HuzhouProjectinfo> getProjectInfoPageList(HuzhouProjectinfo projectinfo, Integer pageNo, Integer pageSize);
/**
* 分页查询项目信息列表带子项目信息
* @param projectinfo 条件
* @param pageNo 页面
* @param pageSize 页数
* @return 返回值
*/
IPage<HuzhouProjectinfoOV> getProjectInfoAndChildPageList(HuzhouProjectinfo projectinfo, Integer pageNo, Integer pageSize); IPage<HuzhouProjectinfoOV> getProjectInfoAndChildPageList(HuzhouProjectinfo projectinfo, Integer pageNo, Integer pageSize);
List<HuzhouProjectinfo> getProjectInfoList(HuzhouProjectinfo projectinfo);
/** /**
* 管理人员批量导入项目 * 管理人员批量导入项目
* @param multipartFile 文件信息 * @param multipartFile 文件信息
*/ */
void batchImportProjects(MultipartFile multipartFile) throws Exception; void batchImportProjects(MultipartFile multipartFile) throws Exception;
/**
* 批量导出项目信息
* @param response response
* @param projectinfo 导出条件
*/
void batchdownloadProject(HttpServletResponse response, HuzhouProjectinfo projectinfo); void batchdownloadProject(HttpServletResponse response, HuzhouProjectinfo projectinfo);
/**
* 查询项目信息包含了子项目信息的查询
* @param id 项目id
* @return 返回值
*/
Object queryProjectInfoById(String id); Object queryProjectInfoById(String id);
Object queryProjectInfoNewDataById(String id);
/** /**
* 新增项目入库提交单个项目 * 新增项目入库提交单个项目
@ -50,4 +78,10 @@ public interface IHuzhouProjectinfoService extends IService<HuzhouProjectinfo>{
* @param projectApproveOV 项目入库信息 * @param projectApproveOV 项目入库信息
*/ */
void approveProjectInfo(ProjectApproveOV projectApproveOV); void approveProjectInfo(ProjectApproveOV projectApproveOV);
/**
* 修改项目联系人
* @param huzhouProjectinfo 项目信息
*/
void modifyProjectInfoContact(HuzhouProjectinfo huzhouProjectinfo);
} }

11
huzhou/src/main/java/com/easy/admin/modules/huzhou/service/IHuzhouWorkreportService.java

@ -1,7 +1,9 @@
package com.easy.admin.modules.huzhou.service; package com.easy.admin.modules.huzhou.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.easy.admin.modules.huzhou.entity.HuzhouProjectinfo;
import com.easy.admin.modules.huzhou.entity.HuzhouWorkreport; import com.easy.admin.modules.huzhou.entity.HuzhouWorkreport;
import com.easy.admin.modules.huzhou.entity.HuzhouWorkreport; import com.easy.admin.modules.huzhou.entity.HuzhouWorkreport;
import com.easy.admin.modules.huzhou.vo.HuzhouWorkreportOV; import com.easy.admin.modules.huzhou.vo.HuzhouWorkreportOV;
@ -10,11 +12,18 @@ import org.springframework.web.multipart.MultipartFile;
import java.io.IOException; import java.io.IOException;
public interface IHuzhouWorkreportService extends IService<HuzhouWorkreport> { public interface IHuzhouWorkreportService extends IService<HuzhouWorkreport> {
Page<HuzhouWorkreportOV> getWorkreportPageList(HuzhouWorkreportOV Workreport, Integer pageNo, Page<HuzhouProjectinfo> getWorkreportPageList(HuzhouProjectinfo huzhouProjectinfo, Integer pageNo,
Integer pageSize); Integer pageSize);
void addWorkreport(MultipartFile file, HuzhouWorkreport Workreport) throws IOException; void addWorkreport(MultipartFile file, HuzhouWorkreport Workreport) throws IOException;
Boolean modifyWorkreport(MultipartFile file, HuzhouWorkreport Workreport) throws IOException; Boolean modifyWorkreport(MultipartFile file, HuzhouWorkreport Workreport) throws IOException;
Boolean deleteWorkreport(HuzhouWorkreport Workreport); Boolean deleteWorkreport(HuzhouWorkreport Workreport);
/**
* 设置项目周月报的类型
* @param huzhouProjectinfo 参数
*/
void setProjectWorkReport(HuzhouProjectinfo huzhouProjectinfo);
IPage<HuzhouProjectinfo> getNoTypeWorkReportPageList(HuzhouProjectinfo projectinfo, Integer pageNo, Integer pageSize);
} }

294
huzhou/src/main/java/com/easy/admin/modules/huzhou/service/impl/HuzhouProjectinfoServiceImpl.java

@ -11,9 +11,11 @@ import com.easy.admin.auth.model.SysUser;
import com.easy.admin.auth.service.SysUserService; import com.easy.admin.auth.service.SysUserService;
import com.easy.admin.common.core.common.select.Select; import com.easy.admin.common.core.common.select.Select;
import com.easy.admin.common.core.exception.EasyException; import com.easy.admin.common.core.exception.EasyException;
import com.easy.admin.common.util.CommonUtils;
import com.easy.admin.modules.huzhou.common.HuzhouCommonUtils; import com.easy.admin.modules.huzhou.common.HuzhouCommonUtils;
import com.easy.admin.modules.huzhou.common.TemplateExcelUtils; import com.easy.admin.modules.huzhou.common.TemplateExcelUtils;
import com.easy.admin.modules.huzhou.dao.HuzhouProcessinfoMapper; import com.easy.admin.modules.huzhou.dao.HuzhouProcessinfoMapper;
import com.easy.admin.modules.huzhou.dao.HuzhouProjectinfoHistoryMapper;
import com.easy.admin.modules.huzhou.dao.HuzhouProjectinfoMapper; import com.easy.admin.modules.huzhou.dao.HuzhouProjectinfoMapper;
import com.easy.admin.modules.huzhou.dao.HuzhouSubProjectinfoMapper; import com.easy.admin.modules.huzhou.dao.HuzhouSubProjectinfoMapper;
import com.easy.admin.modules.huzhou.entity.*; import com.easy.admin.modules.huzhou.entity.*;
@ -60,8 +62,6 @@ public class HuzhouProjectinfoServiceImpl extends ServiceImpl<HuzhouProjectinfoM
@Autowired @Autowired
private HuzhouSubProjectinfoMapper subProjectinfoMapper; private HuzhouSubProjectinfoMapper subProjectinfoMapper;
@Autowired @Autowired
private HuzhouProcessinfoMapper processinfoMapper;
@Autowired
private IHuzhouUserprojectService userprojectService; private IHuzhouUserprojectService userprojectService;
@Autowired @Autowired
private IWorkflowService workflowService; private IWorkflowService workflowService;
@ -70,20 +70,20 @@ public class HuzhouProjectinfoServiceImpl extends ServiceImpl<HuzhouProjectinfoM
@Autowired @Autowired
private IHuzhouProcessinfoService processinfoService; private IHuzhouProcessinfoService processinfoService;
@Autowired @Autowired
private IHuzhouFieldchangehistoryService fieldchangehistoryService; private HuzhouProjectinfoHistoryMapper historyMapper;
@Override @Override
@Transactional @Transactional
public void submitProject(HuzhouProjectinfo info) { public void submitProject(HuzhouProjectinfo info) {
//保存项目信息 //保存项目信息
info.setStage("1");//最开始的状态。项目入库中 info.setStage("1");//最开始的状态。项目入库中
this.save(info);//保存项目信息 this.save(info);//保存项目信息
userprojectService.saveFromProject(info,"0"); userprojectService.saveFromProject(info,"0");//保存项目联系人信息,0表示当前醒目是主项目
WorkFlow workFlow = workflowService.createFlow("creatProjectinfo",info.getId());//创建流程 WorkFlow workFlow = workflowService.createFlow("creatProjectinfo",info.getId());//创建流程
} }
@Override @Override
@Transactional @Transactional
public void batchImportProjects(MultipartFile multipartFile) throws Exception { public void batchImportProjects(MultipartFile multipartFile) throws Exception {
//是否有文件
if (multipartFile == null && multipartFile.getSize() == 0) { if (multipartFile == null && multipartFile.getSize() == 0) {
throw new EasyException("文件上传错误,重新上传"); throw new EasyException("文件上传错误,重新上传");
} }
@ -92,6 +92,7 @@ public class HuzhouProjectinfoServiceImpl extends ServiceImpl<HuzhouProjectinfoM
if (!(filename.endsWith(".xls") || filename.endsWith(".xlsx"))) { if (!(filename.endsWith(".xls") || filename.endsWith(".xlsx"))) {
throw new EasyException("文件上传格式有误,请重新上传"); throw new EasyException("文件上传格式有误,请重新上传");
} }
//获取表格文件内的信息
InputStream inputStream = multipartFile.getInputStream(); InputStream inputStream = multipartFile.getInputStream();
Workbook workbook = null; Workbook workbook = null;
if (filename.endsWith(".xlsx")) { if (filename.endsWith(".xlsx")) {
@ -105,9 +106,9 @@ public class HuzhouProjectinfoServiceImpl extends ServiceImpl<HuzhouProjectinfoM
HashMap<String, String> NameMap = new HashMap<String, String>(); HashMap<String, String> NameMap = new HashMap<String, String>();
HashMap<String, String> chineseNameMap = new HashMap<String, String>(); HashMap<String, String> chineseNameMap = new HashMap<String, String>();
Row titlerow = sheet.getRow(0); Row titlerow = sheet.getRow(0);//第一行字段名称
Row chineseTitlerow = sheet.getRow(1); Row chineseTitlerow = sheet.getRow(1); //第二行中文标题
int cellNum = 32; int cellNum = 32;//一共32列
//第一行获取字段名称 //第一行获取字段名称
for (int i = 0; i < cellNum; i++) { for (int i = 0; i < cellNum; i++) {
NameMap.put(String.valueOf(i),titlerow.getCell(i).getStringCellValue()); NameMap.put(String.valueOf(i),titlerow.getCell(i).getStringCellValue());
@ -117,13 +118,14 @@ public class HuzhouProjectinfoServiceImpl extends ServiceImpl<HuzhouProjectinfoM
chineseNameMap.put(String.valueOf(i),chineseTitlerow.getCell(i).getStringCellValue()); chineseNameMap.put(String.valueOf(i),chineseTitlerow.getCell(i).getStringCellValue());
} }
for (int i = 2; i < physicalNumberOfRows; i++) { for (int i = 2; i < physicalNumberOfRows; i++) {
Row row = sheet.getRow(i); Row row = sheet.getRow(i);//获取行的数据
HuzhouProjectinfo huzhouProjectinfo = new HuzhouProjectinfo(); HuzhouProjectinfo huzhouProjectinfo = new HuzhouProjectinfo();
for (int j = 1; j < cellNum; j++) { for (int j = 1; j < cellNum; j++) {
String value = ""; String value = "";
//根据行,获取当前行,列的数据
if(row.getCell(j)!=null){ if(row.getCell(j)!=null){
row.getCell(j).setCellType(CellType.STRING); row.getCell(j).setCellType(CellType.STRING);//设置列的数据格式为字符串
value = row.getCell(j).getStringCellValue(); value = row.getCell(j).getStringCellValue();//获取列的数据
} }
//管理人员入库必输字段不做校验 //管理人员入库必输字段不做校验
// if(j<=19&&(value==null||value.length()==0)){ // if(j<=19&&(value==null||value.length()==0)){
@ -133,8 +135,9 @@ public class HuzhouProjectinfoServiceImpl extends ServiceImpl<HuzhouProjectinfoM
String name = NameMap.get(String.valueOf(j)); String name = NameMap.get(String.valueOf(j));
//所属任务 //所属任务
if("reformName".equals(name)){ if("reformName".equals(name)){
List<Select> reformTasks = sysDictService.selectByDictType("reformTasks"); List<Select> reformTasks = sysDictService.selectByDictType("reformTasks");//获取字典列表
String dictValue = null; String dictValue = null;
//根据值获取名称
for (Select dict:reformTasks) { for (Select dict:reformTasks) {
if(dict.getLabel().equals(value)){ if(dict.getLabel().equals(value)){
dictValue=dict.getValue(); dictValue=dict.getValue();
@ -192,25 +195,14 @@ public class HuzhouProjectinfoServiceImpl extends ServiceImpl<HuzhouProjectinfoM
value = user.getId(); value = user.getId();
} }
} }
//保存字段的数据到huzhouProjectinfo
HuzhouCommonUtils.setObjectAttributes(huzhouProjectinfo,name,value); HuzhouCommonUtils.setObjectAttributes(huzhouProjectinfo,name,value);
} }
huzhouProjectinfo.setStage("0");//待入库 huzhouProjectinfo.setStage("0");//设置阶段为待入库
huzhouProjectinfos.add(huzhouProjectinfo); huzhouProjectinfos.add(huzhouProjectinfo);
this.save(huzhouProjectinfo); this.save(huzhouProjectinfo);//添加到数据库
userprojectService.saveFromProject(huzhouProjectinfo,"0"); userprojectService.saveFromProject(huzhouProjectinfo,"0");//保存联系人
} }
// WorkFlow workFlow = workflowService.createFlow("creatProjectinfo",null);
// String processInstanceId = workFlow.getProcessInstanceId();
// String businessKey = workFlow.getBusinessKey();
// for (HuzhouProjectinfo p :huzhouProjectinfos) {
// HuzhouProcessinfo huzhouProcessinfo = new HuzhouProcessinfo();
// huzhouProcessinfo.setBusinesskey(businessKey);
// huzhouProcessinfo.setProcessName("creatProjectinfo");//该项目的第一个流程
// huzhouProcessinfo.setProcessinstanceid(processInstanceId);
// huzhouProcessinfo.setProjectid(p.getId());
// huzhouProcessinfo.setProcessstatus("1");
// processinfoService.save(huzhouProcessinfo);
// }
} }
@Override @Override
@Transactional @Transactional
@ -221,7 +213,6 @@ public class HuzhouProjectinfoServiceImpl extends ServiceImpl<HuzhouProjectinfoM
String projectid = projectApproveOV.getProjectid(); String projectid = projectApproveOV.getProjectid();
String flag = projectApproveOV.getFlag(); String flag = projectApproveOV.getFlag();
String isEdit = projectApproveOV.getIsEdit(); String isEdit = projectApproveOV.getIsEdit();
List<HuzhouProjectinfo> projectArr = projectApproveOV.getProjectArr();
//单个入库项目可以编辑,发起人编辑 //单个入库项目可以编辑,发起人编辑
if("1".equals(isEdit)&&"1".equals(flag)){ if("1".equals(isEdit)&&"1".equals(flag)){
if(null!=projectinfo){ if(null!=projectinfo){
@ -249,27 +240,32 @@ public class HuzhouProjectinfoServiceImpl extends ServiceImpl<HuzhouProjectinfoM
// return Result.ok("作废成功!"); // return Result.ok("作废成功!");
// //
// } // }
//流程结束了
String processInstanceId = workFlow.getProcessInstanceId(); String processInstanceId = workFlow.getProcessInstanceId();
ProcessInstance processInstance = runtimeService.createProcessInstanceQuery().processInstanceId(processInstanceId).singleResult(); ProcessInstance processInstance = runtimeService.createProcessInstanceQuery().processInstanceId(processInstanceId).singleResult();
if(processInstance==null&&"1".equals(flag)){ if(processInstance==null&&"1".equals(flag)){
if(projectArr!=null){ //流程结束了,变更状态
//说明是批量导入项目,查询所有批量导入项目信息
List<HuzhouProcessinfo> huzhouProcessinfoList = processinfoService.getListByInstid(processInstanceId);
for (HuzhouProcessinfo item:huzhouProcessinfoList) {
String id = item.getProjectid();
processinfoService.modifyStatusByProjectId(id,"2","creatProjectinfo");
this.modifyStageById(id,"2");
}
}else{
processinfoService.modifyStatusByProjectId(projectid,"2","creatProjectinfo"); processinfoService.modifyStatusByProjectId(projectid,"2","creatProjectinfo");
this.modifyStageById(projectid,"2"); this.modifyStageById(projectid,"2");
} }
} }
@Override
public void modifyProjectInfoContact(HuzhouProjectinfo huzhouProjectinfo) {
//查询之前的项目信息进行保存留痕
HuzhouProjectinfo historyData = getById(huzhouProjectinfo.getId());
HuzhouProjectinfoHistory huzhouProjectinfoHistory = new HuzhouProjectinfoHistory();
BeanUtils.copyProperties(historyData,huzhouProjectinfoHistory);
historyMapper.insert(huzhouProjectinfoHistory);
//更新项目的联系人
this.updateById(huzhouProjectinfo);
userprojectService.removeByProjectId(huzhouProjectinfo.getId(),"0");
userprojectService.saveFromProject(huzhouProjectinfo,"0");
} }
@Override @Override
public void modifyStageById(String id, String stage) { public void modifyStageById(String id, String stage) {
HuzhouProjectinfo byId = getById(id); HuzhouProjectinfo byId = getById(id);
//byId不为null 是主项目,为null是子项目
if(null!=byId){ if(null!=byId){
LambdaUpdateWrapper<HuzhouProjectinfo> updateWrapper = new LambdaUpdateWrapper<>(); LambdaUpdateWrapper<HuzhouProjectinfo> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(HuzhouProjectinfo::getId,id); updateWrapper.eq(HuzhouProjectinfo::getId,id);
@ -281,35 +277,13 @@ public class HuzhouProjectinfoServiceImpl extends ServiceImpl<HuzhouProjectinfoM
updateWrapper.set(HuzhouSubProjectinfo::getStage,stage); updateWrapper.set(HuzhouSubProjectinfo::getStage,stage);
subProjectinfoMapper.update(null,updateWrapper); subProjectinfoMapper.update(null,updateWrapper);
} }
} }
@Override
public void modifyismodifyById(String id, String ismodify) {
LambdaUpdateWrapper<HuzhouProjectinfo> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(HuzhouProjectinfo::getId,id);
// updateWrapper.set(HuzhouProjectinfo::getIsmodify,ismodify);
this.update(updateWrapper);
}
@Override @Override
public IPage<HuzhouProjectinfo> getProjectInfoPageList(HuzhouProjectinfo projectinfo, Integer pageNo, Integer pageSize) { public IPage<HuzhouProjectinfo> getProjectInfoPageList(HuzhouProjectinfo projectinfo, Integer pageNo, Integer pageSize) {
Page page = new Page(pageNo, pageSize); Page page = new Page(pageNo, pageSize);
SysUser currentUser = ShiroUtil.getCurrentUser();
List<SysRole> roleList = currentUser.getRoleList();
Map<String, String> stringStringMap = new HashMap<>();
String roles = "";
for (SysRole role:roleList
) {
roles = role.getCode()+","+roles;
}
if(roles.contains("manageOrg")||roles.contains("sys:admin")){
}else if(roles.contains("supervisor")){
projectinfo.setSupervisorContactor(currentUser.getId());
}else {
projectinfo.setProjectContacts(currentUser.getId());
}
Page<HuzhouProjectinfo> projectInfoPageList = projectinfoMapper.getProjectInfoPageList(page, projectinfo); Page<HuzhouProjectinfo> projectInfoPageList = projectinfoMapper.getProjectInfoPageList(page, projectinfo);
return projectInfoPageList; return projectInfoPageList;
} }
@ -317,103 +291,52 @@ public class HuzhouProjectinfoServiceImpl extends ServiceImpl<HuzhouProjectinfoM
@Override @Override
public IPage<HuzhouProjectinfoOV> getProjectInfoAndChildPageList(HuzhouProjectinfo projectinfo, Integer pageNo, Integer pageSize) { public IPage<HuzhouProjectinfoOV> getProjectInfoAndChildPageList(HuzhouProjectinfo projectinfo, Integer pageNo, Integer pageSize) {
Page page = new Page(pageNo, pageSize); Page page = new Page(pageNo, pageSize);
SysUser currentUser = ShiroUtil.getCurrentUser(); projectinfo = CommonUtils.setGetProjectInfoAuth(projectinfo);
List<SysRole> roleList = currentUser.getRoleList(); Page<HuzhouProjectinfoOV> projectAndChildInfoPageList = projectinfoMapper.getProjectAndChildInfoPageList(page,projectinfo);
Map<String, String> stringStringMap = new HashMap<>(); List<HuzhouProjectinfoOV> records = projectAndChildInfoPageList.getRecords();
String roles = ""; records.forEach(item->{
for (SysRole role:roleList item.setMissingSubprojects(false);//设置默认是false
) { double subTotalMoney =0;//子项目的总金额
roles = role.getCode()+","+roles; List<HuzhouSubProjectinfo> subProjectinfoList = item.getChildren();
} if (subProjectinfoList.size()>0){
if(roles.contains("manageOrg")||roles.contains("sys:admin")){ subTotalMoney= subProjectinfoList.stream().mapToDouble(HuzhouProjectinfo::getTotalMoney).sum();//计算子项目总金额总和
Double totalMoney = item.getTotalMoney();
}else if(roles.contains("supervisor")){ if(subTotalMoney!=0&&totalMoney!=subTotalMoney){
projectinfo.setSupervisorContactor(currentUser.getId()); item.setMissingSubprojects(true);//子项目金额总和和主项目不一致
}else { }
projectinfo.setProjectContacts(currentUser.getId()); }else{
//没有子项目
item.setChildren(null);
} }
Page<HuzhouProjectinfo> projectInfoPageList = projectinfoMapper.getProjectInfoPageList(page, projectinfo);
List<HuzhouProjectinfoOV> convertedList = new ArrayList<>();
for (HuzhouProjectinfo info : projectInfoPageList.getRecords()) {
double subTotalMoney =0;
HuzhouProjectinfoOV projectinfoOV=new HuzhouProjectinfoOV();
BeanUtils.copyProperties(info,projectinfoOV);
String projectinfoId = projectinfoOV.getId();
projectinfoOV.setMissingSubprojects(false);
LambdaQueryWrapper<HuzhouSubProjectinfo> subProjectinfoqueryWrapper = new LambdaQueryWrapper<>();
subProjectinfoqueryWrapper.eq(HuzhouSubProjectinfo::getProjectId,projectinfoId);
List<HuzhouSubProjectinfo> huzhouSubProjectinfos = subProjectinfoMapper.selectList(subProjectinfoqueryWrapper);
//是否有子项目
if(huzhouSubProjectinfos.size()>0){
List<HuzhouProjectinfo> objectList = new ArrayList<>();
huzhouSubProjectinfos.forEach(item->{
HuzhouProjectinfo huzhouProjectinfo = new HuzhouProjectinfo();
BeanUtils.copyProperties(item,huzhouProjectinfo);
huzhouProjectinfo = updateProjectinfoField(huzhouProjectinfo);
objectList.add(huzhouProjectinfo);
}); });
subTotalMoney= objectList.stream().mapToDouble(HuzhouProjectinfo::getTotalMoney).sum(); return projectAndChildInfoPageList;
projectinfoOV.setChildren(huzhouSubProjectinfos);
// huzhouSubProjectinfos.forEach(item->{
// item.setPlanProcessStatus(getPlanProcessStatus(item.getId()));
// });
}
HuzhouProjectinfo updateProjectinfoField = updateProjectinfoField(info);
Double totalMoney = updateProjectinfoField.getTotalMoney();
if(subTotalMoney!=0&&totalMoney!=subTotalMoney){
projectinfoOV.setMissingSubprojects(true);
}
// String planProcessStatus = getPlanProcessStatus(projectinfoOV.getId());
// projectinfoOV.setPlanProcessStatus(planProcessStatus);
convertedList.add(projectinfoOV);
}
Page<HuzhouProjectinfoOV> newPage = new Page<>();
newPage.setRecords(convertedList);
newPage.setTotal(projectInfoPageList.getTotal());
newPage.setCurrent(projectInfoPageList.getCurrent());
newPage.setSize(projectInfoPageList.getSize());
return newPage;
} }
@Override @Override
public List<HuzhouProjectinfo> getProjectInfoList(HuzhouProjectinfo projectinfo) { public void batchdownloadProject(HttpServletResponse response, HuzhouProjectinfo projectinfo) {
LambdaQueryWrapper<HuzhouProjectinfo> huzhouProjectinfoLambdaQueryWrapper = new LambdaQueryWrapper<>(); //查询主项目的信息
String projectName = projectinfo.getProjectName(); List<HuzhouProjectinfo> projectinfoList = projectinfoMapper.getProjectInfoPageList(projectinfo);
String projectId =projectinfo.getId();
String stage = projectinfo.getStage();
huzhouProjectinfoLambdaQueryWrapper.like(StringUtils.isNotBlank(projectName),HuzhouProjectinfo::getProjectName,projectName);
huzhouProjectinfoLambdaQueryWrapper.like(StringUtils.isNotBlank(projectId),HuzhouProjectinfo::getId,projectId);
huzhouProjectinfoLambdaQueryWrapper.ge(StringUtils.isNotBlank(stage),HuzhouProjectinfo::getStage,stage);
List<HuzhouProjectinfo> projectinfoList = this.list(huzhouProjectinfoLambdaQueryWrapper);
for(int i =0;i<projectinfoList.size();i++){ for(int i =0;i<projectinfoList.size();i++){
HuzhouProjectinfo huzhouProjectinfo = projectinfoList.get(i); HuzhouProjectinfo huzhouProjectinfo = projectinfoList.get(i);
//查询是否有子项目
LambdaQueryWrapper<HuzhouSubProjectinfo> queryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<HuzhouSubProjectinfo> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(HuzhouSubProjectinfo::getProjectId,huzhouProjectinfo.getId()); queryWrapper.eq(HuzhouSubProjectinfo::getProjectId,huzhouProjectinfo.getId());
List<HuzhouSubProjectinfo> huzhouSubProjectinfos = subProjectinfoMapper.selectList(queryWrapper); List<HuzhouSubProjectinfo> huzhouSubProjectinfos = subProjectinfoMapper.selectList(queryWrapper);
if(huzhouSubProjectinfos.size()>0){ if(huzhouSubProjectinfos.size()>0){
//有子项目就添加到当前列表中
List<HuzhouProjectinfo> collect = huzhouSubProjectinfos.stream().map(sub -> { List<HuzhouProjectinfo> collect = huzhouSubProjectinfos.stream().map(sub -> {
HuzhouProjectinfo projectInfo = new HuzhouProjectinfo(); HuzhouProjectinfo projectInfo = new HuzhouProjectinfo();
BeanUtils.copyProperties(sub, projectInfo); BeanUtils.copyProperties(sub, projectInfo);
return projectInfo; return projectInfo;
}).collect(Collectors.toList()); }).collect(Collectors.toList());
projectinfoList.addAll(i+1,collect); projectinfoList.addAll(i+1,collect);
//索引增加
i+=collect.size(); i+=collect.size();
} }
}
return projectinfoList;
} }
@Override
public void batchdownloadProject(HttpServletResponse response, HuzhouProjectinfo projectinfo) {
List<HuzhouProjectinfo> projectInfoList = getProjectInfoList(projectinfo);
try { try {
projectInfoList.forEach(item->{ //因为查询结果中有些字段是字典值,要转化成字典的中文
item = updateProjectinfoField(item); projectinfoList.forEach(item->{
List<Select> reformTasks = sysDictService.selectByDictType("reformTasks"); List<Select> reformTasks = sysDictService.selectByDictType("reformTasks");
String dictValue = null; String dictValue = null;
for (Select dict:reformTasks) { for (Select dict:reformTasks) {
@ -445,7 +368,6 @@ public class HuzhouProjectinfoServiceImpl extends ServiceImpl<HuzhouProjectinfoM
Method method1 = clazz.getMethod(setName, String.class); Method method1 = clazz.getMethod(setName, String.class);
method1.invoke(item,realname); method1.invoke(item,realname);
} }
} }
} }
} catch (Exception e) { } catch (Exception e) {
@ -453,8 +375,7 @@ public class HuzhouProjectinfoServiceImpl extends ServiceImpl<HuzhouProjectinfoM
} }
} }
}); });
TemplateExcelUtils.downLoadExcel("项目入库导出模板", "项目入库导出模板.xlsx", projectInfoList, response); TemplateExcelUtils.downLoadExcel("项目入库导出模板", "项目入库导出模板.xlsx", projectinfoList, response);
} catch (Exception e) { } catch (Exception e) {
throw new RuntimeException(e); throw new RuntimeException(e);
} }
@ -464,91 +385,38 @@ public class HuzhouProjectinfoServiceImpl extends ServiceImpl<HuzhouProjectinfoM
@Override @Override
public Object queryProjectInfoById(String id) { public Object queryProjectInfoById(String id) {
HuzhouProjectinfo projectinfo = getById(id); HuzhouProjectinfo projectinfo = getById(id);
//说明是子项目 //projectinfo为空说明是子项目
if(null==projectinfo){ if(null==projectinfo){
HuzhouSubProjectinfo huzhouSubProjectinfo = subProjectinfoMapper.selectById(id); HuzhouSubProjectinfo huzhouSubProjectinfo = subProjectinfoMapper.selectById(id);
return huzhouSubProjectinfo; return huzhouSubProjectinfo;
} }
return projectinfo; return projectinfo;
} }
@Override
public Object queryProjectInfoNewDataById(String id) {
HuzhouProjectinfo projectinfo = getById(id);
//说明是子项目
if(null==projectinfo){
HuzhouSubProjectinfo huzhouSubProjectinfo = subProjectinfoMapper.selectById(id);
HuzhouProjectinfo huzhouProjectinfo = new HuzhouProjectinfo();
BeanUtils.copyProperties(huzhouSubProjectinfo,huzhouProjectinfo);
huzhouProjectinfo = updateProjectinfoField(huzhouProjectinfo);
return huzhouProjectinfo;
}else{
projectinfo = updateProjectinfoField(projectinfo);
}
return projectinfo;
}
/** /** 暂时无用
* 查询当前项目是否已经发起流程计划 * 查询当前项目是否已经发起流程计划
* @param id * @param
* @return 2 计划的审批流程已完成 1 是流程中 0 是未发起流程 * @return 2 计划的审批流程已完成 1 是流程中 0 是未发起流程
*/ */
private String getPlanProcessStatus(String id){ // private String getPlanProcessStatus(String id){
LambdaQueryWrapper<HuzhouProcessinfo> queryWrapper = new LambdaQueryWrapper<>(); // LambdaQueryWrapper<HuzhouProcessinfo> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(HuzhouProcessinfo::getProcessName,"createPlaninfo"); // queryWrapper.eq(HuzhouProcessinfo::getProcessName,"createPlaninfo");
queryWrapper.eq(HuzhouProcessinfo::getProcessstatus,"1"); // queryWrapper.eq(HuzhouProcessinfo::getProcessstatus,"1");
List<HuzhouProcessinfo> huzhouProcessinfos = processinfoMapper.selectList(queryWrapper); // List<HuzhouProcessinfo> huzhouProcessinfos = processinfoMapper.selectList(queryWrapper);
if(huzhouProcessinfos.size()>0){ // if(huzhouProcessinfos.size()>0){
return "1"; // return "1";
} // }
queryWrapper.clear(); // queryWrapper.clear();
queryWrapper.eq(HuzhouProcessinfo::getProjectid,id); // queryWrapper.eq(HuzhouProcessinfo::getProjectid,id);
queryWrapper.eq(HuzhouProcessinfo::getProcessName,"createPlaninfo"); // queryWrapper.eq(HuzhouProcessinfo::getProcessName,"createPlaninfo");
queryWrapper.eq(HuzhouProcessinfo::getProcessstatus,"2"); // queryWrapper.eq(HuzhouProcessinfo::getProcessstatus,"2");
huzhouProcessinfos = processinfoMapper.selectList(queryWrapper); // huzhouProcessinfos = processinfoMapper.selectList(queryWrapper);
if(huzhouProcessinfos.size()>0){ // if(huzhouProcessinfos.size()>0){
return "2"; // return "2";
} // }
return "0"; // return "0";
} // }
public HuzhouProjectinfo updateProjectinfoField(HuzhouProjectinfo huzhouProjectinfo){
String id = huzhouProjectinfo.getId();
List<HuzhouFieldchangehistory> fieldchangeList= fieldchangehistoryService.getFieldchangeListByprojectid(id);
if(fieldchangeList.size()>0){
Collections.reverse(fieldchangeList);
for (HuzhouFieldchangehistory field:fieldchangeList
) {
String fieldValue = field.getFieldValue();
try {
HuzhouCommonUtils.setObjectAttributes(huzhouProjectinfo,fieldValue,field.getNewvalue());
} catch (Exception e) {
throw new RuntimeException("更新字段数据出错了");
}
}
}
return huzhouProjectinfo;
}
public HuzhouSubProjectinfo updateProjectinfoField(HuzhouSubProjectinfo huzhouSubProjectinfo){
String id = huzhouSubProjectinfo.getId();
HuzhouProjectinfo huzhouProjectinfo = new HuzhouProjectinfo();
BeanUtils.copyProperties(huzhouSubProjectinfo,huzhouProjectinfo);
List<HuzhouFieldchangehistory> fieldchangeList= fieldchangehistoryService.getFieldchangeListByprojectid(id);
if(fieldchangeList.size()>0){
Collections.reverse(fieldchangeList);
for (HuzhouFieldchangehistory field:fieldchangeList
) {
String fieldValue = field.getFieldValue();
try {
HuzhouCommonUtils.setObjectAttributes(huzhouProjectinfo,fieldValue,field.getNewvalue());
} catch (Exception e) {
throw new RuntimeException("更新字段数据出错了");
}
}
BeanUtils.copyProperties(huzhouProjectinfo,huzhouSubProjectinfo);
}
return huzhouSubProjectinfo;
}
} }

16
huzhou/src/main/java/com/easy/admin/modules/huzhou/service/impl/HuzhouSubProjectinfoServiceImpl.java

@ -48,20 +48,15 @@ public class HuzhouSubProjectinfoServiceImpl extends ServiceImpl<HuzhouSubProjec
public HuzhouSubProjectinfo getRemainingMoneyinfo(HuzhouSubProjectinfo subprojectinfo) { public HuzhouSubProjectinfo getRemainingMoneyinfo(HuzhouSubProjectinfo subprojectinfo) {
String projectId = subprojectinfo.getProjectId(); String projectId = subprojectinfo.getProjectId();
HuzhouProjectinfo byId = projectinfoService.getById(projectId); HuzhouProjectinfo byId = projectinfoService.getById(projectId);
byId= projectinfoService.updateProjectinfoField(byId);
LambdaQueryWrapper<HuzhouSubProjectinfo> queryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<HuzhouSubProjectinfo> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(HuzhouSubProjectinfo::getProjectId,projectId); queryWrapper.eq(HuzhouSubProjectinfo::getProjectId,projectId);
List<HuzhouSubProjectinfo> list = list(queryWrapper); List<HuzhouSubProjectinfo> list = list(queryWrapper);
if(list!=null&&list.size()>0){ if(list!=null&&list.size()>0){
//更新主项目的数据为最新鲜值
list.forEach(item->{
item= projectinfoService.updateProjectinfoField(item);
});
//说明是子项目修改 //说明是子项目修改
if(subprojectinfo.getId()!=null){ if(subprojectinfo.getId()!=null){
HuzhouSubProjectinfo subProjectinfo = getById(subprojectinfo.getId()); HuzhouSubProjectinfo subProjectinfo = getById(subprojectinfo.getId());
subProjectinfo= projectinfoService.updateProjectinfoField(subProjectinfo);
subprojectinfo.setCentralMoney(byId.getCentralMoney()+subProjectinfo.getCentralMoney()-list.stream().mapToDouble(HuzhouProjectinfo::getCentralMoney).sum()); subprojectinfo.setCentralMoney(byId.getCentralMoney()+subProjectinfo.getCentralMoney()-list.stream().mapToDouble(HuzhouProjectinfo::getCentralMoney).sum());
subprojectinfo.setCityMoney(byId.getCityMoney()+subProjectinfo.getCityMoney()-list.stream().mapToDouble(HuzhouProjectinfo::getCityMoney).sum()); subprojectinfo.setCityMoney(byId.getCityMoney()+subProjectinfo.getCityMoney()-list.stream().mapToDouble(HuzhouProjectinfo::getCityMoney).sum());
subprojectinfo.setSelfMoney(byId.getSelfMoney()+subProjectinfo.getSelfMoney()-list.stream().mapToDouble(HuzhouProjectinfo::getSelfMoney).sum()); subprojectinfo.setSelfMoney(byId.getSelfMoney()+subProjectinfo.getSelfMoney()-list.stream().mapToDouble(HuzhouProjectinfo::getSelfMoney).sum());
@ -82,15 +77,6 @@ public class HuzhouSubProjectinfoServiceImpl extends ServiceImpl<HuzhouSubProjec
subprojectinfo.setPayamount2024Money(byId.getPayamount2024Money()-list.stream().mapToDouble(HuzhouProjectinfo::getPayamount2024Money).sum()); subprojectinfo.setPayamount2024Money(byId.getPayamount2024Money()-list.stream().mapToDouble(HuzhouProjectinfo::getPayamount2024Money).sum());
subprojectinfo.setPayamount2025Money(byId.getPayamount2025Money()-list.stream().mapToDouble(HuzhouProjectinfo::getPayamount2025Money).sum()); subprojectinfo.setPayamount2025Money(byId.getPayamount2025Money()-list.stream().mapToDouble(HuzhouProjectinfo::getPayamount2025Money).sum());
} }
// subprojectinfo.setCentralMoney(byId.getCentralMoney()-list.stream().mapToDouble(HuzhouProjectinfo::getCentralMoney).sum());
// subprojectinfo.setCityMoney(byId.getCityMoney()-list.stream().mapToDouble(HuzhouProjectinfo::getCityMoney).sum());
// subprojectinfo.setSelfMoney(byId.getSelfMoney()-list.stream().mapToDouble(HuzhouProjectinfo::getSelfMoney).sum());
// subprojectinfo.setProvincialMoney(byId.getProvincialMoney()-list.stream().mapToDouble(HuzhouProjectinfo::getProvincialMoney).sum());
// subprojectinfo.setCountyMoney(byId.getCountyMoney()-list.stream().mapToDouble(HuzhouProjectinfo::getCountyMoney).sum());
// subprojectinfo.setTotalMoney(byId.getTotalMoney()-list.stream().mapToDouble(HuzhouProjectinfo::getTotalMoney).sum());
// subprojectinfo.setPayamount2023Money(byId.getPayamount2023Money()-list.stream().mapToDouble(HuzhouProjectinfo::getPayamount2023Money).sum());
// subprojectinfo.setPayamount2024Money(byId.getPayamount2024Money()-list.stream().mapToDouble(HuzhouProjectinfo::getPayamount2024Money).sum());
// subprojectinfo.setPayamount2025Money(byId.getPayamount2025Money()-list.stream().mapToDouble(HuzhouProjectinfo::getPayamount2025Money).sum());
}else { }else {
HuzhouSubProjectinfo huzhouSubProjectinfo = new HuzhouSubProjectinfo(); HuzhouSubProjectinfo huzhouSubProjectinfo = new HuzhouSubProjectinfo();
BeanUtils.copyProperties(byId,huzhouSubProjectinfo); BeanUtils.copyProperties(byId,huzhouSubProjectinfo);

39
huzhou/src/main/java/com/easy/admin/modules/huzhou/service/impl/HuzhouWorkreportServiceImpl.java

@ -1,12 +1,15 @@
package com.easy.admin.modules.huzhou.service.impl; package com.easy.admin.modules.huzhou.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.easy.admin.auth.model.SysRole; import com.easy.admin.auth.model.SysRole;
import com.easy.admin.auth.model.SysUser; import com.easy.admin.auth.model.SysUser;
import com.easy.admin.common.util.CommonUtils; import com.easy.admin.common.util.CommonUtils;
import com.easy.admin.modules.huzhou.dao.HuzhouWorkreportMapper; import com.easy.admin.modules.huzhou.dao.HuzhouWorkreportMapper;
import com.easy.admin.modules.huzhou.entity.HuzhouProjectinfo;
import com.easy.admin.modules.huzhou.entity.HuzhouWorkreport; import com.easy.admin.modules.huzhou.entity.HuzhouWorkreport;
import com.easy.admin.modules.huzhou.service.IHuzhouProjectinfoService;
import com.easy.admin.modules.huzhou.service.IHuzhouWorkreportService; import com.easy.admin.modules.huzhou.service.IHuzhouWorkreportService;
import com.easy.admin.modules.huzhou.vo.HuzhouWorkreportOV; import com.easy.admin.modules.huzhou.vo.HuzhouWorkreportOV;
import com.easy.admin.util.ShiroUtil; import com.easy.admin.util.ShiroUtil;
@ -28,29 +31,19 @@ import java.util.Map;
public class HuzhouWorkreportServiceImpl extends ServiceImpl<HuzhouWorkreportMapper,HuzhouWorkreport> implements IHuzhouWorkreportService { public class HuzhouWorkreportServiceImpl extends ServiceImpl<HuzhouWorkreportMapper,HuzhouWorkreport> implements IHuzhouWorkreportService {
@Autowired @Autowired
private HuzhouWorkreportMapper workreportMapper; private HuzhouWorkreportMapper workreportMapper;
@Autowired
private IHuzhouProjectinfoService huzhouProjectinfoService;
@Value(value = "${jeecg.path.upload}") @Value(value = "${jeecg.path.upload}")
private String uploadpath; private String uploadpath;
@Override @Override
public Page<HuzhouWorkreportOV> getWorkreportPageList(HuzhouWorkreportOV workreport, Integer pageNo, Integer pageSize) { public Page<HuzhouProjectinfo> getWorkreportPageList(HuzhouProjectinfo huzhouProjectinfo, Integer pageNo, Integer pageSize) {
Page<HuzhouWorkreportOV> page = new Page<>(pageNo, pageSize); Page<HuzhouWorkreportOV> page = new Page<>(pageNo, pageSize);
SysUser currentUser = ShiroUtil.getCurrentUser(); huzhouProjectinfo=CommonUtils.setGetProjectInfoAuth(huzhouProjectinfo);
List<SysRole> roleList = currentUser.getRoleList(); Page<HuzhouProjectinfo> pageList = workreportMapper.getWorkreportPageList(page, huzhouProjectinfo);
String roles = "";
for (SysRole role:roleList
) {
roles = role.getCode()+","+roles;
}
if(roles.contains("manageOrg")||roles.contains("sys:admin")){
}else if(roles.contains("supervisor")){
workreport.setSupervisorContactor(currentUser.getId());
}else {
workreport.setProjectContacts(currentUser.getId());
}
Page<HuzhouWorkreportOV> pageList = workreportMapper.getWorkreportPageList(page, workreport);
return pageList; return pageList;
} }
@Override @Override
public void addWorkreport(MultipartFile file, HuzhouWorkreport workreport) throws IOException { public void addWorkreport(MultipartFile file, HuzhouWorkreport workreport) throws IOException {
addContractFile(file,workreport); addContractFile(file,workreport);
@ -85,6 +78,20 @@ public class HuzhouWorkreportServiceImpl extends ServiceImpl<HuzhouWorkreportMap
} }
return false; return false;
} }
@Override
public void setProjectWorkReport(HuzhouProjectinfo huzhouProjectinfo) {
huzhouProjectinfoService.updateById(huzhouProjectinfo);
}
@Override
public IPage<HuzhouProjectinfo> getNoTypeWorkReportPageList(HuzhouProjectinfo projectinfo, Integer pageNo, Integer pageSize) {
Page<HuzhouProjectinfo> page = new Page<>(pageNo, pageSize);
projectinfo=CommonUtils.setGetProjectInfoAuth(projectinfo);
IPage<HuzhouProjectinfo> res =workreportMapper.getNoTypeWorkReportPageList(page,projectinfo);
return res;
}
private void addContractFile(MultipartFile file, HuzhouWorkreport workreport) throws IOException { private void addContractFile(MultipartFile file, HuzhouWorkreport workreport) throws IOException {
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd"); SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
String currentDay = dateFormat.format(new Date()); String currentDay = dateFormat.format(new Date());

15
huzhou/src/main/java/com/easy/admin/modules/huzhou/vo/HuzhouProjectinfoOV.java

@ -1,15 +1,28 @@
package com.easy.admin.modules.huzhou.vo; package com.easy.admin.modules.huzhou.vo;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler;
import com.easy.admin.modules.huzhou.entity.HuzhouProjectinfo; import com.easy.admin.modules.huzhou.entity.HuzhouProjectinfo;
import com.easy.admin.modules.huzhou.entity.HuzhouSubProjectinfo; import com.easy.admin.modules.huzhou.entity.HuzhouSubProjectinfo;
import com.easy.admin.modules.huzhou.handler.HuzhouSubProjectHandler;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Data; import lombok.Data;
import java.util.List; import java.util.List;
@Data @Data
@JsonIgnoreProperties(value = { "hibernateLazyInitializer", "handler" })//防止传到前端会报错
public class HuzhouProjectinfoOV extends HuzhouProjectinfo { public class HuzhouProjectinfoOV extends HuzhouProjectinfo {
List<HuzhouSubProjectinfo> children; List<HuzhouSubProjectinfo> children;
String planProcessStatus;
// String planProcessStatus;
/**
* 是否缺失子项目标志 true 缺失
*/
Boolean missingSubprojects; Boolean missingSubprojects;
// String isSubProject; // String isSubProject;
} }

2
huzhou/src/main/java/com/easy/admin/modules/huzhou/vo/ProjectApproveOV.java

@ -15,6 +15,4 @@ public class ProjectApproveOV {
private String stage; private String stage;
private String isEdit; private String isEdit;
private HuzhouProjectinfo projectInfo; private HuzhouProjectinfo projectInfo;
private List<HuzhouProjectinfo> projectArr;
} }

Loading…
Cancel
Save