| | |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import cn.hutool.core.util.ZipUtil; |
| | | import com.alibaba.excel.EasyExcel; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | |
| | | import com.ycl.domain.entity.*; |
| | | import com.ycl.domain.excel.ProjectExcelTemplate; |
| | | import com.ycl.domain.form.DocumentInfoForm; |
| | | import com.ycl.domain.form.PlanForm; |
| | | import com.ycl.domain.form.ProjectInfoForm; |
| | | import com.ycl.domain.query.ProjectExportQuery; |
| | | import com.ycl.domain.query.ProjectInfoQuery; |
| | |
| | | private final ProjectUnitRegistrationInfoMapper unitRegistrationInfoMapper; |
| | | private final FileService fileService; |
| | | private final FileMapper fileMapper; |
| | | private final PlanMapper planMapper; |
| | | |
| | | /** |
| | | * 添加 |
| | |
| | | entity.setCreateBy(userId); |
| | | entity.setUpdateBy(userId); |
| | | baseMapper.insert(entity); |
| | | addPlan(entity.getId()); //添加计划表 |
| | | //添加文件 |
| | | List<File> fileList = form.getFileList(); |
| | | fileList.forEach(item -> { |
| | |
| | | }); |
| | | fileService.saveBatch(fileList); |
| | | return Result.ok("添加成功").data(entity.getId()); |
| | | } |
| | | |
| | | public void addPlan(Long projectInfoId) { |
| | | Plan plan = new Plan(); |
| | | plan.setProjectInfoId(projectInfoId); |
| | | plan.setReportStatus(1); |
| | | plan.setMonthStatus(1); |
| | | plan.setSeasonStatus(1); |
| | | plan.setYearStatus(1); |
| | | plan.setDeleted(0); |
| | | planMapper.insert(plan); |
| | | } |
| | | |
| | | /** |
| | |
| | | ProjectInfo projectInfo = baseMapper.selectById(recordId); |
| | | // 判断当前用户id是否在主管列表中 |
| | | String competentDepartment = projectInfo.getCompetentDepartment(); |
| | | if (StringUtils.isEmpty(competentDepartment)){ |
| | | return Result.ok().data(false); |
| | | } |
| | | List<String> list = Arrays.asList(competentDepartment.split(",")); |
| | | // 获得当前用户id |
| | | Long userId = SecurityUtils.getUserId(); |
| | |
| | | //审批计划书 |
| | | item.setApprovalPlan(file.getOriginalName()); |
| | | } |
| | | }else if(FileTypeEnum.DOCUMENT_INFO.equals(file.getType())){ |
| | | } else if (FileTypeEnum.DOCUMENT_INFO.equals(file.getType())) { |
| | | if (file.getBusId().equals(item.getId())) { |
| | | //相关文书 |
| | | item.setDocuments(file.getOriginalName()); |
| | | } |
| | | }else if(FileTypeEnum.INVEST_POLICY.equals(file.getType())){ |
| | | } else if (FileTypeEnum.INVEST_POLICY.equals(file.getType())) { |
| | | if (file.getBusId().equals(item.getPolicyId())) { |
| | | //符合产业政策附件 |
| | | item.setPolicyComplianceAttachment(file.getOriginalName()); |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public Result updateUsedStatus(Integer id, Integer usedStatus) { |
| | | ProjectInfo entity = baseMapper.selectById(id); |
| | | // 为空抛IllegalArgumentException,做全局异常处理 |
| | | Assert.notNull(entity, "记录不存在"); |
| | | entity.setUsedStatus(usedStatus); |
| | | baseMapper.updateById(entity); |
| | | return Result.ok("删除成功"); |
| | | } |
| | | } |