洪城义警-正式版后台
tangzy
2022-01-08 4b5490eec63382dfdb548de676464d9a2a15043f
1.积分,行业政策,组织申请
1 files modified
24 files added
1257 ■■■■■ changed files
src/main/java/org/springblade/common/config/BladeConfiguration.java 3 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/integral/controller/IntegralController.java 138 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/integral/dto/IntegralDTO.java 34 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/integral/entity/Integral.java 68 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/integral/mapper/IntegralMapper.java 43 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/integral/mapper/IntegralMapper.xml 26 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/integral/service/IIntegralService.java 41 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/integral/service/impl/IntegralServiceImpl.java 46 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/integral/vo/IntegralVO.java 36 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/organ/controller/OrganController.java 127 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/organ/dto/OrganDTO.java 34 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/organ/entity/Organ.java 70 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/organ/mapper/OrganMapper.java 43 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/organ/mapper/OrganMapper.xml 23 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/organ/service/IOrganService.java 41 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/organ/service/impl/OrganServiceImpl.java 41 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/organ/vo/OrganVO.java 36 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/policy/controller/PolicyController.java 127 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/policy/dto/PolicyDTO.java 34 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/policy/entity/Policy.java 66 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/policy/mapper/PolicyMapper.java 43 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/policy/mapper/PolicyMapper.xml 19 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/policy/service/IPolicyService.java 41 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/policy/service/impl/PolicyServiceImpl.java 41 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/policy/vo/PolicyVO.java 36 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/common/config/BladeConfiguration.java
@@ -105,6 +105,9 @@
        secureRegistry.excludePathPatterns("/taskfk/**");
        secureRegistry.excludePathPatterns("/sensitiveword/**");
        secureRegistry.excludePathPatterns("/trar/**");
        secureRegistry.excludePathPatterns("/integral/**");
        secureRegistry.excludePathPatterns("/organ/**");
        secureRegistry.excludePathPatterns("/policy/**");
        return secureRegistry;
    }
src/main/java/org/springblade/modules/integral/controller/IntegralController.java
New file
@@ -0,0 +1,138 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.integral.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springblade.modules.integral.entity.Integral;
import org.springblade.modules.integral.service.IIntegralService;
import org.springblade.modules.integral.vo.IntegralVO;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
/**
 * 控制器
 * 积分
 *
 * @author BladeX
 * @since 2022-01-08
 */
@RestController
@AllArgsConstructor
@RequestMapping("/integral")
@Api(value = "", tags = "接口")
public class IntegralController extends BladeController {
    private final IIntegralService integralService;
    /**
     * 详情
     */
    @GetMapping("/detail")
    @ApiOperationSupport(order = 1)
    @ApiOperation(value = "详情", notes = "传入integral")
    public R<Integral> detail(Integral integral) {
        Integral detail = integralService.getOne(Condition.getQueryWrapper(integral));
        return R.data(detail);
    }
    /**
     * 分页
     */
    @GetMapping("/list")
    @ApiOperationSupport(order = 2)
    @ApiOperation(value = "分页", notes = "传入integral")
    public R<IPage<Integral>> list(Integral integral, Query query) {
        IPage<Integral> pages = integralService.page(Condition.getPage(query), Condition.getQueryWrapper(integral));
        return R.data(pages);
    }
    /**
     * 自定义分页
     */
    @GetMapping("/page")
    @ApiOperationSupport(order = 3)
    @ApiOperation(value = "分页", notes = "传入integral")
    public R<IPage<IntegralVO>> page(IntegralVO integral, Query query) {
        IPage<IntegralVO> pages = integralService.selectIntegralPage(Condition.getPage(query), integral);
        return R.data(pages);
    }
    /**
     * 新增
     */
    @PostMapping("/save")
    @ApiOperationSupport(order = 4)
    @ApiOperation(value = "新增", notes = "传入integral")
    public R save(@Valid @RequestBody Integral integral) {
        return R.status(integralService.save(integral));
    }
    /**
     * 修改
     */
    @PostMapping("/update")
    @ApiOperationSupport(order = 5)
    @ApiOperation(value = "修改", notes = "传入integral")
    public R update(@Valid @RequestBody Integral integral) {
        return R.status(integralService.updateById(integral));
    }
    /**
     * 新增或修改
     */
    @PostMapping("/submit")
    @ApiOperationSupport(order = 6)
    @ApiOperation(value = "新增或修改", notes = "传入integral")
    public R submit(@Valid @RequestBody Integral integral) {
        return R.status(integralService.saveOrUpdate(integral));
    }
    /**
     * 删除
     */
    @PostMapping("/remove")
    @ApiOperationSupport(order = 8)
    @ApiOperation(value = "删除", notes = "传入ids")
    public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
        return R.status(integralService.removeByIds(Func.toLongList(ids)));
    }
    /**
     * 通过用户id查询总积分
     *
     * @param uid
     * @return
     */
    @PostMapping("/selectCount")
    public R selectCount(String uid) {
        return R.data(integralService.selectCount(uid));
    }
}
src/main/java/org/springblade/modules/integral/dto/IntegralDTO.java
New file
@@ -0,0 +1,34 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.integral.dto;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.modules.integral.entity.Integral;
/**
 * 数据传输对象实体类
 *
 * @author BladeX
 * @since 2022-01-08
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class IntegralDTO extends Integral {
    private static final long serialVersionUID = 1L;
}
src/main/java/org/springblade/modules/integral/entity/Integral.java
New file
@@ -0,0 +1,68 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.integral.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;
/**
 * 实体类
 *
 * @author BladeX
 * @since 2022-01-08
 */
@Data
@TableName("sys_integral")
@ApiModel(value = "Integral对象", description = "Integral对象")
public class Integral implements Serializable {
    private static final long serialVersionUID = 1L;
    private Integer id;
    /**
     * 用户id
     */
    @ApiModelProperty(value = "用户id")
    private Integer uid;
    /**
     * 获取途径
     */
    @ApiModelProperty(value = "获取途径")
    private String access;
    /**
     * 获取时间
     */
    @ApiModelProperty(value = "获取时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date time;
    /**
     * 积分
     */
    @ApiModelProperty(value = "积分")
    private Integer integral;
}
src/main/java/org/springblade/modules/integral/mapper/IntegralMapper.java
New file
@@ -0,0 +1,43 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.integral.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.modules.integral.entity.Integral;
import org.springblade.modules.integral.vo.IntegralVO;
import java.util.List;
/**
 *  Mapper 接口
 *
 * @author BladeX
 * @since 2022-01-08
 */
public interface IntegralMapper extends BaseMapper<Integral> {
    /**
     * 自定义分页
     *
     * @param page
     * @param integral
     * @return
     */
    List<IntegralVO> selectIntegralPage(IPage page, IntegralVO integral);
    String selectCount(String uid);
}
src/main/java/org/springblade/modules/integral/mapper/IntegralMapper.xml
New file
@@ -0,0 +1,26 @@
<?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="org.springblade.modules.integral.mapper.IntegralMapper">
    <!-- 通用查询映射结果 -->
    <resultMap id="integralResultMap" type="org.springblade.modules.integral.entity.Integral">
        <id column="id" property="id"/>
        <result column="uid" property="uid"/>
        <result column="access" property="access"/>
        <result column="time" property="time"/>
        <result column="integral" property="integral"/>
    </resultMap>
    <select id="selectIntegralPage" resultMap="integralResultMap">
        select *
        from sys_integral
        where is_deleted = 0
    </select>
    <select id="selectCount" resultType="java.lang.String">
        SELECT COALESCE(sum(integral), 0) as integral
        FROM sys_integral where  uid=#{uid}
    </select>
</mapper>
src/main/java/org/springblade/modules/integral/service/IIntegralService.java
New file
@@ -0,0 +1,41 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.integral.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springblade.modules.integral.entity.Integral;
import org.springblade.modules.integral.vo.IntegralVO;
/**
 *  服务类
 *
 * @author BladeX
 * @since 2022-01-08
 */
public interface IIntegralService extends IService<Integral> {
    /**
     * 自定义分页
     *
     * @param page
     * @param integral
     * @return
     */
    IPage<IntegralVO> selectIntegralPage(IPage<IntegralVO> page, IntegralVO integral);
    String selectCount(String uid);
}
src/main/java/org/springblade/modules/integral/service/impl/IntegralServiceImpl.java
New file
@@ -0,0 +1,46 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.integral.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springblade.modules.integral.entity.Integral;
import org.springblade.modules.integral.mapper.IntegralMapper;
import org.springblade.modules.integral.service.IIntegralService;
import org.springblade.modules.integral.vo.IntegralVO;
import org.springframework.stereotype.Service;
/**
 *  服务实现类
 *
 * @author BladeX
 * @since 2022-01-08
 */
@Service
public class IntegralServiceImpl extends ServiceImpl<IntegralMapper, Integral> implements IIntegralService {
    @Override
    public IPage<IntegralVO> selectIntegralPage(IPage<IntegralVO> page, IntegralVO integral) {
        return page.setRecords(baseMapper.selectIntegralPage(page, integral));
    }
    @Override
    public String selectCount(String uid) {
        return baseMapper.selectCount(uid);
    }
}
src/main/java/org/springblade/modules/integral/vo/IntegralVO.java
New file
@@ -0,0 +1,36 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.integral.vo;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.modules.integral.entity.Integral;
/**
 * 视图实体类
 *
 * @author BladeX
 * @since 2022-01-08
 */
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "IntegralVO对象", description = "IntegralVO对象")
public class IntegralVO extends Integral {
    private static final long serialVersionUID = 1L;
}
src/main/java/org/springblade/modules/organ/controller/OrganController.java
New file
@@ -0,0 +1,127 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.organ.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springblade.modules.organ.entity.Organ;
import org.springblade.modules.organ.service.IOrganService;
import org.springblade.modules.organ.vo.OrganVO;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
/**
 *  控制器
 *组织
 * @author BladeX
 * @since 2022-01-08
 */
@RestController
@AllArgsConstructor
@RequestMapping("/organ")
@Api(value = "", tags = "接口")
public class OrganController extends BladeController {
    private final IOrganService organService;
    /**
     * 详情
     */
    @GetMapping("/detail")
    @ApiOperationSupport(order = 1)
    @ApiOperation(value = "详情", notes = "传入organ")
    public R<Organ> detail(Organ organ) {
        Organ detail = organService.getOne(Condition.getQueryWrapper(organ));
        return R.data(detail);
    }
    /**
     * 分页
     */
    @GetMapping("/list")
    @ApiOperationSupport(order = 2)
    @ApiOperation(value = "分页", notes = "传入organ")
    public R<IPage<Organ>> list(Organ organ, Query query) {
        IPage<Organ> pages = organService.page(Condition.getPage(query), Condition.getQueryWrapper(organ));
        return R.data(pages);
    }
    /**
     * 自定义分页
     */
    @GetMapping("/page")
    @ApiOperationSupport(order = 3)
    @ApiOperation(value = "分页", notes = "传入organ")
    public R<IPage<OrganVO>> page(OrganVO organ, Query query) {
        IPage<OrganVO> pages = organService.selectOrganPage(Condition.getPage(query), organ);
        return R.data(pages);
    }
    /**
     * 新增
     */
    @PostMapping("/save")
    @ApiOperationSupport(order = 4)
    @ApiOperation(value = "新增", notes = "传入organ")
    public R save(@Valid @RequestBody Organ organ) {
        return R.status(organService.save(organ));
    }
    /**
     * 修改
     */
    @PostMapping("/update")
    @ApiOperationSupport(order = 5)
    @ApiOperation(value = "修改", notes = "传入organ")
    public R update(@Valid @RequestBody Organ organ) {
        return R.status(organService.updateById(organ));
    }
    /**
     * 新增或修改
     */
    @PostMapping("/submit")
    @ApiOperationSupport(order = 6)
    @ApiOperation(value = "新增或修改", notes = "传入organ")
    public R submit(@Valid @RequestBody Organ organ) {
        return R.status(organService.saveOrUpdate(organ));
    }
    /**
     * 删除
     */
    @PostMapping("/remove")
    @ApiOperationSupport(order = 8)
    @ApiOperation(value = "删除", notes = "传入ids")
    public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
        return R.status(organService.removeByIds(Func.toLongList(ids)));
    }
}
src/main/java/org/springblade/modules/organ/dto/OrganDTO.java
New file
@@ -0,0 +1,34 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.organ.dto;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.modules.organ.entity.Organ;
/**
 * 数据传输对象实体类
 *
 * @author BladeX
 * @since 2022-01-08
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class OrganDTO extends Organ {
    private static final long serialVersionUID = 1L;
}
src/main/java/org/springblade/modules/organ/entity/Organ.java
New file
@@ -0,0 +1,70 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.organ.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;
/**
 * 实体类
 *
 * @author BladeX
 * @since 2022-01-08
 */
@Data
@TableName("sys_organ")
@ApiModel(value = "Organ对象", description = "Organ对象")
public class Organ implements Serializable {
    private static final long serialVersionUID = 1L;
    private Integer id;
    /**
     * 用户id
     */
    @ApiModelProperty(value = "用户id")
    private Integer uid;
    /**
     * 组织
     */
    @ApiModelProperty(value = "组织")
    private String organization;
    /**
     * 时间
     */
    @ApiModelProperty(value = "时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date time;
    /**
     * 进度
     */
    @ApiModelProperty(value = "进度")
    private Double
        speed;
}
src/main/java/org/springblade/modules/organ/mapper/OrganMapper.java
New file
@@ -0,0 +1,43 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.organ.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.modules.organ.entity.Organ;
import org.springblade.modules.organ.vo.OrganVO;
import java.util.List;
/**
 *  Mapper 接口
 *
 * @author BladeX
 * @since 2022-01-08
 */
public interface OrganMapper extends BaseMapper<Organ> {
    /**
     * 自定义分页
     *
     * @param page
     * @param organ
     * @return
     */
    List<OrganVO> selectOrganPage(IPage page, OrganVO organ);
}
src/main/java/org/springblade/modules/organ/mapper/OrganMapper.xml
New file
@@ -0,0 +1,23 @@
<?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="org.springblade.modules.organ.mapper.OrganMapper">
    <!-- 通用查询映射结果 -->
    <resultMap id="organResultMap" type="org.springblade.modules.organ.entity.Organ">
        <id column="id" property="id"/>
        <result column="uid" property="uid"/>
        <result column="organization" property="organization"/>
        <result column="time" property="time"/>
        <result column="
speed" property="
speed"/>
    </resultMap>
    <select id="selectOrganPage" resultMap="organResultMap">
        select * from sys_organ where is_deleted = 0
    </select>
</mapper>
src/main/java/org/springblade/modules/organ/service/IOrganService.java
New file
@@ -0,0 +1,41 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.organ.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springblade.modules.organ.entity.Organ;
import org.springblade.modules.organ.vo.OrganVO;
/**
 *  服务类
 *
 * @author BladeX
 * @since 2022-01-08
 */
public interface IOrganService extends IService<Organ> {
    /**
     * 自定义分页
     *
     * @param page
     * @param organ
     * @return
     */
    IPage<OrganVO> selectOrganPage(IPage<OrganVO> page, OrganVO organ);
}
src/main/java/org/springblade/modules/organ/service/impl/OrganServiceImpl.java
New file
@@ -0,0 +1,41 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.organ.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springblade.modules.organ.entity.Organ;
import org.springblade.modules.organ.mapper.OrganMapper;
import org.springblade.modules.organ.service.IOrganService;
import org.springblade.modules.organ.vo.OrganVO;
import org.springframework.stereotype.Service;
/**
 *  服务实现类
 *
 * @author BladeX
 * @since 2022-01-08
 */
@Service
public class OrganServiceImpl extends ServiceImpl<OrganMapper, Organ> implements IOrganService {
    @Override
    public IPage<OrganVO> selectOrganPage(IPage<OrganVO> page, OrganVO organ) {
        return page.setRecords(baseMapper.selectOrganPage(page, organ));
    }
}
src/main/java/org/springblade/modules/organ/vo/OrganVO.java
New file
@@ -0,0 +1,36 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.organ.vo;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.modules.organ.entity.Organ;
/**
 * 视图实体类
 *
 * @author BladeX
 * @since 2022-01-08
 */
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "OrganVO对象", description = "OrganVO对象")
public class OrganVO extends Organ {
    private static final long serialVersionUID = 1L;
}
src/main/java/org/springblade/modules/policy/controller/PolicyController.java
New file
@@ -0,0 +1,127 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.policy.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springblade.modules.policy.entity.Policy;
import org.springblade.modules.policy.service.IPolicyService;
import org.springblade.modules.policy.vo.PolicyVO;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
/**
 * 控制器
 * 行业政策
 *
 * @author BladeX
 * @since 2022-01-08
 */
@RestController
@AllArgsConstructor
@RequestMapping("/policy")
@Api(value = "", tags = "接口")
public class PolicyController extends BladeController {
    private final IPolicyService policyService;
    /**
     * 详情
     */
    @GetMapping("/detail")
    @ApiOperationSupport(order = 1)
    @ApiOperation(value = "详情", notes = "传入policy")
    public R<Policy> detail(Policy policy) {
        Policy detail = policyService.getOne(Condition.getQueryWrapper(policy));
        return R.data(detail);
    }
    /**
     * 分页
     */
    @GetMapping("/list")
    @ApiOperationSupport(order = 2)
    @ApiOperation(value = "分页", notes = "传入policy")
    public R<IPage<Policy>> list(Policy policy, Query query) {
        IPage<Policy> pages = policyService.page(Condition.getPage(query), Condition.getQueryWrapper(policy));
        return R.data(pages);
    }
    /**
     * 自定义分页
     */
    @GetMapping("/page")
    @ApiOperationSupport(order = 3)
    @ApiOperation(value = "分页", notes = "传入policy")
    public R<IPage<PolicyVO>> page(PolicyVO policy, Query query) {
        IPage<PolicyVO> pages = policyService.selectPolicyPage(Condition.getPage(query), policy);
        return R.data(pages);
    }
    /**
     * 新增
     */
    @PostMapping("/save")
    @ApiOperationSupport(order = 4)
    @ApiOperation(value = "新增", notes = "传入policy")
    public R save(@Valid @RequestBody Policy policy) {
        return R.status(policyService.save(policy));
    }
    /**
     * 修改
     */
    @PostMapping("/update")
    @ApiOperationSupport(order = 5)
    @ApiOperation(value = "修改", notes = "传入policy")
    public R update(@Valid @RequestBody Policy policy) {
        return R.status(policyService.updateById(policy));
    }
    /**
     * 新增或修改
     */
    @PostMapping("/submit")
    @ApiOperationSupport(order = 6)
    @ApiOperation(value = "新增或修改", notes = "传入policy")
    public R submit(@Valid @RequestBody Policy policy) {
        return R.status(policyService.saveOrUpdate(policy));
    }
    /**
     * 删除
     */
    @PostMapping("/remove")
    @ApiOperationSupport(order = 8)
    @ApiOperation(value = "删除", notes = "传入ids")
    public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
        return R.status(policyService.removeByIds(Func.toLongList(ids)));
    }
}
src/main/java/org/springblade/modules/policy/dto/PolicyDTO.java
New file
@@ -0,0 +1,34 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.policy.dto;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.modules.policy.entity.Policy;
/**
 * 数据传输对象实体类
 *
 * @author BladeX
 * @since 2022-01-08
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class PolicyDTO extends Policy {
    private static final long serialVersionUID = 1L;
}
src/main/java/org/springblade/modules/policy/entity/Policy.java
New file
@@ -0,0 +1,66 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.policy.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;
/**
 * 实体类
 *
 * @author BladeX
 * @since 2022-01-08
 */
@Data
@TableName("sys_policy")
@ApiModel(value = "Policy对象", description = "Policy对象")
public class Policy implements Serializable {
    private static final long serialVersionUID = 1L;
    private Integer id;
    private String policy;
    /**
     * 政策内容
     */
    @ApiModelProperty(value = "政策内容")
    @TableField("policyCount")
    private String policycount;
    /**
     * 法规
     */
    @ApiModelProperty(value = "法规")
    private String statute;
    /**
     * 发布时间
     */
    @ApiModelProperty(value = "发布时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date time;
}
src/main/java/org/springblade/modules/policy/mapper/PolicyMapper.java
New file
@@ -0,0 +1,43 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.policy.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.modules.policy.entity.Policy;
import org.springblade.modules.policy.vo.PolicyVO;
import java.util.List;
/**
 *  Mapper 接口
 *
 * @author BladeX
 * @since 2022-01-08
 */
public interface PolicyMapper extends BaseMapper<Policy> {
    /**
     * 自定义分页
     *
     * @param page
     * @param policy
     * @return
     */
    List<PolicyVO> selectPolicyPage(IPage page, PolicyVO policy);
}
src/main/java/org/springblade/modules/policy/mapper/PolicyMapper.xml
New file
@@ -0,0 +1,19 @@
<?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="org.springblade.modules.policy.mapper.PolicyMapper">
    <!-- 通用查询映射结果 -->
    <resultMap id="policyResultMap" type="org.springblade.modules.policy.entity.Policy">
        <id column="id" property="id"/>
        <result column="policy" property="policy"/>
        <result column="policyCount" property="policycount"/>
        <result column="statute" property="statute"/>
        <result column="time" property="time"/>
    </resultMap>
    <select id="selectPolicyPage" resultMap="policyResultMap">
        select * from sys_policy where is_deleted = 0
    </select>
</mapper>
src/main/java/org/springblade/modules/policy/service/IPolicyService.java
New file
@@ -0,0 +1,41 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.policy.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springblade.modules.policy.entity.Policy;
import org.springblade.modules.policy.vo.PolicyVO;
/**
 *  服务类
 *
 * @author BladeX
 * @since 2022-01-08
 */
public interface IPolicyService extends IService<Policy> {
    /**
     * 自定义分页
     *
     * @param page
     * @param policy
     * @return
     */
    IPage<PolicyVO> selectPolicyPage(IPage<PolicyVO> page, PolicyVO policy);
}
src/main/java/org/springblade/modules/policy/service/impl/PolicyServiceImpl.java
New file
@@ -0,0 +1,41 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.policy.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springblade.modules.policy.entity.Policy;
import org.springblade.modules.policy.mapper.PolicyMapper;
import org.springblade.modules.policy.service.IPolicyService;
import org.springblade.modules.policy.vo.PolicyVO;
import org.springframework.stereotype.Service;
/**
 *  服务实现类
 *
 * @author BladeX
 * @since 2022-01-08
 */
@Service
public class PolicyServiceImpl extends ServiceImpl<PolicyMapper, Policy> implements IPolicyService {
    @Override
    public IPage<PolicyVO> selectPolicyPage(IPage<PolicyVO> page, PolicyVO policy) {
        return page.setRecords(baseMapper.selectPolicyPage(page, policy));
    }
}
src/main/java/org/springblade/modules/policy/vo/PolicyVO.java
New file
@@ -0,0 +1,36 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.policy.vo;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.modules.policy.entity.Policy;
/**
 * 视图实体类
 *
 * @author BladeX
 * @since 2022-01-08
 */
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "PolicyVO对象", description = "PolicyVO对象")
public class PolicyVO extends Policy {
    private static final long serialVersionUID = 1L;
}