heheng
2025-06-13 22deede4b5f167f8ef40333e8cc46ce94bceee97
部分功能调整
已修改3个文件
已添加6个文件
212 ■■■■■ 文件已修改
multi-admin/src/main/java/com/gkhy/exam/admin/controller/system/InformationPlatformController.java 50 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
multi-admin/src/main/java/com/gkhy/exam/admin/controller/system/SysClauseManagementController.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
multi-system/src/main/java/com/gkhy/exam/system/domain/InformationPlatform.java 37 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
multi-system/src/main/java/com/gkhy/exam/system/domain/SysClauseManagement.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
multi-system/src/main/java/com/gkhy/exam/system/domain/SysDeptResponsibility.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
multi-system/src/main/java/com/gkhy/exam/system/mapper/InformationPlatformMapper.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
multi-system/src/main/java/com/gkhy/exam/system/service/InformationPlatformService.java 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
multi-system/src/main/java/com/gkhy/exam/system/service/impl/InformationPlatformServiceImpl.java 65 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
multi-system/src/main/resources/mapper/system/informationPlatformMapper.xml 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
multi-admin/src/main/java/com/gkhy/exam/admin/controller/system/InformationPlatformController.java
对比新文件
@@ -0,0 +1,50 @@
package com.gkhy.exam.admin.controller.system;
import com.gkhy.exam.common.annotation.RepeatSubmit;
import com.gkhy.exam.common.api.CommonResult;
import com.gkhy.exam.system.domain.InformationPlatform;
import com.gkhy.exam.system.domain.SysClauseManagement;
import com.gkhy.exam.system.service.InformationPlatformService;
import com.gkhy.exam.system.service.SysClauseManagementService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
@Api(tags = "建设平台接口前端控制器")
@RestController
@RequestMapping("/system/informationPlatform")
public class InformationPlatformController {
    @Autowired
    private InformationPlatformService informationPlatformService;
    @RepeatSubmit
    @ApiOperation(value = "新增编辑建设平台")
    @PostMapping("/saveInformationPlatform")
    public CommonResult saveInformationPlatform(@RequestBody @Validated InformationPlatform informationPlatform){
        return CommonResult.success(informationPlatformService.saveInformationPlatform(informationPlatform));
    }
    @ApiOperation(value = "获取建设平台")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "companyId", dataType = "long", required = false, value = "companyId"),
    })
    @GetMapping("/getInformationPlatforms")
    public CommonResult getInformationPlatforms(@RequestParam(value = "companyId",required = false) Long companyId){
        return CommonResult.success(informationPlatformService.getInformationPlatforms(companyId));
    }
    @ApiOperation(value = "删除建设平台")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "id", dataType = "long", required = true, value = "id"),
    })
    @GetMapping("/delInformationPlatform")
    public CommonResult delInformationPlatform(@RequestParam(value = "id",required = true) Long id) {
        return CommonResult.success(informationPlatformService.delInformationPlatform(id));
    }
}
multi-admin/src/main/java/com/gkhy/exam/admin/controller/system/SysClauseManagementController.java
@@ -35,9 +35,9 @@
    @ApiOperation(value = "删除条款")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "body", name = "id", dataType = "long", required = true, value = "id"),
            @ApiImplicitParam(paramType = "query", name = "id", dataType = "long", required = true, value = "id"),
    })
    @PostMapping("/delSysClauseManagement")
    @GetMapping("/delSysClauseManagement")
    public CommonResult delSysClauseManagement(@RequestParam(value = "id",required = true) Long id) {
        return CommonResult.success(sysClauseManagementService.delSysClauseManagement(id));
    }
multi-system/src/main/java/com/gkhy/exam/system/domain/InformationPlatform.java
对比新文件
@@ -0,0 +1,37 @@
package com.gkhy.exam.system.domain;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.gkhy.exam.common.domain.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;
@ApiModel(value = "平台建设对象")
@Data
public class InformationPlatform extends BaseEntity {
    @ApiModelProperty("Id")
    private Long id;
    @ApiModelProperty("公司id")
    @NotNull
    private Long companyId;
    @ApiModelProperty("名称")
    @NotBlank(message = "名称不能为空")
    private String platformName;
    @ApiModelProperty("建设时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime buildDate;
    /** 删除标志(0代表存在 2代表删除) */
    private String delFlag;
}
multi-system/src/main/java/com/gkhy/exam/system/domain/SysClauseManagement.java
@@ -10,7 +10,7 @@
@ApiModel(value = "条款对象")
@Data
public class SysClauseManagement extends BaseEntity {
    @ApiModelProperty("部门Id")
    @ApiModelProperty("Id")
    private Long id;
    @ApiModelProperty("排序")
multi-system/src/main/java/com/gkhy/exam/system/domain/SysDeptResponsibility.java
@@ -8,6 +8,7 @@
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
@ApiModel(value = "部门-部门职责对象")
@Data
@@ -19,11 +20,11 @@
    private Long id;
    @ApiModelProperty("部门ID")
    @NonNull
    @NotNull
    private Long deptId;
    @ApiModelProperty("公司id")
    @NonNull
    @NotNull
    private Long companyId;
    @ApiModelProperty("条款id")
multi-system/src/main/java/com/gkhy/exam/system/mapper/InformationPlatformMapper.java
对比新文件
@@ -0,0 +1,14 @@
package com.gkhy.exam.system.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.gkhy.exam.system.domain.InformationPlatform;
/**
 * 部门管理 数据层
 *
 * @author expert
 */
public interface InformationPlatformMapper extends BaseMapper<InformationPlatform> {
}
multi-system/src/main/java/com/gkhy/exam/system/service/InformationPlatformService.java
对比新文件
@@ -0,0 +1,15 @@
package com.gkhy.exam.system.service;
import com.gkhy.exam.system.domain.InformationPlatform;
import com.gkhy.exam.system.domain.SysClauseManagement;
import java.util.List;
public interface InformationPlatformService {
    List<InformationPlatform> getInformationPlatforms(Long companyId);
    int saveInformationPlatform(InformationPlatform informationPlatform);
    int delInformationPlatform(Long id);
}
multi-system/src/main/java/com/gkhy/exam/system/service/impl/InformationPlatformServiceImpl.java
对比新文件
@@ -0,0 +1,65 @@
package com.gkhy.exam.system.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gkhy.exam.common.constant.UserConstant;
import com.gkhy.exam.common.exception.ApiException;
import com.gkhy.exam.common.utils.SecurityUtils;
import com.gkhy.exam.system.domain.InformationPlatform;
import com.gkhy.exam.system.mapper.InformationPlatformMapper;
import com.gkhy.exam.system.service.InformationPlatformService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.time.LocalDateTime;
import java.util.Collections;
import java.util.List;
/**
 * @author Administrator
 */
@Service
public class InformationPlatformServiceImpl extends ServiceImpl<InformationPlatformMapper, InformationPlatform> implements InformationPlatformService {
    @Autowired
    private InformationPlatformMapper informationPlatformMapper;
    @Override
    public List<InformationPlatform> getInformationPlatforms(Long companyId) {
        if (companyId == null) {
            companyId = SecurityUtils.getLoginUser().getUser().getCompanyId();
        }
        LambdaQueryWrapper<InformationPlatform> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(InformationPlatform::getCompanyId, companyId);
        queryWrapper.eq(InformationPlatform::getDelFlag, UserConstant.ENABLE);
        queryWrapper.orderByDesc(InformationPlatform::getCreateTime);
        return informationPlatformMapper.selectList(queryWrapper);
    }
    @Override
    public int saveInformationPlatform(InformationPlatform informationPlatform) {
        Long companyId = informationPlatform.getCompanyId();
        if (!companyId.equals(SecurityUtils.getLoginUser().getUser().getCompanyId())){
            throw new ApiException("无权操作!");
        }
        if (informationPlatform.getId() != null){
            informationPlatform.setUpdateTime(LocalDateTime.now());
            informationPlatform.setUpdateBy(SecurityUtils.getUsername());
            return informationPlatformMapper.updateById(informationPlatform);
        }else {
            informationPlatform.setCreateTime(LocalDateTime.now());
            informationPlatform.setCreateBy(SecurityUtils.getUsername());
            return informationPlatformMapper.insert(informationPlatform);
        }
    }
    @Override
    public int delInformationPlatform(Long id) {
        InformationPlatform informationPlatform = new InformationPlatform();
        informationPlatform.setDelFlag(UserConstant.DISENABLE.toString());
        return informationPlatformMapper.update(informationPlatform,new LambdaQueryWrapper<InformationPlatform>().eq(InformationPlatform::getId, id));
    }
}
multi-system/src/main/resources/mapper/system/informationPlatformMapper.xml
对比新文件
@@ -0,0 +1,20 @@
<?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">
<mapper namespace="com.gkhy.exam.system.mapper.InformationPlatformMapper">
    <resultMap type="com.gkhy.exam.system.domain.InformationPlatform" id="InformationPlatformResult">
        <id     property="id"     column="id"     />
        <result property="companyId"  column="company_id"   />
        <result property="platformName"   column="platform_name"   />
        <result property="buildDate"    column="build_date"    />
        <result property="delFlag"    column="del_flag"    />
        <result property="createBy"   column="create_by"   />
        <result property="createTime" column="create_time" />
        <result property="updateBy"   column="update_by"   />
        <result property="updateTime" column="update_time" />
    </resultMap>
</mapper>