智慧保安后台管理-验收版本
Administrator
2021-09-14 3293bbe787ec29543c85697de56f86177d983103
首页统计接口新增
9 files modified
1 files added
521 ■■■■■ changed files
src/main/java/org/springblade/modules/information/controller/InformationsController.java 103 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/information/entity/Information.java 13 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/information/mapper/InformationMapper.java 40 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/information/mapper/InformationMapper.xml 221 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/information/service/IInformationService.java 55 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/information/service/impl/InformationServiceImpl.java 73 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/information/vo/InformationVO.java 5 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/system/mapper/UserMapper.xml 3 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/training/entity/TrainingRegistration.java 6 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/training/mapper/TrainingRegistrationMapper.xml 2 ●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/information/controller/InformationsController.java
New file
@@ -0,0 +1,103 @@
package org.springblade.modules.information.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import lombok.AllArgsConstructor;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springblade.modules.information.service.IInformationService;
import org.springblade.modules.information.vo.InformationVO;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
 * 组织机构详情控制层 2
 * @author zhongrj
 * @time 2021-09-14
 */
@RestController
@RequestMapping("/information")
@AllArgsConstructor
public class InformationsController {
    private final IInformationService informationService;
    /**
     * 获取保安公司信息(本市保安公司,分公司)包含经纬度
     * @return
     */
    @GetMapping("/getSecurityUnitPositionInfo")
    public R getSecurityUnitPositionInfo(){
        return R.data(informationService.getSecurityUnitPositionInfo());
    }
    /**
     * 根据辖区查询保安公司分页信息(本市保安公司,分公司)
     * @param query  分页条件
     * @param information 查询条件
     * @return
     */
    @GetMapping("/getSecurityUnitInfoPage")
    public R<IPage<InformationVO>> getSecurityUnitInfoPage(InformationVO information, Query query){
        return R.data(informationService.getSecurityUnitInfoPage(Condition.getPage(query), information));
    }
    /**
     * 根据辖区查询统计保安公司持证情况分页信息(本市保安公司,分公司)
     * @param query  分页条件
     * @param information 查询条件
     * @return
     */
    @GetMapping("/getSecurityUnitHoldInfoPage")
    public R<IPage<InformationVO>> getSecurityUnitHoldInfoPage(InformationVO information, Query query){
        return R.data(informationService.getSecurityUnitHoldInfoPage(Condition.getPage(query), information));
    }
    /**
     * 根据辖区查询统计保安公司持证率低于50%的保安公司个数及保安公司分页信息(本市保安公司,分公司)
     * @param query  分页条件
     * @param information 查询条件
     * @return
     */
    @GetMapping("/getSecurityUnitHoldLess50Page")
    public R<IPage<InformationVO>> getSecurityUnitHoldLess50Page(InformationVO information, Query query){
        return R.data(informationService.getSecurityUnitHoldLess50Page(Condition.getPage(query), information));
    }
    /**
     * 根据辖区查询统计保安公司派遣率低于50%的保安公司个数及保安公司分页信息(本市保安公司,分公司)
     * @param query  分页条件
     * @param information 查询条件
     * @return
     */
    @GetMapping("/getSecurityUnitDispatcherLess50Page")
    public R<IPage<InformationVO>> getSecurityUnitDispatcherLess50Page(InformationVO information, Query query){
        return R.data(informationService.getSecurityUnitDispatcherLess50Page(Condition.getPage(query), information));
    }
    /**
     * 根据辖区查询统计保安公司社保缴纳率低于50%的保安公司个数及保安公司分页信息(本市保安公司,分公司)
     * @param query  分页条件
     * @param information 查询条件
     * @return
     */
    @GetMapping("/getSecurityUnitSoilLess50Page")
    public R<IPage<InformationVO>> getSecurityUnitSoilLess50Page(InformationVO information, Query query){
        return R.data(informationService.getSecurityUnitSoilLess50Page(Condition.getPage(query), information));
    }
    /**
     * 根据辖区查询统计保安公司考试通过率低于50%的保安公司个数及保安公司分页信息(本市保安公司,分公司)
     * @param query  分页条件
     * @param information 查询条件
     * @return
     */
    @GetMapping("/getSecurityUnitExamLess50Page")
    public R<IPage<InformationVO>> getSecurityUnitExamLess50Page(InformationVO information, Query query){
        return R.data(informationService.getSecurityUnitExamLess50Page(Condition.getPage(query), information));
    }
}
src/main/java/org/springblade/modules/information/entity/Information.java
@@ -147,7 +147,18 @@
    private String businessLicense;
    private String licence;
    private String fregion;
    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date ftime;
    /**
     * 经度
     */
    private String longitude;
    /**
     * 纬度
     */
    private String latitude;
}
src/main/java/org/springblade/modules/information/mapper/InformationMapper.java
@@ -92,4 +92,44 @@
    Map<String, String> queryYearBanan(String year,String jurisdiction,String deptid);
    Map<String, String> queryYearDe(String year,String jurisdiction,String deptid);
    void deleteDept(String ids);
    /**
     * 获取保安公司信息(本市保安公司,分公司)包含经纬度
     * @return
     */
    List<InformationVO> getSecurityUnitPositionInfo();
    /**
     * 根据辖区查询保安公司分页信息(本市保安公司,分公司)
     * @param page  分页条件
     * @param information 查询条件
     * @return
     */
    List<InformationVO> getSecurityUnitInfoPage(IPage<InformationVO> page,@Param("information") InformationVO information);
    /**
     * 根据辖区查询统计保安公司持证情况分页信息(本市保安公司,分公司)
     * @param page  分页条件
     * @param information 查询条件
     * @return
     */
    List<InformationVO> getSecurityUnitHoldInfoPage(IPage<InformationVO> page,@Param("information") InformationVO information);
    /**
     * 根据辖区查询统计保安公司(1:持证率低于50%, 2:派遣率低于50%  3:缴纳社保率低于50% 的保安公司个数及保安公司分页信息(本市保安公司,分公司)
     * @param page  分页条件
     * @param information 查询条件
     * @return
     */
    List<InformationVO> getSecurityUnitLess50Page(IPage<InformationVO> page,
                                                      @Param("type") Integer type,
                                                      @Param("information") InformationVO information);
    /**
     * 根据辖区查询统计保安公司考试通过率低于50%的保安公司个数及保安公司分页信息(本市保安公司,分公司)
     * @param page  分页条件
     * @param information 查询条件
     * @return
     */
    List<InformationVO> getSecurityUnitExamLess50Page(IPage<InformationVO> page,@Param("information") InformationVO information);
}
src/main/java/org/springblade/modules/information/mapper/InformationMapper.xml
@@ -1765,4 +1765,225 @@
              ) = 1
          AND parent_id!=0
    </select>
    <!--获取保安公司信息(本市保安公司,分公司)包含经纬度-->
    <select id="getSecurityUnitPositionInfo" resultType="org.springblade.modules.information.vo.InformationVO">
        select
        si.*,sj.dept_name jurisdictionName
        from
        sys_information si
        left join
        sys_jurisdiction sj
        on
        si.jurisdiction = sj.id
        where 1=1
        and (stats = 2 or stats = 4)
    </select>
    <!--根据辖区查询保安公司分页信息(本市保安公司,分公司)-->
    <select id="getSecurityUnitInfoPage" resultType="org.springblade.modules.information.vo.InformationVO">
        select
        si.*,sj.dept_name jurisdictionName
        from
        sys_information si
        left join
        sys_jurisdiction sj
        on
        si.jurisdiction = sj.id
        where 1=1
        and (stats = 2 or stats = 4)
        <if test="information.jurisdiction!=null and information.jurisdiction!=''">
            and (sj.id = #{information.jurisdiction} or sj.parent_id = #{information.jurisdiction})
        </if>
    </select>
    <sql id="getSecurity">
        select
            dept_id,ifnull(count(*),0) count
            from blade_user bu
            left join blade_role br
            on bu.role_id = br.id
            where
            role_alias = "安保人员"
            and bu.is_deleted = 0
            and bu.`status` = 1
    </sql>
    <!--根据辖区查询统计保安公司持证情况分页信息(本市保安公司,分公司)-->
    <select id="getSecurityUnitHoldInfoPage" resultType="org.springblade.modules.information.vo.InformationVO">
        select
            si.*,sj.dept_name jurisdictionName,
            ifnull(a.count,0) znum,
            ifnull(b.count,0) cnum,
            ifnull(c.count,0) pnum
        from sys_information si
        left join
        (
            <include refid="getSecurity"/>
            group by dept_id
        ) a
        on
        a.dept_id = si.departmentid
        left join
        (
            <include refid="getSecurity"/>
            and bu.hold = 1
            group by dept_id
        ) b
        on
        b.dept_id = si.departmentid
        left join
        (
            <include refid="getSecurity"/>
            and bu.hold = 2
            group by dept_id
        ) c
        on
        c.dept_id = si.departmentid
        left join
        sys_jurisdiction sj
        on
        si.jurisdiction = sj.id
        where 1=1
        and (si.stats = 2 or si.stats = 4)
        <if test="information.jurisdiction!=null and information.jurisdiction!=''">
            and (sj.id = #{information.jurisdiction} or sj.parent_id = #{information.jurisdiction})
        </if>
    </select>
    <!--根据辖区查询统计保安公司(1:持证率低于50% 2:派遣率低于50%  3:缴纳社保率低于50% 的保安公司个数及保安公司分页信息(本市保安公司,分公司)-->
    <select id="getSecurityUnitLess50Page" resultType="org.springblade.modules.information.vo.InformationVO">
        select c.*,sj.dept_name jurisdictionName from (
            select
            si.*,
            ifnull(a.count,0) znum,
            ifnull(b.count,0) cnum,
            ifnull(FORMAT((b.count/a.count)*100,2),0) pnum
            from sys_information si
            left join
            (
                <include refid="getSecurity"/>
                group by dept_id
            ) a
            on
            a.dept_id = si.departmentid
            left join
            (
                <include refid="getSecurity"/>
                <if test="type==1">
                    and bu.hold = 1
                </if>
                <if test="type==2">
                    and bu.dispatch = 0
                </if>
                <if test="type==3">
                    and bu.soil = 0
                </if>
                group by dept_id
            ) b
            on
            b.dept_id = si.departmentid
        )c
        left join
        sys_jurisdiction sj
        on
        c.jurisdiction = sj.id
        where 1=1
        and (c.stats = 2 or c.stats = 4)
        and pnum &lt; 50
        <if test="information.jurisdiction!=null and information.jurisdiction!='' and information.jurisdiction!='1372091709474910209'">
            and (sj.id = #{information.jurisdiction} or sj.parent_id = #{information.jurisdiction})
        </if>
    </select>
    <!--根据辖区查询统计保安公司考试通过率低于50%的保安公司个数及保安公司分页信息(本市保安公司,分公司)-->
    <select id="getSecurityUnitExamLess50Page" resultType="org.springblade.modules.information.vo.InformationVO">
        select d.*,sj.dept_name jurisdictionName from (
            select
            si.*,
            ifnull(a.count,0) znum,
            ifnull(b.count,0) cnum,
            ifnull(FORMAT((b.count/c.count)*100,2),0) pnum
            from sys_information si
            left join
            (
            <include refid="getSecurity"/>
            group by dept_id
            ) a
            on
            a.dept_id = si.departmentid
            left join
            (
                select b1.dept_id,ifnull(b2.count,0) count from
                    (
                        select
                        bu.dept_id,ifnull(count(*),0) count
                        from blade_user bu
                        left join blade_role br
                        on bu.role_id = br.id
                        where
                        role_alias = "安保人员"
                        and bu.is_deleted = 0
                        and bu.`status` = 1
                        group by dept_id
                    ) b1
                    left join
                    (
                        select count(*) count,bu.dept_id from
                        exam_score es
                        left join
                        blade_user bu
                        on
                        bu.id = es.user_id
                        where qualified = 0 group by bu.dept_id
                    ) b2
                on
                b1.dept_id = b2.dept_id
            ) b
            on
            b.dept_id = si.departmentid
            left join
            (
                select c1.dept_id,ifnull(c2.count,0) count from
                (
                    select
                    bu.dept_id,ifnull(count(*),0) count
                    from blade_user bu
                    left join blade_role br
                    on bu.role_id = br.id
                    where
                    role_alias = "安保人员"
                    and bu.is_deleted = 0
                    and bu.`status` = 1
                    group by dept_id
                ) c1
                left join
                (
                    select count(*) count,bu.dept_id from
                    exam_score es
                    left join
                    blade_user bu
                    on
                    bu.id = es.user_id
                    where 1=1 group by bu.dept_id
                ) c2
                on
                c1.dept_id = c2.dept_id
            ) c
            on
            c.dept_id = si.departmentid
        )d
        left join
        sys_jurisdiction sj
        on
        d.jurisdiction = sj.id
        where 1=1
        and (d.stats = 2 or d.stats = 4)
        and pnum &lt; 50
        <if test="information.jurisdiction!=null and information.jurisdiction!='' and information.jurisdiction!='1372091709474910209'">
            and (sj.id = #{information.jurisdiction} or sj.parent_id = #{information.jurisdiction})
        </if>
    </select>
</mapper>
src/main/java/org/springblade/modules/information/service/IInformationService.java
@@ -17,6 +17,7 @@
package org.springblade.modules.information.service;
import org.apache.ibatis.annotations.Param;
import org.springblade.core.tool.api.R;
import org.springblade.modules.dispatcher.vo.DispatcherVO;
import org.springblade.modules.information.entity.Information;
import org.springblade.modules.information.vo.InformationVO;
@@ -91,4 +92,58 @@
    List<Map<Object,Object>> selJur();
    String selJurchilder(String id);
    List<Map<Object,Object>> seleJuList(String substring);
    /**
     * 获取保安公司信息(本市保安公司,分公司)包含经纬度
     * @return
     */
    List<InformationVO> getSecurityUnitPositionInfo();
    /**
     * 根据辖区查询保安公司分页信息(本市保安公司,分公司)
     * @param page  分页条件
     * @param information 查询条件
     * @return
     */
    IPage<InformationVO> getSecurityUnitInfoPage(IPage<InformationVO> page, InformationVO information);
    /**
     * 根据辖区查询统计保安公司持证情况分页信息(本市保安公司,分公司)
     * @param page  分页条件
     * @param information 查询条件
     * @return
     */
    IPage<InformationVO> getSecurityUnitHoldInfoPage(IPage<InformationVO> page, InformationVO information);
    /**
     * 根据辖区查询统计保安公司持证率低于50%的保安公司个数及保安公司分页信息(本市保安公司,分公司)
     * @param page  分页条件
     * @param information 查询条件
     * @return
     */
    IPage<InformationVO> getSecurityUnitHoldLess50Page(IPage<InformationVO> page, InformationVO information);
    /**
     * 根据辖区查询统计保安公司派遣率低于50%的保安公司个数及保安公司分页信息(本市保安公司,分公司)
     * @param page  分页条件
     * @param information 查询条件
     * @return
     */
    IPage<InformationVO> getSecurityUnitDispatcherLess50Page(IPage<InformationVO> page, InformationVO information);
    /**
     * 根据辖区查询统计保安公司社保缴纳率低于50%的保安公司个数及保安公司分页信息(本市保安公司,分公司)
     * @param page  分页条件
     * @param information 查询条件
     * @return
     */
    IPage<InformationVO> getSecurityUnitSoilLess50Page(IPage<InformationVO> page, InformationVO information);
    /**
     * 根据辖区查询统计保安公司考试通过率低于50%的保安公司个数及保安公司分页信息(本市保安公司,分公司)
     * @param page  分页条件
     * @param information 查询条件
     * @return
     */
    IPage<InformationVO> getSecurityUnitExamLess50Page(IPage<InformationVO> page, InformationVO information);
}
src/main/java/org/springblade/modules/information/service/impl/InformationServiceImpl.java
@@ -286,5 +286,78 @@
        return baseMapper.seleJuList(substring);
    }
    /**
     * 获取保安公司信息(本市保安公司,分公司)包含经纬度
     * @return
     */
    @Override
    public List<InformationVO> getSecurityUnitPositionInfo() {
        return baseMapper.getSecurityUnitPositionInfo();
    }
    /**
     * 根据辖区查询保安公司分页信息(本市保安公司,分公司)
     * @param page  分页条件
     * @param information 查询条件
     * @return
     */
    @Override
    public IPage<InformationVO> getSecurityUnitInfoPage(IPage<InformationVO> page, InformationVO information) {
        return page.setRecords(baseMapper.getSecurityUnitInfoPage(page, information));
    }
    /**
     * 根据辖区查询统计保安公司持证情况分页信息(本市保安公司,分公司)
     * @param page  分页条件
     * @param information 查询条件
     * @return
     */
    @Override
    public IPage<InformationVO> getSecurityUnitHoldInfoPage(IPage<InformationVO> page, InformationVO information) {
        return page.setRecords(baseMapper.getSecurityUnitHoldInfoPage(page, information));
    }
    /**
     * 根据辖区查询统计保安公司持证率低于50%的保安公司个数及保安公司分页信息(本市保安公司,分公司)
     * @param page  分页条件
     * @param information 查询条件
     * @return
     */
    @Override
    public IPage<InformationVO> getSecurityUnitHoldLess50Page(IPage<InformationVO> page, InformationVO information) {
        return page.setRecords(baseMapper.getSecurityUnitLess50Page(page,1,information));
    }
    /**
     * 根据辖区查询统计保安公司派遣率低于50%的保安公司个数及保安公司分页信息(本市保安公司,分公司)
     * @param page  分页条件
     * @param information 查询条件
     * @return
     */
    @Override
    public IPage<InformationVO> getSecurityUnitDispatcherLess50Page(IPage<InformationVO> page, InformationVO information) {
        return page.setRecords(baseMapper.getSecurityUnitLess50Page(page,2, information));
    }
    /**
     * 根据辖区查询统计保安公司社保缴纳率低于50%的保安公司个数及保安公司分页信息(本市保安公司,分公司)
     * @param page  分页条件
     * @param information 查询条件
     * @return
     */
    @Override
    public IPage<InformationVO> getSecurityUnitSoilLess50Page(IPage<InformationVO> page, InformationVO information) {
        return page.setRecords(baseMapper.getSecurityUnitLess50Page(page,3, information));
    }
    /**
     * 根据辖区查询统计保安公司考试通过率低于50%的保安公司个数及保安公司分页信息(本市保安公司,分公司)
     * @param page  分页条件
     * @param information 查询条件
     * @return
     */
    @Override
    public IPage<InformationVO> getSecurityUnitExamLess50Page(IPage<InformationVO> page, InformationVO information) {
        return page.setRecords(baseMapper.getSecurityUnitExamLess50Page(page, information));
    }
}
src/main/java/org/springblade/modules/information/vo/InformationVO.java
@@ -36,4 +36,9 @@
    private String cnum;
    private String pnum;
    private String deptName;
    /**
     * 辖区名称
     */
    private String jurisdictionName;
}
src/main/java/org/springblade/modules/system/mapper/UserMapper.xml
@@ -159,9 +159,6 @@
        si.departmentid = bu.dept_id
        where is_deleted = 0
        and status = 1
        and bd.parent_id!=1425365577303621633
        and bd.id != 1425365577303621633
        and bd.id != 1432625856013971457
        <if test="user.realName!=null and user.realName != ''">
            and bu.real_name like concat(concat('%', #{user.realName}),'%')
        </if>
src/main/java/org/springblade/modules/training/entity/TrainingRegistration.java
@@ -121,4 +121,10 @@
    @TableField("audit_status")
    private Integer auditStatus;
    /**
     * 考试等级
     */
    @TableField("train_level")
    private String trainLevel;
}
src/main/java/org/springblade/modules/training/mapper/TrainingRegistrationMapper.xml
@@ -5,7 +5,7 @@
    <!--报名培训分页信息-->
    <select id="selectTrainingRegistrationPage" resultType="org.springblade.modules.training.vo.TrainingRegistrationVo">
        SELECT
        sr.id,sr.training_time TrainingTime,sr.cancel,
        sr.id,sr.training_time TrainingTime,sr.cancel,sr.train_level trainLevel,
        bt.dept_name AS deptName,
        bt0.dept_name AS trainUnitName,
        bu.real_name realName,bu.phone,bu.cardid idCardNo,bu.sex,bu.height,bu.education,