New file |
| | |
| | | package com.ruoyi.web.controller.oa; |
| | | |
| | | import java.util.List; |
| | | import java.util.Arrays; |
| | | import java.util.concurrent.TimeUnit; |
| | | |
| | | import lombok.RequiredArgsConstructor; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import javax.validation.constraints.*; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import com.ruoyi.common.annotation.RepeatSubmit; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.validate.AddGroup; |
| | | import com.ruoyi.common.core.validate.EditGroup; |
| | | import com.ruoyi.common.core.validate.QueryGroup; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.oa.domain.vo.BsRulesVo; |
| | | import com.ruoyi.oa.domain.bo.BsRulesBo; |
| | | import com.ruoyi.oa.service.IBsRulesService; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiParam; |
| | | import io.swagger.annotations.ApiOperation; |
| | | |
| | | /** |
| | | * 规章制度Controller |
| | | * |
| | | * @author ruoyi |
| | | * @date 2022-07-03 |
| | | */ |
| | | @Validated |
| | | @Api(value = "规章制度控制器", tags = {"规章制度管理"}) |
| | | @RequiredArgsConstructor(onConstructor_ = @Autowired) |
| | | @RestController |
| | | @RequestMapping("/oa/rules") |
| | | public class BsRulesController extends BaseController { |
| | | |
| | | private final IBsRulesService iBsRulesService; |
| | | |
| | | /** |
| | | * 查询规章制度列表 |
| | | */ |
| | | @ApiOperation("查询规章制度列表") |
| | | // @PreAuthorize("@ss.hasPermi('oa:rules:list')") |
| | | @GetMapping("/list") |
| | | public TableDataInfo<BsRulesVo> list(@Validated(QueryGroup.class) BsRulesBo bo) { |
| | | return iBsRulesService.queryPageList(bo); |
| | | } |
| | | |
| | | /** |
| | | * 导出规章制度列表 |
| | | */ |
| | | @ApiOperation("导出规章制度列表") |
| | | @PreAuthorize("@ss.hasPermi('oa:rules:export')") |
| | | @Log(title = "规章制度", businessType = BusinessType.EXPORT) |
| | | @GetMapping("/export") |
| | | public void export(@Validated BsRulesBo bo, HttpServletResponse response) { |
| | | List<BsRulesVo> list = iBsRulesService.queryList(bo); |
| | | ExcelUtil.exportExcel(list, "规章制度", BsRulesVo.class, response); |
| | | } |
| | | |
| | | /** |
| | | * 获取规章制度详细信息 |
| | | */ |
| | | @ApiOperation("获取规章制度详细信息") |
| | | // @PreAuthorize("@ss.hasPermi('oa:rules:query')") |
| | | @GetMapping("/{id}") |
| | | public AjaxResult<BsRulesVo> getInfo(@ApiParam("主键") |
| | | @NotNull(message = "主键不能为空") |
| | | @PathVariable("id") Long id) { |
| | | return AjaxResult.success(iBsRulesService.queryById(id)); |
| | | } |
| | | |
| | | /** |
| | | * 新增规章制度 |
| | | */ |
| | | @ApiOperation("新增规章制度") |
| | | // @PreAuthorize("@ss.hasPermi('oa:rules:add')") |
| | | @Log(title = "规章制度", businessType = BusinessType.INSERT) |
| | | @RepeatSubmit() |
| | | @PostMapping() |
| | | public AjaxResult<Void> add(@Validated(AddGroup.class) @RequestBody BsRulesBo bo) { |
| | | return toAjax(iBsRulesService.insertByBo(bo) ? 1 : 0); |
| | | } |
| | | |
| | | /** |
| | | * 修改规章制度 |
| | | */ |
| | | @ApiOperation("修改规章制度") |
| | | // @PreAuthorize("@ss.hasPermi('oa:rules:edit')") |
| | | @Log(title = "规章制度", businessType = BusinessType.UPDATE) |
| | | @RepeatSubmit() |
| | | @PutMapping() |
| | | public AjaxResult<Void> edit(@Validated(EditGroup.class) @RequestBody BsRulesBo bo) { |
| | | return toAjax(iBsRulesService.updateByBo(bo) ? 1 : 0); |
| | | } |
| | | |
| | | /** |
| | | * 删除规章制度 |
| | | */ |
| | | @ApiOperation("删除规章制度") |
| | | // @PreAuthorize("@ss.hasPermi('oa:rules:remove')") |
| | | @Log(title = "规章制度" , businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{ids}") |
| | | public AjaxResult<Void> remove(@ApiParam("主键串") |
| | | @NotEmpty(message = "主键不能为空") |
| | | @PathVariable Long[] ids) { |
| | | return toAjax(iBsRulesService.deleteWithValidByIds(Arrays.asList(ids), true) ? 1 : 0); |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | /** |
| | | * 获取ipc设备详细信息 |
| | | * 获取上一条信息 |
| | | */ |
| | | @ApiOperation("获取ipc设备详细信息") |
| | | @ApiOperation("获取上一条信息") |
| | | @GetMapping("/copy") |
| | | public AjaxResult copy() { |
| | | List<SgIpc> list = iSgIpcService.list(new LambdaQueryWrapper<SgIpc>().orderByDesc(SgIpc::getUpdateTime)); |
| | | List<SgIpc> list = iSgIpcService.list(new LambdaQueryWrapper<SgIpc>().orderByDesc(SgIpc::getCreateTime)); |
| | | if (list.size() == 0) { |
| | | throw new ServiceException("暂无数据", HttpStatus.HTTP_PARTIAL); |
| | | } |
| | |
| | | # 主库数据源 |
| | | master: |
| | | driverClassName: com.mysql.cj.jdbc.Driver |
| | | url: jdbc:mysql://101.35.174.42:3308/ytsl_oa?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true |
| | | url: jdbc:mysql://localhost:3307/ytsl_oa?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true |
| | | username: root |
| | | password: oa1234.. |
| | | password: Yuntsl@0815 |
| | | # 从库数据源 |
| | | slave: |
| | | lazy: true |
| | |
| | | spring: |
| | | redis: |
| | | # 地址 |
| | | host: 101.35.174.42 |
| | | host: localhost |
| | | # 端口,默认为6379 |
| | | port: 6378 |
| | | # 数据库索引 |
| | | database: 0 |
| | | # 密码 |
| | | password: oa123456.. |
| | | password: |
| | | # 连接超时时间 |
| | | timeout: 10s |
| | | # 是否开启ssl |
New file |
| | |
| | | package com.ruoyi.oa.domain; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | import lombok.experimental.Accessors; |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | import java.math.BigDecimal; |
| | | |
| | | import com.ruoyi.common.core.domain.BaseEntity; |
| | | |
| | | /** |
| | | * 规章制度对象 bs_rules |
| | | * |
| | | * @author ruoyi |
| | | * @date 2022-07-03 |
| | | */ |
| | | @Data |
| | | @Accessors(chain = true) |
| | | @TableName("bs_rules") |
| | | public class BsRules extends BaseEntity { |
| | | |
| | | private static final long serialVersionUID=1L; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | @TableId(value = "id") |
| | | private Long id; |
| | | /** |
| | | * 规章制度 |
| | | */ |
| | | private String rules; |
| | | /** |
| | | * 发布版本 |
| | | */ |
| | | private String versionCode; |
| | | /** |
| | | * 修订日期 |
| | | */ |
| | | private String reviseTime; |
| | | /** |
| | | * 附件 |
| | | */ |
| | | private String fileUrl; |
| | | /** |
| | | * 删除标识 |
| | | */ |
| | | @TableLogic |
| | | private String delFlag; |
| | | |
| | | } |
| | |
| | | */ |
| | | private String contactAddress; |
| | | /** |
| | | * |
| | | * |
| | | */ |
| | | @Version |
| | | private Integer version; |
| | | /** |
| | | * 联系人 |
| | | */ |
| | | private String contactBy; |
| | | |
| | | /** |
| | | * 备注 |
| | | */ |
| | | private String remarks; |
| | | } |
| | |
| | | /** |
| | | * LAN2 |
| | | */ |
| | | @TableField(updateStrategy = FieldStrategy.IGNORED) |
| | | private String lanTwo; |
| | | /** |
| | | * IP2 |
| | | */ |
| | | @TableField(updateStrategy = FieldStrategy.IGNORED) |
| | | private String ipTwo; |
| | | /** |
| | | * 登录账户 |
| | | */ |
| | | @TableField(updateStrategy = FieldStrategy.IGNORED) |
| | | private String loginAccount; |
| | | /** |
| | | * 安装位置 |
| | |
| | | /** |
| | | * 序列号 |
| | | */ |
| | | @TableField(updateStrategy = FieldStrategy.IGNORED) |
| | | private String serialNumber; |
| | | /** |
| | | * 型号 |
| | | */ |
| | | @TableField(updateStrategy = FieldStrategy.IGNORED) |
| | | private String model; |
| | | /** |
| | | * 生产厂商 |
| | | */ |
| | | @TableField(updateStrategy = FieldStrategy.IGNORED) |
| | | private Long manufacturerId; |
| | | /** |
| | | * |
| | |
| | | /** |
| | | * 详细地址 |
| | | */ |
| | | @TableField(updateStrategy = FieldStrategy.IGNORED) |
| | | private String address; |
| | | /** |
| | | * 所属单位 |
| | |
| | | /** |
| | | * 序列号 |
| | | */ |
| | | @TableField(updateStrategy = FieldStrategy.IGNORED) |
| | | private String serialNumber; |
| | | /** |
| | | * 型号 |
| | | */ |
| | | @TableField(updateStrategy = FieldStrategy.IGNORED) |
| | | private String model; |
| | | /** |
| | | * 生产厂商 |
| | | */ |
| | | @TableField(updateStrategy = FieldStrategy.IGNORED) |
| | | private Long manufacturerId; |
| | | /** |
| | | * 附件 |
| | |
| | | /** |
| | | * 序列号 |
| | | */ |
| | | @TableField(updateStrategy = FieldStrategy.IGNORED) |
| | | private String serialNumber; |
| | | /** |
| | | * 型号 |
| | | */ |
| | | @TableField(updateStrategy = FieldStrategy.IGNORED) |
| | | private String model; |
| | | /** |
| | | * 生产厂商 |
| | | */ |
| | | @TableField(updateStrategy = FieldStrategy.IGNORED) |
| | | private Long manufacturerId; |
| | | /** |
| | | * 监控对象 |
| | | */ |
| | | @TableField(updateStrategy = FieldStrategy.IGNORED) |
| | | private String monitorObject; |
| | | /** |
| | | * 通道1 |
| | | */ |
| | | @TableField(updateStrategy = FieldStrategy.IGNORED) |
| | | private Long passagewayOne; |
| | | /** |
| | | * 通道2 |
| | | */ |
| | | @TableField(updateStrategy = FieldStrategy.IGNORED) |
| | | private Long passagewayTwo; |
| | | /** |
| | | * 通道3 |
| | | */ |
| | | @TableField(updateStrategy = FieldStrategy.IGNORED) |
| | | private Long passagewayThree; |
| | | /** |
| | | * 通道4 |
| | | */ |
| | | @TableField(updateStrategy = FieldStrategy.IGNORED) |
| | | private Long passagewayFour; |
| | | /** |
| | | * |
| | |
| | | /** |
| | | * nvr |
| | | */ |
| | | @TableField(updateStrategy = FieldStrategy.IGNORED) |
| | | private Long nvrId; |
| | | /** |
| | | * 通道 |
| | | */ |
| | | @TableField(updateStrategy = FieldStrategy.IGNORED) |
| | | private String passageway; |
| | | /** |
| | | * 安装位置 |
| | |
| | | /** |
| | | * 序列号 |
| | | */ |
| | | @TableField(updateStrategy = FieldStrategy.IGNORED) |
| | | private String serialNumber; |
| | | /** |
| | | * 型号 |
| | | */ |
| | | @TableField(updateStrategy = FieldStrategy.IGNORED) |
| | | private String model; |
| | | /** |
| | | * 生产厂商 |
| | | */ |
| | | @TableField(updateStrategy = FieldStrategy.IGNORED) |
| | | private Long manufacturerId; |
| | | /** |
| | | * |
| | |
| | | /** |
| | | * LAN1 |
| | | */ |
| | | @TableField(updateStrategy = FieldStrategy.IGNORED) |
| | | private String lanOne; |
| | | /** |
| | | * ip1 |
| | | */ |
| | | @TableField(updateStrategy = FieldStrategy.IGNORED) |
| | | private String ipOne; |
| | | /** |
| | | * LAN2 |
| | |
| | | /** |
| | | * 序列号 |
| | | */ |
| | | @TableField(updateStrategy = FieldStrategy.IGNORED) |
| | | private String serialNumber; |
| | | /** |
| | | * 型号 |
| | | */ |
| | | @TableField(updateStrategy = FieldStrategy.IGNORED) |
| | | private String model; |
| | | /** |
| | | * 生产厂商 |
| | | */ |
| | | @TableField(updateStrategy = FieldStrategy.IGNORED) |
| | | private Long manufacturerId; |
| | | /** |
| | | * 附件 |
| | |
| | | private static final long serialVersionUID=1L; |
| | | |
| | | /** |
| | | * |
| | | * |
| | | */ |
| | | @TableId(value = "id") |
| | | private Long id; |
| | |
| | | /** |
| | | * 机柜号 |
| | | */ |
| | | @TableField(updateStrategy = FieldStrategy.IGNORED) |
| | | private String cabinetNumber; |
| | | /** |
| | | * 机架号 |
| | | */ |
| | | @TableField(updateStrategy = FieldStrategy.IGNORED) |
| | | private String rackNumber; |
| | | /** |
| | | * 所属单位 |
| | |
| | | /** |
| | | * 序列号 |
| | | */ |
| | | @TableField(updateStrategy = FieldStrategy.IGNORED) |
| | | private String serialNumber; |
| | | /** |
| | | * 型号 |
| | | */ |
| | | @TableField(updateStrategy = FieldStrategy.IGNORED) |
| | | private String model; |
| | | /** |
| | | * 生产厂商 |
| | | */ |
| | | @TableField(updateStrategy = FieldStrategy.IGNORED) |
| | | private Long manufacturerId; |
| | | /** |
| | | * 性能指标 |
| | | */ |
| | | @TableField(updateStrategy = FieldStrategy.IGNORED) |
| | | private String performanceIndex; |
| | | /** |
| | | * 备注 |
| | | */ |
| | | @TableField(updateStrategy = FieldStrategy.IGNORED) |
| | | private String remarks; |
| | | /** |
| | | * 附件 |
| | | */ |
| | | private String filePath; |
| | | /** |
| | | * |
| | | * |
| | | */ |
| | | @TableLogic |
| | | private String delFlag; |
| | |
| | | package com.ruoyi.oa.domain; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | import lombok.experimental.Accessors; |
| | |
| | | private static final long serialVersionUID=1L; |
| | | |
| | | /** |
| | | * |
| | | * |
| | | */ |
| | | @TableId(value = "id") |
| | | private Long id; |
| | |
| | | /** |
| | | * 生产厂商 |
| | | */ |
| | | @TableField(updateStrategy = FieldStrategy.IGNORED) |
| | | private Long manufacturerId; |
| | | /** |
| | | * 备注 |
| | | */ |
| | | @TableField(updateStrategy = FieldStrategy.IGNORED) |
| | | private String remarks; |
| | | /** |
| | | * 附件 |
| | | */ |
| | | private String filePath; |
| | | /** |
| | | * |
| | | * |
| | | */ |
| | | @TableLogic |
| | | private String delFlag; |
| | | |
| | | @ApiModelProperty(value = "账户") |
| | | private String account; |
| | | |
| | | @ApiModelProperty(value = "访问地址") |
| | | private String address; |
| | | } |
New file |
| | |
| | | package com.ruoyi.oa.domain.bo; |
| | | |
| | | import com.ruoyi.common.core.validate.AddGroup; |
| | | import com.ruoyi.common.core.validate.EditGroup; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import javax.validation.constraints.*; |
| | | |
| | | import java.util.Date; |
| | | |
| | | import com.ruoyi.common.core.domain.BaseEntity; |
| | | |
| | | /** |
| | | * 规章制度业务对象 bs_rules |
| | | * |
| | | * @author ruoyi |
| | | * @date 2022-07-03 |
| | | */ |
| | | |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @ApiModel("规章制度业务对象") |
| | | public class BsRulesBo extends BaseEntity { |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | @ApiModelProperty(value = "", required = true) |
| | | @NotNull(message = "不能为空", groups = { EditGroup.class }) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 规章制度 |
| | | */ |
| | | @ApiModelProperty(value = "规章制度", required = true) |
| | | @NotBlank(message = "规章制度不能为空", groups = { AddGroup.class, EditGroup.class }) |
| | | private String rules; |
| | | |
| | | /** |
| | | * 发布版本 |
| | | */ |
| | | @ApiModelProperty(value = "发布版本", required = true) |
| | | @NotBlank(message = "发布版本不能为空", groups = { AddGroup.class, EditGroup.class }) |
| | | private String versionCode; |
| | | |
| | | /** |
| | | * 修订日期 |
| | | */ |
| | | @ApiModelProperty(value = "修订日期", required = true) |
| | | @NotBlank(message = "修订日期不能为空", groups = { AddGroup.class, EditGroup.class }) |
| | | private String reviseTime; |
| | | |
| | | /** |
| | | * 附件 |
| | | */ |
| | | @ApiModelProperty(value = "附件") |
| | | private String fileUrl; |
| | | |
| | | |
| | | /** |
| | | * 分页大小 |
| | | */ |
| | | @ApiModelProperty("分页大小") |
| | | private Integer pageSize; |
| | | |
| | | /** |
| | | * 当前页数 |
| | | */ |
| | | @ApiModelProperty("当前页数") |
| | | private Integer pageNum; |
| | | |
| | | /** |
| | | * 排序列 |
| | | */ |
| | | @ApiModelProperty("排序列") |
| | | private String orderByColumn; |
| | | |
| | | /** |
| | | * 排序的方向desc或者asc |
| | | */ |
| | | @ApiModelProperty(value = "排序的方向", example = "asc,desc") |
| | | private String isAsc; |
| | | |
| | | } |
| | |
| | | */ |
| | | @ApiModelProperty(value = "联系地址") |
| | | private String contactAddress; |
| | | /** |
| | | * 联系人 |
| | | */ |
| | | private String contactBy; |
| | | |
| | | /** |
| | | * 备注 |
| | | */ |
| | | private String remarks; |
| | | |
| | | |
| | | /** |
| | |
| | | package com.ruoyi.oa.domain.bo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.FieldStrategy; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.ruoyi.common.core.validate.AddGroup; |
| | | import com.ruoyi.common.core.validate.EditGroup; |
| | | import io.swagger.annotations.ApiModel; |
| | |
| | | * LAN1 |
| | | */ |
| | | @ApiModelProperty(value = "LAN1", required = true) |
| | | @NotBlank(message = "LAN1不能为空", groups = { AddGroup.class, EditGroup.class }) |
| | | private String lanOne; |
| | | |
| | | /** |
| | | * ip1 |
| | | */ |
| | | @ApiModelProperty(value = "ip1", required = true) |
| | | @NotBlank(message = "IP1不能为空", groups = { AddGroup.class, EditGroup.class }) |
| | | private String ipOne; |
| | | |
| | | /** |
| | |
| | | * MAC地址 |
| | | */ |
| | | @ApiModelProperty(value = "MAC地址", required = true) |
| | | @NotBlank(message = "MAC地址不能为空", groups = { AddGroup.class, EditGroup.class }) |
| | | private String mac; |
| | | |
| | | /** |
| | |
| | | public class SgSystemBo extends BaseEntity { |
| | | |
| | | /** |
| | | * |
| | | * |
| | | */ |
| | | @ApiModelProperty(value = "", required = true) |
| | | @NotNull(message = "不能为空", groups = { EditGroup.class }) |
| | |
| | | @ApiModelProperty(value = "附件") |
| | | private String filePath; |
| | | |
| | | @ApiModelProperty(value = "账户") |
| | | private String account; |
| | | |
| | | @ApiModelProperty(value = "访问地址") |
| | | private String address; |
| | | |
| | | |
| | | /** |
| | | * 分页大小 |
New file |
| | |
| | | package com.ruoyi.oa.domain.vo; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import com.ruoyi.common.annotation.ExcelDictFormat; |
| | | import com.ruoyi.common.convert.ExcelDictConvert; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import java.util.Date; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 规章制度视图对象 bs_rules |
| | | * |
| | | * @author ruoyi |
| | | * @date 2022-07-03 |
| | | */ |
| | | @Data |
| | | @ApiModel("规章制度视图对象") |
| | | @ExcelIgnoreUnannotated |
| | | public class BsRulesVo { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | @ExcelProperty(value = "") |
| | | @ApiModelProperty("") |
| | | private Long id; |
| | | |
| | | /** |
| | | * 规章制度 |
| | | */ |
| | | @ExcelProperty(value = "规章制度") |
| | | @ApiModelProperty("规章制度") |
| | | private String rules; |
| | | |
| | | /** |
| | | * 发布版本 |
| | | */ |
| | | @ExcelProperty(value = "发布版本") |
| | | @ApiModelProperty("发布版本") |
| | | private String versionCode; |
| | | |
| | | /** |
| | | * 修订日期 |
| | | */ |
| | | @ExcelProperty(value = "修订日期") |
| | | @ApiModelProperty("修订日期") |
| | | private String reviseTime; |
| | | |
| | | /** |
| | | * 附件 |
| | | */ |
| | | @ExcelProperty(value = "附件") |
| | | @ApiModelProperty("附件") |
| | | private String fileUrl; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @ExcelProperty(value = "创建时间") |
| | | @ApiModelProperty("创建时间") |
| | | private Date createTime; |
| | | |
| | | |
| | | } |
| | |
| | | @ApiModelProperty("联系地址") |
| | | private String contactAddress; |
| | | |
| | | /** |
| | | * 联系人 |
| | | */ |
| | | private String contactBy; |
| | | |
| | | /** |
| | | * 备注 |
| | | */ |
| | | private String remarks; |
| | | } |
| | |
| | | */ |
| | | @ExcelProperty(value = "开始日期") |
| | | @ApiModelProperty("开始日期") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd") |
| | | @JsonFormat(pattern="yyyy-MM-dd") |
| | | private Date startDate; |
| | | |
| | | /** |
| | |
| | | */ |
| | | @ExcelProperty(value = "结束日期") |
| | | @ApiModelProperty("结束日期") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd") |
| | | @JsonFormat(pattern="yyyy-MM-dd") |
| | | private Date endDate; |
| | | |
| | | /** |
| | |
| | | */ |
| | | @ExcelProperty(value = "通道") |
| | | @ApiModelProperty("通道") |
| | | @Dict(dicCode = "DICT109") |
| | | private String passageway; |
| | | |
| | | /** |
| | |
| | | @ApiModelProperty("附件") |
| | | private String filePath; |
| | | |
| | | @ApiModelProperty(value = "账户") |
| | | private String account; |
| | | |
| | | @ApiModelProperty(value = "访问地址") |
| | | private String address; |
| | | } |
New file |
| | |
| | | package com.ruoyi.oa.mapper; |
| | | |
| | | import com.ruoyi.oa.domain.BsRules; |
| | | import com.ruoyi.common.core.mybatisplus.core.BaseMapperPlus; |
| | | |
| | | /** |
| | | * 规章制度Mapper接口 |
| | | * |
| | | * @author ruoyi |
| | | * @date 2022-07-03 |
| | | */ |
| | | public interface BsRulesMapper extends BaseMapperPlus<BsRules> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.oa.service; |
| | | |
| | | import com.ruoyi.oa.domain.BsRules; |
| | | import com.ruoyi.oa.domain.vo.BsRulesVo; |
| | | import com.ruoyi.oa.domain.bo.BsRulesBo; |
| | | import com.ruoyi.common.core.mybatisplus.core.IServicePlus; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | |
| | | import java.util.Collection; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 规章制度Service接口 |
| | | * |
| | | * @author ruoyi |
| | | * @date 2022-07-03 |
| | | */ |
| | | public interface IBsRulesService extends IServicePlus<BsRules, BsRulesVo> { |
| | | /** |
| | | * 查询单个 |
| | | * @return |
| | | */ |
| | | BsRulesVo queryById(Long id); |
| | | |
| | | /** |
| | | * 查询列表 |
| | | */ |
| | | TableDataInfo<BsRulesVo> queryPageList(BsRulesBo bo); |
| | | |
| | | /** |
| | | * 查询列表 |
| | | */ |
| | | List<BsRulesVo> queryList(BsRulesBo bo); |
| | | |
| | | /** |
| | | * 根据新增业务对象插入规章制度 |
| | | * @param bo 规章制度新增业务对象 |
| | | * @return |
| | | */ |
| | | Boolean insertByBo(BsRulesBo bo); |
| | | |
| | | /** |
| | | * 根据编辑业务对象修改规章制度 |
| | | * @param bo 规章制度编辑业务对象 |
| | | * @return |
| | | */ |
| | | Boolean updateByBo(BsRulesBo bo); |
| | | |
| | | /** |
| | | * 校验并删除数据 |
| | | * @param ids 主键集合 |
| | | * @param isValid 是否校验,true-删除前校验,false-不校验 |
| | | * @return |
| | | */ |
| | | Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid); |
| | | } |
| | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public Boolean insertByBo(BsBuildingBo bo) { |
| | | List<BsBuilding> list = baseMapper.selectList(new LambdaQueryWrapper<BsBuilding>() |
| | | .eq(BsBuilding::getSchoolId, bo.getSchoolId()).eq(BsBuilding::getCode, bo.getCode())); |
| | | if (list.size() > 0) { |
| | | throw new ServiceException("单元编号重复", HttpStatus.HTTP_PARTIAL); |
| | | } |
| | | BsBuilding add = BeanUtil.toBean(bo, BsBuilding.class); |
| | | if (bo.getParentId() == Long.valueOf(0)) { |
| | | BsSchool school = schoolMapper.selectById(bo.getSchoolId()); |
| | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public Boolean updateByBo(BsBuildingBo bo) { |
| | | List<BsBuilding> list = baseMapper.selectList(new LambdaQueryWrapper<BsBuilding>() |
| | | .ne(BsBuilding::getId, bo.getId()) |
| | | .eq(BsBuilding::getSchoolId, bo.getSchoolId()) |
| | | .eq(BsBuilding::getCode, bo.getCode())); |
| | | if (list.size() > 0) { |
| | | throw new ServiceException("单元编号重复", HttpStatus.HTTP_PARTIAL); |
| | | } |
| | | BsBuilding update = BeanUtil.toBean(bo, BsBuilding.class); |
| | | if (bo.getParentId() == Long.valueOf(0)) { |
| | | BsSchool school = schoolMapper.selectById(bo.getSchoolId()); |
| | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public Boolean insertByBo(BsOrganizationBo bo) { |
| | | List<BsOrganization> list = baseMapper.selectList(new LambdaQueryWrapper<BsOrganization>() |
| | | .eq(BsOrganization::getSchoolId, bo.getSchoolId()).eq(BsOrganization::getCode, bo.getCode())); |
| | | if (list.size() > 0) { |
| | | throw new ServiceException("机构编号重复", HttpStatus.HTTP_PARTIAL); |
| | | } |
| | | BsOrganization add = BeanUtil.toBean(bo, BsOrganization.class); |
| | | if (bo.getParentId() == Long.valueOf(0)) { |
| | | BsSchool school = schoolMapper.selectById(bo.getSchoolId()); |
| | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public Boolean updateByBo(BsOrganizationBo bo) { |
| | | List<BsOrganization> list = baseMapper.selectList(new LambdaQueryWrapper<BsOrganization>() |
| | | .ne(BsOrganization::getId, bo.getId()) |
| | | .eq(BsOrganization::getSchoolId, bo.getSchoolId()) |
| | | .eq(BsOrganization::getCode, bo.getCode())); |
| | | if (list.size() > 0) { |
| | | throw new ServiceException("机构编号重复", HttpStatus.HTTP_PARTIAL); |
| | | } |
| | | BsOrganization update = BeanUtil.toBean(bo, BsOrganization.class); |
| | | if (bo.getParentId() == Long.valueOf(0)) { |
| | | BsSchool school = schoolMapper.selectById(bo.getSchoolId()); |
New file |
| | |
| | | package com.ruoyi.oa.service.impl; |
| | | |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | import cn.hutool.http.HttpStatus; |
| | | import com.ruoyi.common.exception.ServiceException; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.PageUtils; |
| | | import com.ruoyi.common.core.page.PagePlus; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | import org.springframework.stereotype.Service; |
| | | import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.ruoyi.oa.domain.bo.BsRulesBo; |
| | | import com.ruoyi.oa.domain.vo.BsRulesVo; |
| | | import com.ruoyi.oa.domain.BsRules; |
| | | import com.ruoyi.oa.mapper.BsRulesMapper; |
| | | import com.ruoyi.oa.service.IBsRulesService; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Collection; |
| | | |
| | | /** |
| | | * 规章制度Service业务层处理 |
| | | * |
| | | * @author ruoyi |
| | | * @date 2022-07-03 |
| | | */ |
| | | @Service |
| | | public class BsRulesServiceImpl extends ServicePlusImpl<BsRulesMapper, BsRules, BsRulesVo> implements IBsRulesService { |
| | | |
| | | @Override |
| | | public BsRulesVo queryById(Long id) { |
| | | return getVoById(id); |
| | | } |
| | | |
| | | @Override |
| | | public TableDataInfo<BsRulesVo> queryPageList(BsRulesBo bo) { |
| | | PagePlus<BsRules, BsRulesVo> result = pageVo(PageUtils.buildPagePlus(), buildQueryWrapper(bo)); |
| | | return PageUtils.buildDataInfo(result); |
| | | } |
| | | |
| | | @Override |
| | | public List<BsRulesVo> queryList(BsRulesBo bo) { |
| | | return listVo(buildQueryWrapper(bo)); |
| | | } |
| | | |
| | | private LambdaQueryWrapper<BsRules> buildQueryWrapper(BsRulesBo bo) { |
| | | Map<String, Object> params = bo.getParams(); |
| | | LambdaQueryWrapper<BsRules> lqw = Wrappers.lambdaQuery(); |
| | | return lqw; |
| | | } |
| | | |
| | | @Override |
| | | public Boolean insertByBo(BsRulesBo bo) { |
| | | List<BsRules> list = baseMapper.selectList(new LambdaQueryWrapper<BsRules>().eq(BsRules::getRules, bo.getRules())); |
| | | if (list.size() > 0) { |
| | | throw new ServiceException("规章制度重复", HttpStatus.HTTP_PARTIAL); |
| | | } |
| | | List<BsRules> vList = baseMapper.selectList(new LambdaQueryWrapper<BsRules>().eq(BsRules::getVersionCode, bo.getVersionCode())); |
| | | if (vList.size() > 0) { |
| | | throw new ServiceException("发布版本重复", HttpStatus.HTTP_PARTIAL); |
| | | } |
| | | BsRules add = BeanUtil.toBean(bo, BsRules.class); |
| | | validEntityBeforeSave(add); |
| | | boolean flag = save(add); |
| | | if (flag) { |
| | | bo.setId(add.getId()); |
| | | } |
| | | return flag; |
| | | } |
| | | |
| | | @Override |
| | | public Boolean updateByBo(BsRulesBo bo) { |
| | | List<BsRules> list = baseMapper.selectList(new LambdaQueryWrapper<BsRules>() |
| | | .eq(BsRules::getRules, bo.getRules()) |
| | | .ne(BsRules::getId, bo.getId())); |
| | | if (list.size() > 0) { |
| | | throw new ServiceException("规章制度重复", HttpStatus.HTTP_PARTIAL); |
| | | } |
| | | List<BsRules> vList = baseMapper.selectList(new LambdaQueryWrapper<BsRules>() |
| | | .eq(BsRules::getVersionCode, bo.getVersionCode()) |
| | | .ne(BsRules::getId, bo.getId())); |
| | | if (vList.size() > 0) { |
| | | throw new ServiceException("发布版本重复", HttpStatus.HTTP_PARTIAL); |
| | | } |
| | | BsRules update = BeanUtil.toBean(bo, BsRules.class); |
| | | validEntityBeforeSave(update); |
| | | return updateById(update); |
| | | } |
| | | |
| | | /** |
| | | * 保存前的数据校验 |
| | | * |
| | | * @param entity 实体类数据 |
| | | */ |
| | | private void validEntityBeforeSave(BsRules entity) { |
| | | //TODO 做一些数据校验,如唯一约束 |
| | | } |
| | | |
| | | @Override |
| | | public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) { |
| | | if (isValid) { |
| | | //TODO 做一些业务上的校验,判断是否需要校验 |
| | | } |
| | | return removeByIds(ids); |
| | | } |
| | | } |
| | |
| | | if (list.size() > 0) { |
| | | throw new ServiceException("MAC重复", HttpStatus.HTTP_PARTIAL); |
| | | } |
| | | SgNvr nvr = nvrMapper.selectById(bo.getNvrId()); |
| | | if (!bo.getOrganizationId().equals(nvr.getOrganizationId())) { |
| | | throw new ServiceException("IPC所属单位与所选NVR所属单位不符", HttpStatus.HTTP_PARTIAL); |
| | | if (null != bo.getNvrId()) { |
| | | SgNvr nvr = nvrMapper.selectById(bo.getNvrId()); |
| | | if (!bo.getOrganizationId().equals(nvr.getOrganizationId())) { |
| | | throw new ServiceException("IPC所属单位与所选NVR所属单位不符", HttpStatus.HTTP_PARTIAL); |
| | | } |
| | | } |
| | | SgIpc add = BeanUtil.toBean(bo, SgIpc.class); |
| | | validEntityBeforeSave(add); |
| | |
| | | if (list.size() > 0) { |
| | | throw new ServiceException("MAC重复", HttpStatus.HTTP_PARTIAL); |
| | | } |
| | | SgNvr nvr = nvrMapper.selectById(bo.getNvrId()); |
| | | if (!bo.getOrganizationId().equals(nvr.getOrganizationId())) { |
| | | throw new ServiceException("IPC所属单位与所选NVR所属单位不符", HttpStatus.HTTP_PARTIAL); |
| | | if (null != bo.getNvrId()) { |
| | | SgNvr nvr = nvrMapper.selectById(bo.getNvrId()); |
| | | if (!bo.getOrganizationId().equals(nvr.getOrganizationId())) { |
| | | throw new ServiceException("IPC所属单位与所选NVR所属单位不符", HttpStatus.HTTP_PARTIAL); |
| | | } |
| | | } |
| | | SgIpc update = BeanUtil.toBean(bo, SgIpc.class); |
| | | validEntityBeforeSave(update); |
New file |
| | |
| | | <?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.ruoyi.oa.mapper.BsRulesMapper"> |
| | | |
| | | <resultMap type="com.ruoyi.oa.domain.BsRules" id="BsRulesResult"> |
| | | <result property="id" column="id"/> |
| | | <result property="rules" column="rules"/> |
| | | <result property="versionCode" column="version_code"/> |
| | | <result property="reviseTime" column="revise_time"/> |
| | | <result property="fileUrl" column="file_url"/> |
| | | <result property="createBy" column="create_by"/> |
| | | <result property="createTime" column="create_time"/> |
| | | <result property="updateBy" column="update_by"/> |
| | | <result property="updateTime" column="update_time"/> |
| | | <result property="delFlag" column="del_flag"/> |
| | | </resultMap> |
| | | |
| | | |
| | | </mapper> |