diff --git a/huzhou/src/main/java/com/easy/admin/common/util/CommonUtils.java b/huzhou/src/main/java/com/easy/admin/common/util/CommonUtils.java index 2ade56b..b71971c 100644 --- a/huzhou/src/main/java/com/easy/admin/common/util/CommonUtils.java +++ b/huzhou/src/main/java/com/easy/admin/common/util/CommonUtils.java @@ -1,8 +1,13 @@ 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 java.util.List; import java.util.regex.Matcher; 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 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; + } } \ No newline at end of file diff --git a/huzhou/src/main/java/com/easy/admin/modules/huzhou/controller/HuzhouProjectController.java b/huzhou/src/main/java/com/easy/admin/modules/huzhou/controller/HuzhouProjectController.java index ddd3839..2535af6 100644 --- a/huzhou/src/main/java/com/easy/admin/modules/huzhou/controller/HuzhouProjectController.java +++ b/huzhou/src/main/java/com/easy/admin/modules/huzhou/controller/HuzhouProjectController.java @@ -1,118 +1,86 @@ 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.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.common.core.annotation.ResponseResult; 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.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.service.*; import com.easy.admin.modules.huzhou.vo.ProjectApproveOV; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; import org.springframework.transaction.annotation.Transactional; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; -import javax.servlet.ServletOutputStream; + 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 @RequestMapping("/huzhouProject") public class HuzhouProjectController { - @Autowired - private SysUserService sysUserService; - - @Autowired - private IWorkflowService workflowService; - @Autowired - private IHuzhouProcessinfoService processinfoService; - @Autowired - private RuntimeService runtimeService; @Autowired private IHuzhouProjectinfoService projectinfoService; @Autowired private IHuzhouUserprojectService userprojectService; - @Autowired - private SysDictService sysDictService; + /** - * 本地:local minio:minio 阿里:alioss + * 新增项目入库 + * @param info 项目信息 + * @return 返回值 */ - @Value(value="${jeecg.uploadType}") - private String uploadType; @PostMapping("/submitProject") public Result submitProject(@RequestBody HuzhouProjectinfo info){ projectinfoService.submitProject(info); return Result.ok("项目入库申请已发起成功"); } + /** + * 批量导入项目 + * @param multipartFile 表格文件 + * @return 返回值 + * @throws Exception 抛异常 + */ @PostMapping("/batchImportProjects") public Result batchImportProjects(@RequestParam(value = "file",required = false) MultipartFile multipartFile) throws Exception { projectinfoService.batchImportProjects(multipartFile); - //创建流程 return Result.OK("批量导入成功"); } + + /** + * 项目审批 + * @param projectApproveOV 审批数据 + * @return 返回值 + */ @PostMapping("/approveProjectInfo") public Result approveProjectInfo(@RequestBody ProjectApproveOV projectApproveOV){ projectinfoService.approveProjectInfo(projectApproveOV); return Result.ok("审批成功"); } - @PostMapping("/deleteProcesss") - public Result deleteProcesss(String processInstanceId){ -// runtimeService.deleteProcessInstance(processInstanceId,"发起人删除"); - return Result.OK("流程删除成功"); - } - //弃用 + /** + * 目前用于修改项目联系人 + * @param huzhouProjectinfo 项目的全部信息 + * @return + */ @PostMapping("/modifyProjectInfo") @Transactional public Result modifyProjectInfo(@RequestBody HuzhouProjectinfo huzhouProjectinfo){ - projectinfoService.updateById(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"); + projectinfoService.modifyProjectInfoContact(huzhouProjectinfo);//修改项目联系人 + return Result.ok("修改成功"); } - /** * 获取项目信息列表 - * @param projectinfo - * @param pageNo - * @param pageSize - * @return + * @param projectinfo 查询条件 + * @param pageNo 页码 + * @param pageSize 页数 + * @return 结果 */ @GetMapping("/getProjectInfoPageList") public Result getProjectInfoPageList(HuzhouProjectinfo projectinfo, @@ -122,32 +90,43 @@ public class HuzhouProjectController { IPage pageList = projectinfoService.getProjectInfoPageList(projectinfo, pageNo, pageSize); return Result.OK(pageList); } + /** + * 获取项目信息列表并且携带子项目的信息 + * @param projectinfo 项目查询条件 + * @param pageNo 页码 + * @param pageSize 每页多少条 + * @return 返回值 + */ + @ResponseResult @GetMapping("/getProjectInfoAndChildPageList") - - public Result> queryPageList(HuzhouProjectinfo projectinfo, + public IPage queryPageList(HuzhouProjectinfo projectinfo, @RequestParam(name="current", defaultValue="1") Integer pageNo, @RequestParam(name="pageSize", defaultValue="10") Integer pageSize){ projectinfo.setStage(projectinfo.getStage()); IPage pageList = projectinfoService.getProjectInfoAndChildPageList(projectinfo, pageNo, pageSize); - return Result.OK(pageList); + return pageList; } + + /** + * 根据项目id获取项目信息 + * @param projectid 项目id + * @return 返回值 + */ @GetMapping("/queryProjectInfoById") public Result queryProjectInfoById(String projectid){ //获取项目入库数据 Object projectInfo = projectinfoService.queryProjectInfoById(projectid); 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") public Result> queryProjectApprovedPage(HuzhouProjectinfo projectinfo, @RequestParam(name="current", defaultValue="1") Integer pageNo, @@ -157,29 +136,14 @@ public class HuzhouProjectController { return Result.OK(infoPageList); } - @GetMapping("/getIsbatchImportProjects") - public Result getIsbatchImportProjects(String processInstanceId){ - List processinfoList = processinfoService.getListByInstid(processInstanceId); - if(processinfoList.size()>1){ - return Result.OK(true); - } - 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 processinfoList = processinfoService.getListByInstid(processInstanceId); - List projectidList = processinfoList.stream() - .map(HuzhouProcessinfo::getProjectid) - .collect(Collectors.toList()); - LambdaQueryWrapper projectinfoQueryWrapper = new LambdaQueryWrapper<>(); - projectinfoQueryWrapper.in(HuzhouProjectinfo::getId,projectidList); - Page huzhouProjectinfoPage = new Page<>(pageNo,pageSize); - Page projectinfoPage = projectinfoService.page(huzhouProjectinfoPage, projectinfoQueryWrapper); - return Result.ok(projectinfoPage); - } - //归档 + /** + * 归档信息列表 + * @param projectinfo 查询条件 + * @param pageNo 页码 + * @param pageSize 每页条数 + * @return 返回值 + */ + @GetMapping("/projectArchivePageList") public Result projectArchivePageList(HuzhouProjectinfo projectinfo, @RequestParam(name="current", defaultValue="1") Integer pageNo, @@ -188,35 +152,12 @@ public class HuzhouProjectController { IPage pageList = projectinfoService.getProjectInfoAndChildPageList(projectinfo, pageNo, pageSize); return Result.OK(pageList); } -// @PostMapping("/submitProjectArchive") -// public Result submitProjectArchive(@RequestBody HashMap param){ -// String projectid = param.get("projectid"); -// WorkFlow workFlow = workflowService.createFlow("createProjectArchive",projectid); -// HuzhouProjectinfo huzhouProjectinfo = new HuzhouProjectinfo(); -// 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("审批成功"); -// } + + /** + * 批量导出项目信息 + * @param response response + * @param projectinfo 导出条件 + */ @GetMapping("/batchdownloadProject") public void batchdownloadProject(HttpServletResponse response,HuzhouProjectinfo projectinfo){ projectinfoService.batchdownloadProject(response,projectinfo); diff --git a/huzhou/src/main/java/com/easy/admin/modules/huzhou/controller/HuzhouWorkreportController.java b/huzhou/src/main/java/com/easy/admin/modules/huzhou/controller/HuzhouWorkreportController.java index 4bd6b25..fdf5e06 100644 --- a/huzhou/src/main/java/com/easy/admin/modules/huzhou/controller/HuzhouWorkreportController.java +++ b/huzhou/src/main/java/com/easy/admin/modules/huzhou/controller/HuzhouWorkreportController.java @@ -1,8 +1,10 @@ package com.easy.admin.modules.huzhou.controller; +import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.easy.admin.common.api.vo.Result; 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.service.IHuzhouWorkreportService; 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 java.io.IOException; +import java.util.List; @RestController @@ -18,10 +21,36 @@ import java.io.IOException; public class HuzhouWorkreportController { @Autowired private IHuzhouWorkreportService workreportService; + @PostMapping("setProjectWorkReport") + public void setProjectWorkReport(@RequestBody HuzhouProjectinfo huzhouProjectinfo){ + workreportService.setProjectWorkReport(huzhouProjectinfo); + } + + /** + * 获取未创建周月报类型的项目 + * @param projectinfo 查询条件 + * @param pageNo + * @param pageSize + * @return IPage + */ + @GetMapping("getNoTypeWorkReportPageList") + public Result getNoTypeWorkReportPageList(HuzhouProjectinfo projectinfo,@RequestParam(name="current", defaultValue="1") Integer pageNo, + @RequestParam(name="pageSize", defaultValue="10") Integer pageSize){ + IPage res=workreportService.getNoTypeWorkReportPageList(projectinfo,pageNo,pageSize); + return Result.ok(res); + } + + /** + * 获取已创建的周月报项目 + * @param workreportOV + * @param pageNo + * @param pageSize + * @return + */ @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){ - Page pageList = workreportService.getWorkreportPageList(workreportOV, pageNo, pageSize); + Page pageList = workreportService.getWorkreportPageList(huzhouProjectinfo, pageNo, pageSize); return Result.ok(pageList); } @GetMapping("/getWorkreportById") @@ -42,12 +71,12 @@ public class HuzhouWorkreportController { } throw new EasyException("修改失败"); } - @PostMapping("/deleteWorkreport") - public Result deleteContractinfo(@RequestBody HuzhouWorkreport workreport) throws IOException { - Boolean aBoolean = workreportService.deleteWorkreport(workreport); - if(aBoolean){ - return Result.ok("删除成功"); - } - throw new EasyException("删除失败"); - } +// @PostMapping("/deleteWorkreport") +// public Result deleteContractinfo(@RequestBody HuzhouWorkreport workreport) throws IOException { +// Boolean aBoolean = workreportService.deleteWorkreport(workreport); +// if(aBoolean){ +// return Result.ok("删除成功"); +// } +// throw new EasyException("删除失败"); +// } } diff --git a/huzhou/src/main/java/com/easy/admin/modules/huzhou/dao/HuzhouProjectinfoHistoryMapper.java b/huzhou/src/main/java/com/easy/admin/modules/huzhou/dao/HuzhouProjectinfoHistoryMapper.java new file mode 100644 index 0000000..33d2848 --- /dev/null +++ b/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 { +} diff --git a/huzhou/src/main/java/com/easy/admin/modules/huzhou/dao/HuzhouProjectinfoMapper.java b/huzhou/src/main/java/com/easy/admin/modules/huzhou/dao/HuzhouProjectinfoMapper.java index c3b6f44..236e54a 100644 --- a/huzhou/src/main/java/com/easy/admin/modules/huzhou/dao/HuzhouProjectinfoMapper.java +++ b/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.extension.plugins.pagination.Page; +import com.easy.admin.modules.huzhou.vo.HuzhouProjectinfoOV; import org.apache.ibatis.annotations.Mapper; import com.easy.admin.modules.huzhou.entity.HuzhouProjectinfo; +import java.util.List; import java.util.Map; public interface HuzhouProjectinfoMapper extends BaseMapper { + /** + * 分页获取项目信息,不含子项目 + * @param page 分页信息 + * @param info 查询条件 + * @return Page + */ Page getProjectInfoPageList(Page page,HuzhouProjectinfo info); + + /** + * 获取项目信息列表 + * @param info 查询条件 + * @return List + */ + List getProjectInfoPageList(HuzhouProjectinfo info); + + /** + * 获取项目信息和子项目信息,支持分页 + * @param page 分页信息 + * @param info 查询条件 + * @return Page + */ + Page getProjectAndChildInfoPageList(Page page, HuzhouProjectinfo info); + /** + * 获取项目信息和子项目信息列表 + * @param info 查询条件 + * @return List + */ + List getProjectAndChildInfoPageList( HuzhouProjectinfo info); + } diff --git a/huzhou/src/main/java/com/easy/admin/modules/huzhou/dao/HuzhouWorkreportMapper.java b/huzhou/src/main/java/com/easy/admin/modules/huzhou/dao/HuzhouWorkreportMapper.java index 03634ce..9cce94e 100644 --- a/huzhou/src/main/java/com/easy/admin/modules/huzhou/dao/HuzhouWorkreportMapper.java +++ b/huzhou/src/main/java/com/easy/admin/modules/huzhou/dao/HuzhouWorkreportMapper.java @@ -1,13 +1,16 @@ package com.easy.admin.modules.huzhou.dao; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.easy.admin.modules.huzhou.entity.HuzhouProjectinfo; import org.apache.ibatis.annotations.Mapper; import com.easy.admin.modules.huzhou.entity.HuzhouWorkreport; import com.easy.admin.modules.huzhou.vo.HuzhouWorkreportOV; public interface HuzhouWorkreportMapper extends BaseMapper { - Page getWorkreportPageList(Page page, HuzhouWorkreportOV info); + Page getWorkreportPageList(Page page, HuzhouProjectinfo info); + IPage getNoTypeWorkReportPageList(Page page, HuzhouProjectinfo info); } diff --git a/huzhou/src/main/java/com/easy/admin/modules/huzhou/dao/mapping/HuzhouProjectinfoMapper.xml b/huzhou/src/main/java/com/easy/admin/modules/huzhou/dao/mapping/HuzhouProjectinfoMapper.xml index f2404f2..fe1a9a3 100644 --- a/huzhou/src/main/java/com/easy/admin/modules/huzhou/dao/mapping/HuzhouProjectinfoMapper.xml +++ b/huzhou/src/main/java/com/easy/admin/modules/huzhou/dao/mapping/HuzhouProjectinfoMapper.xml @@ -1,6 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/huzhou/src/main/java/com/easy/admin/modules/huzhou/dao/mapping/HuzhouWorkreportMapper.xml b/huzhou/src/main/java/com/easy/admin/modules/huzhou/dao/mapping/HuzhouWorkreportMapper.xml index fce9bff..dc9470a 100644 --- a/huzhou/src/main/java/com/easy/admin/modules/huzhou/dao/mapping/HuzhouWorkreportMapper.xml +++ b/huzhou/src/main/java/com/easy/admin/modules/huzhou/dao/mapping/HuzhouWorkreportMapper.xml @@ -1,17 +1,51 @@ - + SELECT * from huzhou_projectinfo u - b.stage >= 2 + u.report_type is not null - and b.id in( - select DISTINCT project_id from huzhou_userproject where user_id=#{info.projectContacts} + and u.id in( + select project_id from huzhou_userproject where user_id=#{info.projectContacts} ) - and b.id in( + 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}) @@ -24,15 +58,94 @@ ) ) - - - and a.document_name like #{tempStr} + + + and u.project_name like #{tempStr} + + + + + and u.admin_division like #{tempStr} + + + + and u.duty_workplace like #{tempStr} + + + + and u.workplace_properties like #{tempStr} + + + + and u.duty_workplace like #{tempStr} + + + and u.reform_name = #{info.reformName} + + + and u.super_leader = #{info.superLeader} + + + and u.stage >= 2 + + + order by create_date desc + + + \ No newline at end of file diff --git a/huzhou/src/main/java/com/easy/admin/modules/huzhou/entity/HuzhouProjectinfo.java b/huzhou/src/main/java/com/easy/admin/modules/huzhou/entity/HuzhouProjectinfo.java index f3616a3..897faa0 100644 --- a/huzhou/src/main/java/com/easy/admin/modules/huzhou/entity/HuzhouProjectinfo.java +++ b/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 java.util.Date; -import java.io.Serializable; - /** * (HuzhouProjectinfo)实体类 * @@ -12,8 +9,7 @@ import java.io.Serializable; * @since 2024-02-05 14:14:53 */ @Data -public class HuzhouProjectinfo extends BaseEntity implements Serializable{ - private static final long serialVersionUID = 952171041224600588L; +public class HuzhouProjectinfo extends BaseEntity { /** * 项目id */ @@ -150,7 +146,7 @@ public class HuzhouProjectinfo extends BaseEntity implements Serializable{ * 2025年支付 */ private Double payamount2025Money; - + private String reportType; } diff --git a/huzhou/src/main/java/com/easy/admin/modules/huzhou/entity/HuzhouProjectinfoHistory.java b/huzhou/src/main/java/com/easy/admin/modules/huzhou/entity/HuzhouProjectinfoHistory.java new file mode 100644 index 0000000..6495249 --- /dev/null +++ b/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; + + + +} + diff --git a/huzhou/src/main/java/com/easy/admin/modules/huzhou/service/IHuzhouProjectinfoService.java b/huzhou/src/main/java/com/easy/admin/modules/huzhou/service/IHuzhouProjectinfoService.java index 07080de..5bba614 100644 --- a/huzhou/src/main/java/com/easy/admin/modules/huzhou/service/IHuzhouProjectinfoService.java +++ b/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 */ public interface IHuzhouProjectinfoService extends IService{ - -// void submitProject(HuzhouProjectinfo info); + /** + * 修改项目阶段信息 + * @param id 项目id + * @param stage 阶段 + */ void modifyStageById(String id,String stage); - void modifyismodifyById(String id,String ismodify); + + /** + * 分页查询项目信息列表 + * @param projectinfo 条件 + * @param pageNo 页面 + * @param pageSize 页数 + * @return 返回值 + */ IPage getProjectInfoPageList(HuzhouProjectinfo projectinfo, Integer pageNo, Integer pageSize); + /** + * 分页查询项目信息列表带子项目信息 + * @param projectinfo 条件 + * @param pageNo 页面 + * @param pageSize 页数 + * @return 返回值 + */ IPage getProjectInfoAndChildPageList(HuzhouProjectinfo projectinfo, Integer pageNo, Integer pageSize); - List getProjectInfoList(HuzhouProjectinfo projectinfo); + /** * 管理人员批量导入项目 * @param multipartFile 文件信息 */ void batchImportProjects(MultipartFile multipartFile) throws Exception; + + /** + * 批量导出项目信息 + * @param response response + * @param projectinfo 导出条件 + */ void batchdownloadProject(HttpServletResponse response, HuzhouProjectinfo projectinfo); + + /** + * 查询项目信息包含了子项目信息的查询 + * @param id 项目id + * @return 返回值 + */ Object queryProjectInfoById(String id); - Object queryProjectInfoNewDataById(String id); /** * 新增项目入库,提交单个项目 @@ -50,4 +78,10 @@ public interface IHuzhouProjectinfoService extends IService{ * @param projectApproveOV 项目入库信息 */ void approveProjectInfo(ProjectApproveOV projectApproveOV); + + /** + * 修改项目联系人 + * @param huzhouProjectinfo 项目信息 + */ + void modifyProjectInfoContact(HuzhouProjectinfo huzhouProjectinfo); } diff --git a/huzhou/src/main/java/com/easy/admin/modules/huzhou/service/IHuzhouWorkreportService.java b/huzhou/src/main/java/com/easy/admin/modules/huzhou/service/IHuzhouWorkreportService.java index 10be05d..82d3d49 100644 --- a/huzhou/src/main/java/com/easy/admin/modules/huzhou/service/IHuzhouWorkreportService.java +++ b/huzhou/src/main/java/com/easy/admin/modules/huzhou/service/IHuzhouWorkreportService.java @@ -1,7 +1,9 @@ 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.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.vo.HuzhouWorkreportOV; @@ -10,11 +12,18 @@ import org.springframework.web.multipart.MultipartFile; import java.io.IOException; public interface IHuzhouWorkreportService extends IService { - Page getWorkreportPageList(HuzhouWorkreportOV Workreport, Integer pageNo, + Page getWorkreportPageList(HuzhouProjectinfo huzhouProjectinfo, Integer pageNo, Integer pageSize); void addWorkreport(MultipartFile file, HuzhouWorkreport Workreport) throws IOException; Boolean modifyWorkreport(MultipartFile file, HuzhouWorkreport Workreport) throws IOException; Boolean deleteWorkreport(HuzhouWorkreport Workreport); + /** + * 设置项目周月报的类型 + * @param huzhouProjectinfo 参数 + */ + void setProjectWorkReport(HuzhouProjectinfo huzhouProjectinfo); + + IPage getNoTypeWorkReportPageList(HuzhouProjectinfo projectinfo, Integer pageNo, Integer pageSize); } diff --git a/huzhou/src/main/java/com/easy/admin/modules/huzhou/service/impl/HuzhouProjectinfoServiceImpl.java b/huzhou/src/main/java/com/easy/admin/modules/huzhou/service/impl/HuzhouProjectinfoServiceImpl.java index afc3768..d901530 100644 --- a/huzhou/src/main/java/com/easy/admin/modules/huzhou/service/impl/HuzhouProjectinfoServiceImpl.java +++ b/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.common.core.common.select.Select; 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.TemplateExcelUtils; 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.HuzhouSubProjectinfoMapper; import com.easy.admin.modules.huzhou.entity.*; @@ -60,8 +62,6 @@ public class HuzhouProjectinfoServiceImpl extends ServiceImpl NameMap = new HashMap(); HashMap chineseNameMap = new HashMap(); - Row titlerow = sheet.getRow(0); - Row chineseTitlerow = sheet.getRow(1); - int cellNum = 32; + Row titlerow = sheet.getRow(0);//第一行字段名称 + Row chineseTitlerow = sheet.getRow(1); //第二行中文标题 + int cellNum = 32;//一共32列 //第一行获取字段名称 for (int i = 0; i < cellNum; i++) { NameMap.put(String.valueOf(i),titlerow.getCell(i).getStringCellValue()); @@ -117,13 +118,14 @@ public class HuzhouProjectinfoServiceImpl extends ServiceImpl reformTasks = sysDictService.selectByDictType("reformTasks"); + List reformTasks = sysDictService.selectByDictType("reformTasks"); String dictValue = null; for (Select dict:reformTasks) { @@ -445,7 +368,6 @@ public class HuzhouProjectinfoServiceImpl extends ServiceImpl queryWrapper = new LambdaQueryWrapper<>(); - queryWrapper.eq(HuzhouProcessinfo::getProcessName,"createPlaninfo"); - queryWrapper.eq(HuzhouProcessinfo::getProcessstatus,"1"); - List huzhouProcessinfos = processinfoMapper.selectList(queryWrapper); - if(huzhouProcessinfos.size()>0){ - return "1"; - } - queryWrapper.clear(); - queryWrapper.eq(HuzhouProcessinfo::getProjectid,id); - queryWrapper.eq(HuzhouProcessinfo::getProcessName,"createPlaninfo"); - queryWrapper.eq(HuzhouProcessinfo::getProcessstatus,"2"); - huzhouProcessinfos = processinfoMapper.selectList(queryWrapper); - if(huzhouProcessinfos.size()>0){ - return "2"; - } - return "0"; - } - public HuzhouProjectinfo updateProjectinfoField(HuzhouProjectinfo huzhouProjectinfo){ - String id = huzhouProjectinfo.getId(); - List 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 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; - } +// private String getPlanProcessStatus(String id){ +// LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); +// queryWrapper.eq(HuzhouProcessinfo::getProcessName,"createPlaninfo"); +// queryWrapper.eq(HuzhouProcessinfo::getProcessstatus,"1"); +// List huzhouProcessinfos = processinfoMapper.selectList(queryWrapper); +// if(huzhouProcessinfos.size()>0){ +// return "1"; +// } +// queryWrapper.clear(); +// queryWrapper.eq(HuzhouProcessinfo::getProjectid,id); +// queryWrapper.eq(HuzhouProcessinfo::getProcessName,"createPlaninfo"); +// queryWrapper.eq(HuzhouProcessinfo::getProcessstatus,"2"); +// huzhouProcessinfos = processinfoMapper.selectList(queryWrapper); +// if(huzhouProcessinfos.size()>0){ +// return "2"; +// } +// return "0"; +// } } diff --git a/huzhou/src/main/java/com/easy/admin/modules/huzhou/service/impl/HuzhouSubProjectinfoServiceImpl.java b/huzhou/src/main/java/com/easy/admin/modules/huzhou/service/impl/HuzhouSubProjectinfoServiceImpl.java index 428a8a9..f71859b 100644 --- a/huzhou/src/main/java/com/easy/admin/modules/huzhou/service/impl/HuzhouSubProjectinfoServiceImpl.java +++ b/huzhou/src/main/java/com/easy/admin/modules/huzhou/service/impl/HuzhouSubProjectinfoServiceImpl.java @@ -48,20 +48,15 @@ public class HuzhouSubProjectinfoServiceImpl extends ServiceImpl queryWrapper = new LambdaQueryWrapper<>(); queryWrapper.eq(HuzhouSubProjectinfo::getProjectId,projectId); List list = list(queryWrapper); if(list!=null&&list.size()>0){ - //更新主项目的数据为最新鲜值 - list.forEach(item->{ - item= projectinfoService.updateProjectinfoField(item); - }); + //说明是子项目修改 if(subprojectinfo.getId()!=null){ HuzhouSubProjectinfo subProjectinfo = getById(subprojectinfo.getId()); - subProjectinfo= projectinfoService.updateProjectinfoField(subProjectinfo); 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.setSelfMoney(byId.getSelfMoney()+subProjectinfo.getSelfMoney()-list.stream().mapToDouble(HuzhouProjectinfo::getSelfMoney).sum()); @@ -82,15 +77,6 @@ public class HuzhouSubProjectinfoServiceImpl extends ServiceImpl implements IHuzhouWorkreportService { @Autowired private HuzhouWorkreportMapper workreportMapper; + @Autowired + private IHuzhouProjectinfoService huzhouProjectinfoService; @Value(value = "${jeecg.path.upload}") private String uploadpath; @Override - public Page getWorkreportPageList(HuzhouWorkreportOV workreport, Integer pageNo, Integer pageSize) { + public Page getWorkreportPageList(HuzhouProjectinfo huzhouProjectinfo, Integer pageNo, Integer pageSize) { Page page = new Page<>(pageNo, pageSize); - SysUser currentUser = ShiroUtil.getCurrentUser(); - List 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")){ - workreport.setSupervisorContactor(currentUser.getId()); - }else { - workreport.setProjectContacts(currentUser.getId()); - } - Page pageList = workreportMapper.getWorkreportPageList(page, workreport); + huzhouProjectinfo=CommonUtils.setGetProjectInfoAuth(huzhouProjectinfo); + Page pageList = workreportMapper.getWorkreportPageList(page, huzhouProjectinfo); return pageList; } + @Override public void addWorkreport(MultipartFile file, HuzhouWorkreport workreport) throws IOException { addContractFile(file,workreport); @@ -85,6 +78,20 @@ public class HuzhouWorkreportServiceImpl extends ServiceImpl getNoTypeWorkReportPageList(HuzhouProjectinfo projectinfo, Integer pageNo, Integer pageSize) { + Page page = new Page<>(pageNo, pageSize); + projectinfo=CommonUtils.setGetProjectInfoAuth(projectinfo); + IPage res =workreportMapper.getNoTypeWorkReportPageList(page,projectinfo); + return res; + } + private void addContractFile(MultipartFile file, HuzhouWorkreport workreport) throws IOException { SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd"); String currentDay = dateFormat.format(new Date()); diff --git a/huzhou/src/main/java/com/easy/admin/modules/huzhou/vo/HuzhouProjectinfoOV.java b/huzhou/src/main/java/com/easy/admin/modules/huzhou/vo/HuzhouProjectinfoOV.java index da59321..fca64b4 100644 --- a/huzhou/src/main/java/com/easy/admin/modules/huzhou/vo/HuzhouProjectinfoOV.java +++ b/huzhou/src/main/java/com/easy/admin/modules/huzhou/vo/HuzhouProjectinfoOV.java @@ -1,15 +1,28 @@ 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.HuzhouSubProjectinfo; +import com.easy.admin.modules.huzhou.handler.HuzhouSubProjectHandler; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import lombok.Data; import java.util.List; @Data +@JsonIgnoreProperties(value = { "hibernateLazyInitializer", "handler" })//防止传到前端会报错 public class HuzhouProjectinfoOV extends HuzhouProjectinfo { + List children; - String planProcessStatus; + +// String planProcessStatus; + /** + * 是否缺失子项目标志 true 缺失 + */ Boolean missingSubprojects; // String isSubProject; } diff --git a/huzhou/src/main/java/com/easy/admin/modules/huzhou/vo/ProjectApproveOV.java b/huzhou/src/main/java/com/easy/admin/modules/huzhou/vo/ProjectApproveOV.java index fd5d473..caf0e3e 100644 --- a/huzhou/src/main/java/com/easy/admin/modules/huzhou/vo/ProjectApproveOV.java +++ b/huzhou/src/main/java/com/easy/admin/modules/huzhou/vo/ProjectApproveOV.java @@ -15,6 +15,4 @@ public class ProjectApproveOV { private String stage; private String isEdit; private HuzhouProjectinfo projectInfo; - - private List projectArr; }