zhanghua
2023-03-31 5d1d4b8516c6071a4bb69ba507f6d23eb73e8a67
驾驶舱接口优化
8个文件已修改
1个文件已添加
176 ■■■■ 已修改文件
document/驾驶舱数据接口文档(ai物联和综合决策).docx 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/controller/cockpit/statisticsEvents/StatisticsEventsController.java 37 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/entity/cockpitManage/TeamConstruction.java 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/entity/cockpitManage/TeamIndex.java 41 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/mapper/cockpitManage/TeamConstructionMapper.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/service/cockpitManage/ITeamConstructionService.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/service/cockpitManage/impl/TeamConstructionServiceImpl.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/resources/application-dev.yml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/resources/mapper/cockpitManage/TeamConstructionMapper.xml 49 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
document/¼ÝÊ»²ÕÊý¾Ý½Ó¿ÚÎĵµ£¨aiÎïÁªºÍ×ۺϾö²ß£©.docx
Binary files differ
ycl-platform/src/main/java/com/ycl/controller/cockpit/statisticsEvents/StatisticsEventsController.java
@@ -216,18 +216,35 @@
    @GetMapping("/team_index")
    public CommonResult<List<TeamIndex>> teamIndex(@Validated CockpitVO params) {
        checkApiUtil.cockpit(params);
        LambdaQueryWrapper<TeamConstruction> queryWrapper = new LambdaQueryWrapper<TeamConstruction>().eq(TeamConstruction::getStatus, 1).eq(TeamConstruction::getIsDelete, 0);
        List<TeamConstruction> list = teamConstructionService.list(queryWrapper);
        List<TeamIndex> teamIndexList = BeanUtil.copyToList(list, TeamIndex.class);
        // LambdaQueryWrapper<TeamConstruction> queryWrapper = new LambdaQueryWrapper<TeamConstruction>().eq(TeamConstruction::getStatus, 1).eq(TeamConstruction::getIsDelete, 0);
        // List<TeamConstruction> list = teamConstructionService.list(queryWrapper);
        // List<TeamIndex> teamIndexList = BeanUtil.copyToList(list, TeamIndex.class);
        // teamIndexList.forEach(o -> {
        //     o.setStepTimely(0.0);
        //     o.setStepDelayed(0.0);
        //     o.setStepOvertime(0.0);
        //     o.setHandleTimely(0.0);
        //     o.setHandleDelayed(0.0);
        //     o.setHandleOvertime(0.0);
        //     o.setNoHandle(0.0);
        // });
        List<TeamIndex> teamIndexList = teamConstructionService.teamIndex(params.getBeginTime(), params.getEndTime());
        teamIndexList.forEach(o -> {
            o.setStepTimely(0.6);
            o.setStepDelayed(0.3);
            o.setStepOvertime(0.1);
            o.setHandleTimely(0.6);
            o.setHandleDelayed(0.2);
            o.setHandleOvertime(0.1);
            o.setNoHandle(0.1);
            o.setAllocation(20 * ((double) o.getPunctualityCount() / (double) o.getAllCount())
                    + 18 * ((double) o.getOverCount() / (double) o.getAllCount())
                    + 15 * ((double) o.getNoHandleCount() / (double) o.getAllCount()));
            o.setHandle(20 * ((double) o.getPunctualityCount() / (double) o.getAllCount())
                    + 5 * ((double) o.getOverCount() / (double) o.getAllCount())
                    - 2 * ((double) o.getNoHandleCount() / (double) o.getAllCount()));
            o.setOnline(0.0);
            o.setDuration(0.0);
            o.setDistance(0.0);
        });
        return CommonResult.success(teamIndexList);
    }
}
ycl-platform/src/main/java/com/ycl/entity/cockpitManage/TeamConstruction.java
@@ -56,73 +56,79 @@
    private Integer upUndergraduatePeopleNumber;
    /**
     * æœ¬ç§‘学历及以上人数
     * æŒè¯äººæ•°
     */
    @TableField("holder_number")
    @ExcelProperty(value = "持证人数", index = 3)
    private Integer holderNumber;
    /**
     * æ‰§æ³•人员总数
     */
    @TableField("law_enforcement_officer")
    @ExcelProperty(value = "执法人员总数", index = 4)
    private Integer lawEnforcementOfficer;
    /**
     * 45岁以下人数
     */
    @TableField("under_forty_five_people_number")
    @ExcelProperty(value = "45岁以下人数", index = 4)
    @ExcelProperty(value = "45岁以下人数", index = 5)
    private Integer underFortyFivePeopleNumber;
    /**
     * æ³•律职业资格证人数
     */
    @TableField("legal_professional_qualification_certificate_people_number")
    @ExcelProperty(value = "法律职业资格证人数", index = 5)
    @ExcelProperty(value = "法律职业资格证人数", index = 6)
    private Integer legalProfessionalQualificationCertificatePeopleNumber;
    /**
     * é€šæŠ¥æ•°é‡
     */
    @TableField("report_number")
    @ExcelProperty(value = "通报数量", index = 6)
    @ExcelProperty(value = "通报数量", index = 7)
    private Integer reportNumber;
    /**
     * è¿çºªè¡Œä¸ºæ•°é‡
     */
    @TableField("disciplinary_offence_number")
    @ExcelProperty(value = "违纪行为数量", index = 7)
    @ExcelProperty(value = "违纪行为数量", index = 8)
    private Integer disciplinaryOffenceNumber;
    /**
     * è¿æ³•犯罪行为数量
     */
    @TableField("criminal_offense_number")
    @ExcelProperty(value = "违法犯罪行为数量", index = 8)
    @ExcelProperty(value = "违法犯罪行为数量", index = 9)
    private Integer criminalOffenseNumber;
    /**
     * æ¯æœˆæ¡ˆä»¶æ•°é‡
     */
    @TableField("month_case_number")
    @ExcelProperty(value = "每月案件数量", index = 9)
    @ExcelProperty(value = "每月案件数量", index = 10)
    private Integer monthCaseNumber;
    /**
     * æ¯æœˆæ¡ˆä»¶æ•°é‡
     */
    @TableField("month_index_number")
    @ExcelProperty(value = "每月指标数", index = 10)
    @ExcelProperty(value = "每月指标数", index = 11)
    private Integer monthIndexNumber;
    /**
     * æœªè¶…时案件数量
     */
    @TableField("no_timeout_case_number")
    @ExcelProperty(value = "未超时案件数量", index = 11)
    @ExcelProperty(value = "未超时案件数量", index = 12)
    private Integer noTimeoutCaseNumber;
    /**
     * å¤è¯‰æˆ–诉讼数量
     */
    @TableField("review_or_lawsuit_number")
    @ExcelProperty(value = "复诉或诉讼数量", index = 12)
    @ExcelProperty(value = "复诉或诉讼数量", index = 13)
    private Integer reviewOrLawsuitNumber;
    /**
@@ -152,4 +158,9 @@
    @TableField("update_time")
    @ExcelIgnore
    private LocalDateTime updateTime;
    @TableField("region_id")
    @ExcelIgnore
    private Long regionId;
}
ycl-platform/src/main/java/com/ycl/entity/cockpitManage/TeamIndex.java
@@ -22,7 +22,6 @@
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("ums_team_construction")
public class TeamIndex extends TeamConstruction implements Serializable {
    private Double stepTimely;
@@ -33,4 +32,44 @@
    private Double handleOvertime;
    private Double noHandle;
    /**
     * æŽ¥æ”¶åˆ°å±€ä¿¡æ¯æŒ‡æŒ¥ä¸­å¿ƒä¸‹æ´¾ä»»åŠ¡ï¼Œå—ç†å¹¶åˆ†æ´¾æ—¶æ•ˆ
     */
    private Double allocation;
    /**
     * å¤„置人员接受分派后的处理速度
     */
    private Double handle;
    /**
     * ä¸­é˜Ÿé˜Ÿå‘˜æ‰§æ³•记录仪每日在线率
     */
    private Double online;
    /**
     * ä¸­é˜Ÿé˜Ÿå‘˜æ‰§æ³•记录仪每日平均时长
     */
    private Double duration;
    /**
     * ä¸­é˜Ÿé˜Ÿå‘˜æ‰§æ³•记录仪每日平均归集距离
     */
    private Double distance;
    /**
     * æ¡ˆä»¶æ€»æ•°
     */
    private Integer allCount;
    /**
     * å‡†æ—¶æ¡ˆä»¶
     */
    private Integer punctualityCount;
    /**
     * è¶…时案件
     */
    private Integer overCount;
    /**
     * æœªå¤„理案件
     */
    private Integer noHandleCount;
}
ycl-platform/src/main/java/com/ycl/mapper/cockpitManage/TeamConstructionMapper.java
@@ -2,6 +2,10 @@
import com.ycl.entity.cockpitManage.TeamConstruction;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ycl.entity.cockpitManage.TeamIndex;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
 * <p>
@@ -13,4 +17,5 @@
 */
public interface TeamConstructionMapper extends BaseMapper<TeamConstruction> {
    List<TeamIndex> teamIndex(@Param("beginTime") String beginTime, @Param("endTime") String endTime);
}
ycl-platform/src/main/java/com/ycl/service/cockpitManage/ITeamConstructionService.java
@@ -2,6 +2,9 @@
import com.ycl.entity.cockpitManage.TeamConstruction;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ycl.entity.cockpitManage.TeamIndex;
import java.util.List;
/**
 * <p>
@@ -13,4 +16,5 @@
 */
public interface ITeamConstructionService extends IService<TeamConstruction> {
    List<TeamIndex> teamIndex(String beginTime, String endTime);
}
ycl-platform/src/main/java/com/ycl/service/cockpitManage/impl/TeamConstructionServiceImpl.java
@@ -1,10 +1,13 @@
package com.ycl.service.cockpitManage.impl;
import com.ycl.entity.cockpitManage.TeamConstruction;
import com.ycl.entity.cockpitManage.TeamIndex;
import com.ycl.mapper.cockpitManage.TeamConstructionMapper;
import com.ycl.service.cockpitManage.ITeamConstructionService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import java.util.List;
/**
 * <p>
@@ -17,4 +20,8 @@
@Service
public class TeamConstructionServiceImpl extends ServiceImpl<TeamConstructionMapper, TeamConstruction> implements ITeamConstructionService {
    @Override
    public List<TeamIndex> teamIndex(String beginTime, String endTime) {
        return baseMapper.teamIndex(beginTime, endTime);
    }
}
ycl-platform/src/main/resources/application-dev.yml
@@ -35,7 +35,7 @@
        timeout: 0
  datasource:
    url: jdbc:mysql://42.193.1.25:3306/sccg0318?useUnicode=true&characterEncoding=utf8&autoReconnect=true&useSSL=false
    url: jdbc:mysql://42.193.1.25:3306/sccg?useUnicode=true&characterEncoding=utf8&autoReconnect=true&useSSL=false
    username: root
    password: 321$YcYl@1970!
    type: com.alibaba.druid.pool.DruidDataSource
ycl-platform/src/main/resources/mapper/cockpitManage/TeamConstructionMapper.xml
New file
@@ -0,0 +1,49 @@
<?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.ycl.mapper.cockpitManage.TeamConstructionMapper">
    <!-- é€šç”¨æŸ¥è¯¢æ˜ å°„结果 -->
    <resultMap id="BaseResultMap" type="com.ycl.entity.cockpitManage.TeamConstruction">
        <id column="id" property="id"/>
        <result column="name" property="name"/>
        <result column="people_number" property="peopleNumber"/>
        <result column="up_undergraduate_people_number" property="upUndergraduatePeopleNumber"/>
        <result column="under_forty_five_people_number" property="underFortyFivePeopleNumber"/>
        <result column="legal_professional_qualification_certificate_people_number"
                property="legalProfessionalQualificationCertificatePeopleNumber"/>
        <result column="report_number" property="reportNumber"/>
        <result column="disciplinary_offence_number" property="disciplinaryOffenceNumber"/>
        <result column="criminal_offense_number" property="criminalOffenseNumber"/>
        <result column="month_case_number" property="monthCaseNumber"/>
        <result column="month_index_number" property="monthIndexNumber"/>
        <result column="no_timeout_case_number" property="noTimeoutCaseNumber"/>
        <result column="review_or_lawsuit_number" property="reviewOrLawsuitNumber"/>
        <result column="holder_number" property="holderNumber"/>
        <result column="law_enforcement_officer" property="lawEnforcementOfficer"/>
    </resultMap>
    <resultMap id="VOMap" extends="BaseResultMap" type="com.ycl.entity.cockpitManage.TeamIndex">
        <result column="all_count" property="allCount"/>
        <result column="no_handle_count" property="noHandleCount"/>
        <result column="over_count" property="overCount"/>
        <result column="punctuality_count" property="punctualityCount"/>
    </resultMap>
    <select id="teamIndex" resultMap="VOMap">
        SELECT tc.id,tc.name,  tc.people_number,  tc.up_undergraduate_people_number,  tc.under_forty_five_people_number,  tc.legal_professional_qualification_certificate_people_number,  tc.report_number,  tc.disciplinary_offence_number,tc.criminal_offense_number,  tc.month_case_number,  tc.month_index_number,  tc.no_timeout_case_number,tc.review_or_lawsuit_number,  tc.holder_number,  tc.law_enforcement_officer ,
        count(bc.id) all_count,
        sum(case WHEN (dr.state =1 and (dr.limit_time > dr.end_time or dr.limit_time is null) ) THEN 1 ELSE 0 END) punctuality_count,
        sum(case WHEN (dr.state =1 and dr.limit_time &lt; dr.end_time and dr.end_time is not null ) THEN 1 ELSE 0 END) over_count,
        sum(case WHEN (dr.state =1 and dr.limit_time &lt; dr.end_time and dr.end_time is null ) THEN 1 ELSE 0 END) no_handle_count
        from ums_team_construction tc
        LEFT JOIN ums_base_case bc on tc.region_id = bc.street_id
        <if test="beginTime!=null and beginTime!=''">
            and bc.alarm_time between #{beginTime} and #{endTime}
        </if>
        LEFT JOIN ums_dispose_record dr on bc.id = dr.base_case_id
        GROUP BY tc.id,tc.name,  tc.people_number,  tc.up_undergraduate_people_number,  tc.under_forty_five_people_number,  tc.legal_professional_qualification_certificate_people_number,  tc.report_number,  tc.disciplinary_offence_number,tc.criminal_offense_number,  tc.month_case_number,  tc.month_index_number,  tc.no_timeout_case_number,tc.review_or_lawsuit_number,  tc.holder_number,  tc.law_enforcement_officer
    </select>
</mapper>