| | |
| | | @ApiImplicitParam(paramType = "query", name = "pageNum", dataType = "int", required = false, value = "当前页,默认1"), |
| | | @ApiImplicitParam(paramType = "query", name = "pageSize", dataType = "int", required = false, value = "每页数目,默认10"), |
| | | @ApiImplicitParam(paramType = "query", name = "companyId", dataType = "int", required = false, value = "公司id"), |
| | | @ApiImplicitParam(paramType = "query", name = "year", dataType = "String" , required = false, value = "年份") |
| | | }) |
| | | @GetMapping("/selectInternalAuditCheckList") |
| | | public CommonResult selectInternalAuditCheckList(Integer companyId){ |
| | | return CommonResult.success(internalAuditCheckService.selectInternalAuditCheckList(companyId)); |
| | | public CommonResult selectInternalAuditCheckList(Integer companyId, String year){ |
| | | return CommonResult.success(internalAuditCheckService.selectInternalAuditCheckList(companyId,year)); |
| | | } |
| | | @RepeatSubmit |
| | | @ApiOperation(value = "新增内审检查") |
| | |
| | | return internalAuditCheckService.deletedInternalAuditCheck(id); |
| | | } |
| | | |
| | | |
| | | @RepeatSubmit |
| | | @ApiOperation(value = "一键复制内审检查") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(paramType = "query", name = "companyId", dataType = "int", required = false, value = "公司id,不传则使用当前登录用户公司"), |
| | | @ApiImplicitParam(paramType = "query", name = "sourceYear", dataType = "String", required = true, value = "源年份"), |
| | | @ApiImplicitParam(paramType = "query", name = "targetYear", dataType = "String", required = true, value = "目标年份"), |
| | | }) |
| | | @GetMapping("/copyInternalAuditCheck") |
| | | public CommonResult copyInternalAuditCheck( |
| | | @RequestParam(required = false) Integer companyId, |
| | | @RequestParam String sourceYear, |
| | | @RequestParam String targetYear) { |
| | | return internalAuditCheckService.copyInternalAuditCheck(companyId, sourceYear, targetYear); |
| | | } |
| | | // @ApiOperation(value = "内审检查详情") |
| | | // @ApiImplicitParams({ |
| | | // @ApiImplicitParam(paramType = "query", name = "id", dataType = "int", required = true, value = "id"), |
| | |
| | | package com.gkhy.exam.admin.controller.web; |
| | | |
| | | import com.gkhy.exam.common.annotation.RepeatSubmit; |
| | | import com.gkhy.exam.common.api.CommonResult; |
| | | import com.gkhy.exam.system.domain.*; |
| | | import com.gkhy.exam.system.service.*; |
| | |
| | | @GetMapping("/plan/deleted") |
| | | public CommonResult deletedQuality(@RequestParam("planId") Integer planId){ |
| | | return planService.deletedPlan(planId); |
| | | } |
| | | |
| | | @RepeatSubmit |
| | | @ApiOperation(value = "一键复制内审策划") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(paramType = "query", name = "companyId", dataType = "int", required = false, value = "公司id,不传则使用当前登录用户公司"), |
| | | @ApiImplicitParam(paramType = "query", name = "sourceYear", dataType = "String", required = true, value = "源年份"), |
| | | @ApiImplicitParam(paramType = "query", name = "targetYear", dataType = "String", required = true, value = "目标年份"), |
| | | }) |
| | | @GetMapping("/plan/copy") |
| | | public CommonResult copyInternalAuditPlan( |
| | | @RequestParam(required = false) Integer companyId, |
| | | @RequestParam String sourceYear, |
| | | @RequestParam String targetYear) { |
| | | return planService.copyInternalAuditPlan(companyId, sourceYear, targetYear); |
| | | } |
| | | |
| | | |
| | |
| | | return carryService.deletedCarry(carryId); |
| | | } |
| | | |
| | | @RepeatSubmit |
| | | @ApiOperation(value = "一键复制内审计划实施") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(paramType = "query", name = "companyId", dataType = "int", required = false, value = "公司id,不传则使用当前登录用户公司"), |
| | | @ApiImplicitParam(paramType = "query", name = "sourceYear", dataType = "String", required = true, value = "源年份"), |
| | | @ApiImplicitParam(paramType = "query", name = "targetYear", dataType = "String", required = true, value = "目标年份"), |
| | | }) |
| | | @GetMapping("/carry/copy") |
| | | public CommonResult copyInternalAuditCarry( |
| | | @RequestParam(required = false) Integer companyId, |
| | | @RequestParam String sourceYear, |
| | | @RequestParam String targetYear) { |
| | | return carryService.copyInternalAuditCarry(companyId, sourceYear, targetYear); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | |
| | | return managementPlanService.deletedManagementPlan(id); |
| | | } |
| | | |
| | | @RepeatSubmit |
| | | @ApiOperation(value = "一键复制管理审批计划") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(paramType = "query", name = "companyId", dataType = "int", required = false, value = "公司id,不传则使用当前登录用户公司"), |
| | | @ApiImplicitParam(paramType = "query", name = "sourceYear", dataType = "String", required = true, value = "源年份"), |
| | | @ApiImplicitParam(paramType = "query", name = "targetYear", dataType = "String", required = true, value = "目标年份"), |
| | | }) |
| | | @GetMapping("/copyManagementPlan") |
| | | public CommonResult copyManagementPlan(@RequestParam(required = false) Integer companyId, @RequestParam String sourceYear, @RequestParam String targetYear) { |
| | | return managementPlanService.copyManagementPlan(companyId, sourceYear, targetYear); |
| | | } |
| | | |
| | | } |
| | |
| | | @ApiImplicitParam(paramType = "query", name = "pageNum", dataType = "int", required = false, value = "当前页,默认1"), |
| | | @ApiImplicitParam(paramType = "query", name = "pageSize", dataType = "int", required = false, value = "每页数目,默认10"), |
| | | @ApiImplicitParam(paramType = "query", name = "companyId", dataType = "int", required = false, value = "公司id"), |
| | | @ApiImplicitParam(paramType = "query", name = "reviewType", dataType = "int", required = true, value = "1会议、2输入、3报告") |
| | | @ApiImplicitParam(paramType = "query", name = "reviewType", dataType = "int", required = true, value = "1会议、2输入、3报告"), |
| | | @ApiImplicitParam(paramType = "query", name = "year", dataType = "int", required = false, value = "年份") |
| | | }) |
| | | @GetMapping("/selectMeetingsList") |
| | | public CommonResult selectMeetingsList(Integer companyId,@RequestParam("reviewType") Integer reviewType){ |
| | | return CommonResult.success(managementReviewService.selectManagementReviewList(companyId,reviewType)); |
| | | public CommonResult selectMeetingsList(Integer companyId,@RequestParam("reviewType") Integer reviewType,String year){ |
| | | return CommonResult.success(managementReviewService.selectManagementReviewList(companyId,reviewType,year)); |
| | | } |
| | | @RepeatSubmit |
| | | @ApiOperation(value = "新增管理评审会议、输入、报告") |
| | |
| | | return managementReviewService.deletedManagementReview(id); |
| | | } |
| | | |
| | | @RepeatSubmit |
| | | @ApiOperation(value = "一键复制管理评审会议、输入、报告") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(paramType = "query", name = "companyId", dataType = "int", required = false, value = "公司id,不传则使用当前登录用户公司"), |
| | | @ApiImplicitParam(paramType = "query", name = "sourceYear", dataType = "String", required = true, value = "源年份"), |
| | | @ApiImplicitParam(paramType = "query", name = "targetYear", dataType = "String", required = true, value = "目标年份"), |
| | | @ApiImplicitParam(paramType = "query", name = "reviewType", dataType = "int", required = true, value = "评审类型:1会议、2输入、3报告") |
| | | }) |
| | | @GetMapping("/copyManagementReview") |
| | | public CommonResult copyManagementReview( |
| | | @RequestParam(required = false) Integer companyId, |
| | | @RequestParam String sourceYear, |
| | | @RequestParam String targetYear, |
| | | @RequestParam Integer reviewType) { |
| | | return managementReviewService.copyManagementReview(companyId, sourceYear, targetYear, reviewType); |
| | | } |
| | | |
| | | } |
| | |
| | | */ |
| | | @Mapper |
| | | public interface InternalAuditCheckMapper extends BaseMapper<InternalAuditCheck> { |
| | | List<InternalAuditCheck> selectInternalAuditCheckList(@Param("companyId") Integer companyId); |
| | | List<InternalAuditCheck> selectInternalAuditCheckList(@Param("companyId") Integer companyId, @Param("year") String year); |
| | | |
| | | int getStatisticData(@Param("companyId") Integer companyId, @Param("startTime") String startTime, @Param("endTime") String endTime); |
| | | |
| | |
| | | @Mapper |
| | | public interface ManagementReviewMapper extends BaseMapper<ManagementReview> { |
| | | |
| | | List<ManagementReview> selectManagementReviewList(@Param("companyId") Integer companyId, @Param("reviewType") Integer reviewType); |
| | | List<ManagementReview> selectManagementReviewList(@Param("companyId") Integer companyId, @Param("reviewType") Integer reviewType, @Param("year") String year); |
| | | } |
| | |
| | | CommonResult updateCarry(InternalAuditCarry carry); |
| | | |
| | | CommonResult deletedCarry(Integer carryId); |
| | | |
| | | CommonResult copyInternalAuditCarry(Integer companyId, String sourceYear, String targetYear); |
| | | } |
| | |
| | | * @since 2025-07-10 15:11:50 |
| | | */ |
| | | public interface InternalAuditCheckService extends IService<InternalAuditCheck> { |
| | | CommonPage selectInternalAuditCheckList(Integer companyId); |
| | | CommonPage selectInternalAuditCheckList(Integer companyId, String year); |
| | | |
| | | CommonResult insertInternalAuditCheck(InternalAuditCheck internalAuditCheck); |
| | | |
| | |
| | | |
| | | List<InternalAuditCheck> selectByMap(Map<String, Object> stringObjectHashMap); |
| | | |
| | | CommonResult copyInternalAuditCheck(Integer companyId, String sourceYear, String targetYear); |
| | | |
| | | // CommonResult internalAuditCheckInfo(Integer id); |
| | | } |
| | |
| | | CommonResult updatePlan(InternalAuditPlan plan); |
| | | |
| | | CommonResult deletedPlan(Integer planId); |
| | | |
| | | CommonResult copyInternalAuditPlan(Integer companyId, String sourceYear, String targetYear); |
| | | } |
| | |
| | | |
| | | CommonResult deletedManagementPlan(Integer id); |
| | | |
| | | CommonResult copyManagementPlan(Integer companyId, String sourceYear, String targetYear); |
| | | |
| | | } |
| | |
| | | * @since 2025-07-10 15:11:50 |
| | | */ |
| | | public interface ManagementReviewService extends IService<ManagementReview> { |
| | | CommonPage selectManagementReviewList(Integer companyId,Integer reviewType); |
| | | CommonPage selectManagementReviewList(Integer companyId,Integer reviewType,String year); |
| | | |
| | | CommonResult insertManagementReview(ManagementReview managementReview); |
| | | |
| | | CommonResult updateManagementReview(ManagementReview managementReview); |
| | | |
| | | CommonResult deletedManagementReview(Integer id); |
| | | |
| | | CommonResult copyManagementReview(Integer companyId, String sourceYear, String targetYear, Integer reviewType); |
| | | } |
| | |
| | | package com.gkhy.exam.system.service.impl; |
| | | |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.gkhy.exam.common.api.CommonPage; |
| | |
| | | import com.gkhy.exam.system.service.InternalAuditCheckService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.time.LocalDate; |
| | |
| | | carryMapper.updateById(internalAuditCarry); |
| | | return CommonResult.success(); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | @Transactional |
| | | public CommonResult copyInternalAuditCarry(Integer companyId, String sourceYear, String targetYear) { |
| | | if (companyId == null) { |
| | | companyId = SecurityUtils.getCompanyId().intValue(); |
| | | } |
| | | |
| | | if (sourceYear == null || sourceYear.trim().isEmpty()) { |
| | | return CommonResult.failed("源年份不能为空"); |
| | | } |
| | | |
| | | if (targetYear == null || targetYear.trim().isEmpty()) { |
| | | return CommonResult.failed("目标年份不能为空"); |
| | | } |
| | | |
| | | LambdaUpdateWrapper<InternalAuditCarry> deleteWrapper = new LambdaUpdateWrapper<>(); |
| | | deleteWrapper.eq(InternalAuditCarry::getCompanyId, companyId) |
| | | .eq(InternalAuditCarry::getYear, targetYear) |
| | | .eq(InternalAuditCarry::getDelFlag, 1) |
| | | .set(InternalAuditCarry::getDelFlag, 2) |
| | | .set(InternalAuditCarry::getUpdateBy, SecurityUtils.getUsername()) |
| | | .set(InternalAuditCarry::getUpdateTime, LocalDateTime.now()); |
| | | carryMapper.update(new InternalAuditCarry(), deleteWrapper); |
| | | |
| | | LambdaQueryWrapper<InternalAuditCarry> queryWrapperSource = new LambdaQueryWrapper<>(); |
| | | queryWrapperSource.eq(InternalAuditCarry::getCompanyId, companyId) |
| | | .eq(InternalAuditCarry::getYear, sourceYear) |
| | | .eq(InternalAuditCarry::getDelFlag, 1); |
| | | List<InternalAuditCarry> sourceCarries = carryMapper.selectList(queryWrapperSource); |
| | | |
| | | if (ObjectUtil.isEmpty(sourceCarries)) { |
| | | return CommonResult.success("源年份无相关数据"); |
| | | } |
| | | |
| | | for (InternalAuditCarry sourceCarry : sourceCarries) { |
| | | InternalAuditCarry newCarry = new InternalAuditCarry(); |
| | | newCarry.setCompanyId(sourceCarry.getCompanyId()); |
| | | newCarry.setYear(targetYear); |
| | | newCarry.setAuditPurpose(sourceCarry.getAuditPurpose()); |
| | | newCarry.setReviewBasis(sourceCarry.getReviewBasis()); |
| | | newCarry.setReviewScope(sourceCarry.getReviewScope()); |
| | | newCarry.setReviewStart(sourceCarry.getReviewStart()); |
| | | newCarry.setReviewEnd(sourceCarry.getReviewEnd()); |
| | | newCarry.setReviewPerson(sourceCarry.getReviewPerson()); |
| | | newCarry.setFirstStarttime(sourceCarry.getFirstStarttime()); |
| | | newCarry.setFirstEndtime(sourceCarry.getFirstEndtime()); |
| | | newCarry.setLastStarttime(sourceCarry.getLastStarttime()); |
| | | newCarry.setLastEndtime(sourceCarry.getLastEndtime()); |
| | | newCarry.setCompilationId(sourceCarry.getCompilationId()); |
| | | newCarry.setProofreadId(sourceCarry.getProofreadId()); |
| | | newCarry.setCheckId(sourceCarry.getCheckId()); |
| | | newCarry.setRatifyId(sourceCarry.getRatifyId()); |
| | | newCarry.setDelFlag(1); |
| | | newCarry.setCreateBy(SecurityUtils.getUsername()); |
| | | newCarry.setCreateTime(LocalDateTime.now()); |
| | | newCarry.setUpdateBy(SecurityUtils.getUsername()); |
| | | newCarry.setUpdateTime(LocalDateTime.now()); |
| | | |
| | | int insert = carryMapper.insert(newCarry); |
| | | if (insert <= 0) { |
| | | throw new RuntimeException("复制内审计划实施主表数据失败"); |
| | | } |
| | | |
| | | List<InternalAuditCarryDept> sourceDeptList = carryMapper.selectCarryDeptList(sourceCarry.getId()); |
| | | if (ObjectUtil.isNotEmpty(sourceDeptList)) { |
| | | List<InternalAuditCarryDept> newDeptList = new ArrayList<>(); |
| | | for (InternalAuditCarryDept sourceDept : sourceDeptList) { |
| | | InternalAuditCarryDept newDept = new InternalAuditCarryDept(); |
| | | newDept.setCarryId(newCarry.getId()); |
| | | newDept.setDeptId(sourceDept.getDeptId()); |
| | | newDept.setCheckId(sourceDept.getCheckId()); |
| | | newDept.setDate(sourceDept.getDate()); |
| | | newDept.setStartTime(sourceDept.getStartTime()); |
| | | newDept.setEndTime(sourceDept.getEndTime()); |
| | | newDeptList.add(newDept); |
| | | } |
| | | carryMapper.insertCarryDept(newDeptList); |
| | | } |
| | | } |
| | | |
| | | return CommonResult.success("成功从年份[" + sourceYear + "]复制到年份[" + targetYear + "]"); |
| | | } |
| | | |
| | | } |
| | |
| | | package com.gkhy.exam.system.service.impl; |
| | | |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.gkhy.exam.common.api.CommonPage; |
| | | import com.gkhy.exam.common.api.CommonResult; |
| | |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | @Autowired |
| | | private SysDeptMapper sysDeptMapper; |
| | | @Override |
| | | public CommonPage selectInternalAuditCheckList(Integer companyId) { |
| | | public CommonPage selectInternalAuditCheckList(Integer companyId,String year) { |
| | | PageUtils.startPage(); |
| | | List<InternalAuditCheck> internalAuditChecks = internalAuditCheckMapper.selectInternalAuditCheckList(companyId); |
| | | List<InternalAuditCheck> internalAuditChecks = internalAuditCheckMapper.selectInternalAuditCheckList(companyId, year); |
| | | if (!CollectionUtils.isEmpty(internalAuditChecks)) { |
| | | batchLoadCheckDetails(internalAuditChecks); |
| | | } |
| | |
| | | return internalAuditCheckMapper.selectByMap(stringObjectHashMap); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | @Transactional |
| | | public CommonResult copyInternalAuditCheck(Integer companyId, String sourceYear, String targetYear) { |
| | | if (companyId == null) { |
| | | companyId = SecurityUtils.getCompanyId().intValue(); |
| | | } |
| | | |
| | | if (sourceYear == null || sourceYear.trim().isEmpty()) { |
| | | return CommonResult.failed("源年份不能为空"); |
| | | } |
| | | |
| | | if (targetYear == null || targetYear.trim().isEmpty()) { |
| | | return CommonResult.failed("目标年份不能为空"); |
| | | } |
| | | |
| | | LambdaUpdateWrapper<InternalAuditCheck> deleteWrapper = new LambdaUpdateWrapper<>(); |
| | | deleteWrapper.eq(InternalAuditCheck::getCompanyId, companyId) |
| | | .eq(InternalAuditCheck::getYear, targetYear) |
| | | .eq(InternalAuditCheck::getDelFlag, 0) |
| | | .set(InternalAuditCheck::getDelFlag, 2) |
| | | .set(InternalAuditCheck::getUpdateBy, SecurityUtils.getUsername()) |
| | | .set(InternalAuditCheck::getUpdateTime, LocalDateTime.now()); |
| | | internalAuditCheckMapper.update(new InternalAuditCheck(), deleteWrapper); |
| | | |
| | | LambdaQueryWrapper<InternalAuditCheck> queryWrapperSource = new LambdaQueryWrapper<>(); |
| | | queryWrapperSource.eq(InternalAuditCheck::getCompanyId, companyId) |
| | | .eq(InternalAuditCheck::getYear, sourceYear) |
| | | .eq(InternalAuditCheck::getDelFlag, 0); |
| | | List<InternalAuditCheck> sourceChecks = internalAuditCheckMapper.selectList(queryWrapperSource); |
| | | |
| | | if (ObjectUtil.isEmpty(sourceChecks)) { |
| | | return CommonResult.success("源年份无相关数据"); |
| | | } |
| | | |
| | | batchLoadCheckDetails(sourceChecks); |
| | | |
| | | for (InternalAuditCheck sourceCheck : sourceChecks) { |
| | | InternalAuditCheck newCheck = new InternalAuditCheck(); |
| | | newCheck.setCompanyId(sourceCheck.getCompanyId()); |
| | | newCheck.setYear(targetYear); |
| | | newCheck.setDeptId(sourceCheck.getDeptId()); |
| | | newCheck.setPersonId(sourceCheck.getPersonId()); |
| | | newCheck.setCheckTime(sourceCheck.getCheckTime()); |
| | | newCheck.setStartTime(sourceCheck.getStartTime()); |
| | | newCheck.setEndTime(sourceCheck.getEndTime()); |
| | | newCheck.setDelFlag(0); |
| | | newCheck.setCreateBy(SecurityUtils.getUsername()); |
| | | newCheck.setCreateTime(LocalDateTime.now()); |
| | | newCheck.setUpdateBy(SecurityUtils.getUsername()); |
| | | newCheck.setUpdateTime(LocalDateTime.now()); |
| | | |
| | | int insert = internalAuditCheckMapper.insert(newCheck); |
| | | if (insert <= 0) { |
| | | throw new RuntimeException("复制内审检查主表数据失败"); |
| | | } |
| | | |
| | | List<InternalAuditCheckCatalogue> sourceCatalogues = sourceCheck.getCheckCatalogues(); |
| | | if (ObjectUtil.isNotEmpty(sourceCatalogues)) { |
| | | List<InternalAuditCheckCatalogue> newCatalogues = new ArrayList<>(); |
| | | for (InternalAuditCheckCatalogue sourceCatalogue : sourceCatalogues) { |
| | | InternalAuditCheckCatalogue newCatalogue = new InternalAuditCheckCatalogue(); |
| | | newCatalogue.setCheckId(newCheck.getId()); |
| | | newCatalogue.setCatalogueId(sourceCatalogue.getCatalogueId()); |
| | | newCatalogue.setPointKey(sourceCatalogue.getPointKey()); |
| | | newCatalogue.setResult(sourceCatalogue.getResult()); |
| | | newCatalogue.setFind(sourceCatalogue.getFind()); |
| | | newCatalogues.add(newCatalogue); |
| | | } |
| | | checkCatalogueMapper.insertBatch(newCatalogues); |
| | | } |
| | | } |
| | | |
| | | return CommonResult.success("复制成功"); |
| | | } |
| | | |
| | | // @Override |
| | | // public CommonResult internalAuditCheckInfo(Integer id) { |
| | | // InternalAuditCheck internalAuditCheck = internalAuditCheckMapper.selectById(id); |
| | |
| | | package com.gkhy.exam.system.service.impl; |
| | | |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.gkhy.exam.common.api.CommonPage; |
| | |
| | | import com.gkhy.exam.system.service.InternalAuditPlanService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | |
| | | planMapper.updateById(internalAuditPlan); |
| | | return CommonResult.success(); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional |
| | | public CommonResult copyInternalAuditPlan(Integer companyId, String sourceYear, String targetYear) { |
| | | if (companyId == null) { |
| | | companyId = SecurityUtils.getCompanyId().intValue(); |
| | | } |
| | | |
| | | if (sourceYear == null || sourceYear.trim().isEmpty()) { |
| | | return CommonResult.failed("源年份不能为空"); |
| | | } |
| | | |
| | | if (targetYear == null || targetYear.trim().isEmpty()) { |
| | | return CommonResult.failed("目标年份不能为空"); |
| | | } |
| | | |
| | | LambdaUpdateWrapper<InternalAuditPlan> deleteWrapper = new LambdaUpdateWrapper<>(); |
| | | deleteWrapper.eq(InternalAuditPlan::getCompanyId, companyId) |
| | | .eq(InternalAuditPlan::getYear, targetYear) |
| | | .eq(InternalAuditPlan::getDelFlag, 1) |
| | | .set(InternalAuditPlan::getDelFlag, 2) |
| | | .set(InternalAuditPlan::getUpdateBy, SecurityUtils.getUsername()) |
| | | .set(InternalAuditPlan::getUpdateTime, LocalDateTime.now()); |
| | | planMapper.update(new InternalAuditPlan(), deleteWrapper); |
| | | |
| | | LambdaQueryWrapper<InternalAuditPlan> queryWrapperSource = new LambdaQueryWrapper<>(); |
| | | queryWrapperSource.eq(InternalAuditPlan::getCompanyId, companyId) |
| | | .eq(InternalAuditPlan::getYear, sourceYear) |
| | | .eq(InternalAuditPlan::getDelFlag, 1); |
| | | List<InternalAuditPlan> sourcePlans = planMapper.selectList(queryWrapperSource); |
| | | |
| | | if (ObjectUtil.isEmpty(sourcePlans)) { |
| | | return CommonResult.success("源年份无相关数据"); |
| | | } |
| | | |
| | | for (InternalAuditPlan sourcePlan : sourcePlans) { |
| | | InternalAuditPlan newPlan = new InternalAuditPlan(); |
| | | newPlan.setCompanyId(sourcePlan.getCompanyId()); |
| | | newPlan.setYear(targetYear); |
| | | newPlan.setPurpose(sourcePlan.getPurpose()); |
| | | newPlan.setAuditPurpose(sourcePlan.getAuditPurpose()); |
| | | newPlan.setReviewBasis(sourcePlan.getReviewBasis()); |
| | | newPlan.setReviewScope(sourcePlan.getReviewScope()); |
| | | newPlan.setReviewCarry(sourcePlan.getReviewCarry()); |
| | | newPlan.setReviewConstitute(sourcePlan.getReviewConstitute()); |
| | | newPlan.setReviewRequire(sourcePlan.getReviewRequire()); |
| | | newPlan.setCompilationId(sourcePlan.getCompilationId()); |
| | | newPlan.setProofreadId(sourcePlan.getProofreadId()); |
| | | newPlan.setCheckId(sourcePlan.getCheckId()); |
| | | newPlan.setRatifyId(sourcePlan.getRatifyId()); |
| | | newPlan.setDelFlag(1); |
| | | newPlan.setCreateBy(SecurityUtils.getUsername()); |
| | | newPlan.setCreateTime(LocalDateTime.now()); |
| | | |
| | | int insert = planMapper.insert(newPlan); |
| | | if (insert <= 0) { |
| | | throw new RuntimeException("复制内审策划数据失败"); |
| | | } |
| | | } |
| | | |
| | | return CommonResult.success("成功从年份[" + sourceYear + "]复制到年份[" + targetYear + "]"); |
| | | } |
| | | } |
| | |
| | | package com.gkhy.exam.system.service.impl; |
| | | |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.gkhy.exam.common.api.CommonPage; |
| | | import com.gkhy.exam.common.api.CommonResult; |
| | |
| | | import com.gkhy.exam.system.service.ManagementPlanService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | |
| | | } |
| | | return CommonResult.failed(); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional |
| | | public CommonResult copyManagementPlan(Integer companyId, String sourceYear, String targetYear) { |
| | | if (companyId == null) { |
| | | companyId = SecurityUtils.getCompanyId().intValue(); |
| | | } |
| | | |
| | | if (sourceYear == null || sourceYear.trim().isEmpty()) { |
| | | return CommonResult.failed("源年份不能为空"); |
| | | } |
| | | |
| | | if (targetYear == null || targetYear.trim().isEmpty()) { |
| | | return CommonResult.failed("目标年份不能为空"); |
| | | } |
| | | |
| | | LambdaQueryWrapper<ManagementPlan> queryWrapperTarget = new LambdaQueryWrapper<>(); |
| | | queryWrapperTarget.eq(ManagementPlan::getCompanyId, companyId) |
| | | .eq(ManagementPlan::getYear, targetYear) |
| | | .eq(ManagementPlan::getDelFlag, 0); |
| | | List<ManagementPlan> existingPlans = managementPlanMapper.selectList(queryWrapperTarget); |
| | | |
| | | if (ObjectUtil.isNotEmpty(existingPlans)) { |
| | | for (ManagementPlan existingPlan : existingPlans) { |
| | | ManagementPlan deletePlan = new ManagementPlan(); |
| | | deletePlan.setId(existingPlan.getId()); |
| | | deletePlan.setDelFlag(1); |
| | | deletePlan.setUpdateBy(SecurityUtils.getUsername()); |
| | | deletePlan.setUpdateTime(LocalDateTime.now()); |
| | | managementPlanMapper.updateById(deletePlan); |
| | | } |
| | | } |
| | | |
| | | LambdaQueryWrapper<ManagementPlan> queryWrapperSource = new LambdaQueryWrapper<>(); |
| | | queryWrapperSource.eq(ManagementPlan::getCompanyId, companyId) |
| | | .eq(ManagementPlan::getYear, sourceYear) |
| | | .eq(ManagementPlan::getDelFlag, 0); |
| | | List<ManagementPlan> sourcePlans = managementPlanMapper.selectList(queryWrapperSource); |
| | | |
| | | if (ObjectUtil.isEmpty(sourcePlans)) { |
| | | return CommonResult.success("源年份无相关数据"); |
| | | } |
| | | |
| | | for (ManagementPlan sourcePlan : sourcePlans) { |
| | | ManagementPlan newPlan = new ManagementPlan(); |
| | | newPlan.setCompanyId(sourcePlan.getCompanyId()); |
| | | newPlan.setNumber(sourcePlan.getNumber()); |
| | | newPlan.setYear(targetYear); |
| | | newPlan.setFictionId(sourcePlan.getFictionId()); |
| | | newPlan.setFictionName(sourcePlan.getFictionName()); |
| | | newPlan.setFictionTime(sourcePlan.getFictionTime()); |
| | | newPlan.setCheckId(sourcePlan.getCheckId()); |
| | | newPlan.setCheckName(sourcePlan.getCheckName()); |
| | | newPlan.setCheckTime(sourcePlan.getCheckTime()); |
| | | newPlan.setRatifyId(sourcePlan.getRatifyId()); |
| | | newPlan.setRatifyName(sourcePlan.getRatifyName()); |
| | | newPlan.setRatifyTime(sourcePlan.getRatifyTime()); |
| | | newPlan.setContent(sourcePlan.getContent()); |
| | | newPlan.setObjective(sourcePlan.getObjective()); |
| | | newPlan.setLocation(sourcePlan.getLocation()); |
| | | newPlan.setStaff(sourcePlan.getStaff()); |
| | | newPlan.setReport(sourcePlan.getReport()); |
| | | newPlan.setDelFlag(0); |
| | | newPlan.setCreateBy(SecurityUtils.getUsername()); |
| | | newPlan.setCreateTime(LocalDateTime.now()); |
| | | |
| | | int insert = managementPlanMapper.insert(newPlan); |
| | | if (insert <= 0) { |
| | | throw new RuntimeException("复制管理审批计划失败"); |
| | | } |
| | | } |
| | | |
| | | return CommonResult.success("复制成功"); |
| | | } |
| | | |
| | | } |
| | |
| | | package com.gkhy.exam.system.service.impl; |
| | | |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.gkhy.exam.common.api.CommonPage; |
| | | import com.gkhy.exam.common.api.CommonResult; |
| | |
| | | import com.gkhy.exam.system.service.ManagementReviewService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | |
| | | @Autowired |
| | | private ManagementReviewMapper managementReviewMapper; |
| | | @Override |
| | | public CommonPage selectManagementReviewList(Integer companyId, Integer reviewType) { |
| | | public CommonPage selectManagementReviewList(Integer companyId, Integer reviewType,String year) { |
| | | PageUtils.startPage(); |
| | | List<ManagementReview> managementReviews = managementReviewMapper.selectManagementReviewList(companyId,reviewType); |
| | | List<ManagementReview> managementReviews = managementReviewMapper.selectManagementReviewList(companyId,reviewType,year); |
| | | return CommonPage.restPage(managementReviews); |
| | | } |
| | | |
| | |
| | | } |
| | | return CommonResult.failed(); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | @Transactional |
| | | public CommonResult copyManagementReview(Integer companyId, String sourceYear, String targetYear, Integer reviewType) { |
| | | if (companyId == null) { |
| | | companyId = SecurityUtils.getCompanyId().intValue(); |
| | | } |
| | | |
| | | if (sourceYear == null || sourceYear.trim().isEmpty()) { |
| | | return CommonResult.failed("源年份不能为空"); |
| | | } |
| | | |
| | | if (targetYear == null || targetYear.trim().isEmpty()) { |
| | | return CommonResult.failed("目标年份不能为空"); |
| | | } |
| | | |
| | | if (reviewType == null) { |
| | | return CommonResult.failed("评审类型不能为空"); |
| | | } |
| | | |
| | | if (reviewType != 1 && reviewType != 2 && reviewType != 3) { |
| | | return CommonResult.failed("评审类型无效,只能是1会议、2输入、3报告"); |
| | | } |
| | | |
| | | LambdaUpdateWrapper<ManagementReview> deleteWrapper = new LambdaUpdateWrapper<>(); |
| | | deleteWrapper.eq(ManagementReview::getCompanyId, companyId) |
| | | .eq(ManagementReview::getYear, targetYear) |
| | | .eq(ManagementReview::getReviewType, reviewType) |
| | | .eq(ManagementReview::getDelFlag, 0) |
| | | .set(ManagementReview::getDelFlag, 1) |
| | | .set(ManagementReview::getUpdateBy, SecurityUtils.getUsername()) |
| | | .set(ManagementReview::getUpdateTime, LocalDateTime.now()); |
| | | managementReviewMapper.update(new ManagementReview(), deleteWrapper); |
| | | |
| | | LambdaQueryWrapper<ManagementReview> queryWrapperSource = new LambdaQueryWrapper<>(); |
| | | queryWrapperSource.eq(ManagementReview::getCompanyId, companyId) |
| | | .eq(ManagementReview::getYear, sourceYear) |
| | | .eq(ManagementReview::getReviewType, reviewType) |
| | | .eq(ManagementReview::getDelFlag, 0); |
| | | List<ManagementReview> sourceReviews = managementReviewMapper.selectList(queryWrapperSource); |
| | | |
| | | if (ObjectUtil.isEmpty(sourceReviews)) { |
| | | return CommonResult.success("源年份无相关数据"); |
| | | } |
| | | |
| | | for (ManagementReview sourceReview : sourceReviews) { |
| | | ManagementReview newReview = new ManagementReview(); |
| | | newReview.setCompanyId(sourceReview.getCompanyId()); |
| | | newReview.setCompanyName(sourceReview.getCompanyName()); |
| | | newReview.setReviewName(sourceReview.getReviewName()); |
| | | newReview.setReviewType(sourceReview.getReviewType()); |
| | | newReview.setFilePath(sourceReview.getFilePath()); |
| | | newReview.setFormat(sourceReview.getFormat()); |
| | | newReview.setYear(targetYear); |
| | | newReview.setDelFlag(0); |
| | | newReview.setCreateBy(SecurityUtils.getUsername()); |
| | | newReview.setCreateTime(LocalDateTime.now()); |
| | | |
| | | int insert = managementReviewMapper.insert(newReview); |
| | | if (insert <= 0) { |
| | | throw new RuntimeException("复制管理评审数据失败"); |
| | | } |
| | | } |
| | | |
| | | return CommonResult.success("成功从年份[" + sourceYear + "]复制到年份[" + targetYear + "]"); |
| | | } |
| | | |
| | | } |
| | |
| | | <id property="id" column="course_id" /> |
| | | <result property="name" column="course_name" /> |
| | | <result property="logo" column="course_logo" /> |
| | | <result property="stopTime" column="stop_time" /> |
| | | <association property="period" javaType="java.lang.Long" select="getCoursePeriod" column="{courseId=course_id}"/> |
| | | </resultMap> |
| | | |
| | |
| | | </select> |
| | | |
| | | <select id="selectPhaseStudentList" resultMap="ExPhaseStudentResult"> |
| | | select a.*,b.phone as student_phone,b.name as student_name,c.name as phase_name,e.name as create_name,d.id as course_id,d.logo as course_logo,d.name as course_name from ex_phase_student a |
| | | select a.*,b.phone as student_phone,b.name as student_name,c.name as phase_name,e.name as create_name,d.id as course_id,d.logo as course_logo,d.name as course_name,d.stop_time from ex_phase_student a |
| | | left join ex_student b on a.student_id=b.id |
| | | left join ex_course_phase c on c.id=a.phase_id |
| | | left join ex_course d on d.id=c.course_id |
| | |
| | | <if test="companyId!=null and companyId!=''"> |
| | | and iac.company_id = #{companyId} |
| | | </if> |
| | | <if test="year!=null and year!=''"> |
| | | and iac.year = #{year} |
| | | </if> |
| | | ORDER BY iac.create_time ASC |
| | | </select> |
| | | <select id="selectCarryDeptList" resultType="com.gkhy.exam.system.domain.InternalAuditCarryDept"> |
| | |
| | | <if test="companyId!=null"> |
| | | and iac.company_id = #{companyId} |
| | | </if> |
| | | <if test="year!=null and year!=''"> |
| | | and iac.year = #{year} |
| | | </if> |
| | | GROUP BY iac.`id` |
| | | ORDER BY |
| | | iac.create_time DESC |
| | |
| | | <if test="companyId!=null and companyId!=''"> |
| | | and iap.company_id = #{companyId} |
| | | </if> |
| | | <if test="year!=null and year!=''"> |
| | | and iap.year = #{year} |
| | | </if> |
| | | ORDER BY create_time ASC |
| | | </select> |
| | | </mapper> |
| | |
| | | <if test="companyId != null"> |
| | | and company_id = #{companyId} |
| | | </if> |
| | | <if test="year != null and year !=''"> |
| | | and year = #{year} |
| | | </if> |
| | | order by create_time desc |
| | | </select> |
| | | </mapper> |