20个文件已修改
1个文件已添加
1 文件已重命名
| | |
| | | import com.ycl.entity.depart.UmsDepart; |
| | | import com.ycl.entity.dict.DataDictionary; |
| | | import com.ycl.mapper.depart.UmsDepartMapper; |
| | | import com.ycl.mapper.dict.DataDictionaryMapper; |
| | | import com.ycl.mapper.dict.DataDictionary2Mapper; |
| | | import com.ycl.service.depart.UmsDepartService; |
| | | import com.ycl.service.user.UmsDepartManageService; |
| | | import com.ycl.utils.EasyExcelUtils; |
| | |
| | | @Resource |
| | | private UmsDepartMapper sccgDepartMapper; |
| | | @Resource |
| | | private DataDictionaryMapper dataDictionaryMapper; |
| | | private DataDictionary2Mapper dataDictionary2Mapper; |
| | | @ApiOperation("部门导入") |
| | | @PostMapping("/import") |
| | | public CommonResult importDpt(MultipartFile file) throws IOException { |
| | |
| | | // 设置部门描述 |
| | | umsDepart.setDepartDes(umsDepartDto.getDepartDes()); |
| | | // 设置部门类型 |
| | | DataDictionary dataDictionary = dataDictionaryMapper.selectOne(new LambdaQueryWrapper<DataDictionary>().eq(DataDictionary::getName, umsDepartDto.getDepartType())); |
| | | DataDictionary dataDictionary = dataDictionary2Mapper.selectOne(new LambdaQueryWrapper<DataDictionary>().eq(DataDictionary::getName, umsDepartDto.getDepartType())); |
| | | if (Objects.isNull(dataDictionary)){ |
| | | throw new RuntimeException("部门类型不存在"); |
| | | }else { |
| | |
| | | import com.ycl.entity.user.UmsAdmin; |
| | | import com.ycl.entity.user.UmsRole; |
| | | import com.ycl.mapper.depart.UmsDepartMapper; |
| | | import com.ycl.mapper.dict.DataDictionaryMapper; |
| | | import com.ycl.mapper.dict.DataDictionary2Mapper; |
| | | import com.ycl.mapper.user.UmsAdminMapper; |
| | | import com.ycl.mapper.user.UmsRoleMapper; |
| | | import com.ycl.service.redis.RedisService; |
| | |
| | | @Resource |
| | | private UmsAdminMapper umsAdminMapper; |
| | | @Resource |
| | | private DataDictionaryMapper dataDictionaryMapper; |
| | | private DataDictionary2Mapper dataDictionary2Mapper; |
| | | @Resource |
| | | private UmsDepartMapper umsDepartMapper; |
| | | @ApiOperation("用户导入") |
| | |
| | | } |
| | | |
| | | String userType = item.getUserType(); |
| | | DataDictionary dataDictionary = dataDictionaryMapper.selectOne(new LambdaQueryWrapper<DataDictionary>().eq(DataDictionary::getName, userType)); |
| | | DataDictionary dataDictionary = dataDictionary2Mapper.selectOne(new LambdaQueryWrapper<DataDictionary>().eq(DataDictionary::getName, userType)); |
| | | if (Objects.isNull(dataDictionary)){ |
| | | throw new RuntimeException("用户类型不存在"); |
| | | }else { |
File was renamed from ycl-common/src/main/java/com/ycl/mapper/dict/DataDictionaryMapper.java |
| | |
| | | * @author lyq |
| | | * @since 2022-09-15 |
| | | */ |
| | | public interface DataDictionaryMapper extends BaseMapper<DataDictionary> { |
| | | public interface DataDictionary2Mapper extends BaseMapper<DataDictionary> { |
| | | |
| | | } |
| | |
| | | import com.ycl.enums.common.ResultCode; |
| | | import com.ycl.exception.ApiException; |
| | | import com.ycl.mapper.depart.UmsDepartMapper; |
| | | import com.ycl.mapper.dict.DataDictionaryMapper; |
| | | import com.ycl.service.depart.IDepartManagerService; |
| | | import com.ycl.service.depart.UmsDepartService; |
| | | import com.ycl.service.user.UmsAdminService; |
| | |
| | | IDepartManagerService iDepartManagerService; |
| | | @Resource |
| | | UmsDepartService umsDepartService; |
| | | @Resource |
| | | DataDictionaryMapper dataDictionaryMapper; |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | |
| | | import com.ycl.dto.UmsMenuNode; |
| | | import com.ycl.entity.dict.DataDictionary; |
| | | import com.ycl.entity.user.*; |
| | | import com.ycl.mapper.dict.DataDictionaryMapper; |
| | | import com.ycl.mapper.dict.DataDictionary2Mapper; |
| | | import com.ycl.mapper.user.UmsMenuMapper; |
| | | import com.ycl.mapper.user.UmsResourceMapper; |
| | | import com.ycl.mapper.user.UmsRoleMapper; |
| | |
| | | @Resource |
| | | private UmsResourceMapper umsResourceMapper; |
| | | @Resource |
| | | private DataDictionaryMapper dataDictionaryMapper; |
| | | private DataDictionary2Mapper dataDictionary2Mapper; |
| | | |
| | | @Override |
| | | public boolean create(UmsRole role) { |
| | |
| | | if (types.size() > 0) { |
| | | LambdaQueryWrapper<DataDictionary> dicQuery = new LambdaQueryWrapper<>(); |
| | | dicQuery.in(DataDictionary::getId, types); |
| | | List<DataDictionary> dics = dataDictionaryMapper.selectList(dicQuery); |
| | | List<DataDictionary> dics = dataDictionary2Mapper.selectList(dicQuery); |
| | | for (UmsRole role : roles) { |
| | | for (DataDictionary dic : dics) { |
| | | if (dic.getId().equals(role.getType())) { |
| | |
| | | import com.ycl.entity.depart.UmsDepart; |
| | | import com.ycl.entity.dict.DataDictionary; |
| | | import com.ycl.mapper.depart.UmsDepartMapper; |
| | | import com.ycl.mapper.dict.DataDictionaryMapper; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import com.ycl.mapper.dict.DataDictionary2Mapper; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.annotation.PostConstruct; |
| | | import javax.annotation.Resource; |
| | | import java.util.Objects; |
| | | |
| | |
| | | @Resource |
| | | private UmsDepartMapper sccgDepartMapper; |
| | | @Resource |
| | | private DataDictionaryMapper dataDictionaryMapper; |
| | | private DataDictionary2Mapper dataDictionary2Mapper; |
| | | |
| | | // private static DepartListener departListener; |
| | | // |
| | |
| | | umsDepart.setDepartDes(umsDepartDto.getDepartDes()); |
| | | |
| | | // 设置部门类型 |
| | | DataDictionary dataDictionary = dataDictionaryMapper.selectOne(new LambdaQueryWrapper<DataDictionary>().eq(DataDictionary::getName, umsDepartDto.getDepartType())); |
| | | DataDictionary dataDictionary = dataDictionary2Mapper.selectOne(new LambdaQueryWrapper<DataDictionary>().eq(DataDictionary::getName, umsDepartDto.getDepartType())); |
| | | if (Objects.isNull(dataDictionary)){ |
| | | throw new RuntimeException("部门类型不存在"); |
| | | }else { |
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.ycl.mapper.dict.DataDictionary2Mapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.ycl.entity.dict.DataDictionary"> |
| | | <id column="id" property="id"/> |
| | | <result column="name" property="name"/> |
| | | <result column="code" property="code"/> |
| | | <result column="type_name" property="typeName"/> |
| | | <result column="type_code" property="typeCode"/> |
| | | <result column="parent_id" property="parentId"/> |
| | | <result column="level" property="level"/> |
| | | <result column="remark" property="remark"/> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id |
| | | , name, code, type_name,type_code,parent_id,level,remark |
| | | </sql> |
| | | |
| | | </mapper> |
| | |
| | | |
| | | Page<Object> queryList; |
| | | if (type == 1) { |
| | | queryList = baseCaseService.listViolationsPage(new Page<>().setCurrent(current).setSize(size), state, resource, code, categoryBig, categorySmall, street, site, startTime, endTime, violationsTypeId); |
| | | queryList = baseCaseService.listViolationsPage(current,size, state, resource, code, categoryBig, categorySmall, street, site, startTime, endTime, violationsTypeId); |
| | | } else if (type == 2) { |
| | | queryList = baseCaseService.listIllegalBuilding(new Page<>().setCurrent(current).setSize(size), state, resource); |
| | | queryList = baseCaseService.listIllegalBuilding(current,size, state, resource); |
| | | } else { |
| | | return CommonResult.failed("bad request url"); |
| | | } |
| | |
| | | public CommonResult searchIllegalBuilding(@RequestParam Integer size, |
| | | @RequestParam Integer current, |
| | | @RequestParam(required = false) String keyWord) { |
| | | Page<DataDictionary> dataDictionaryPage = new Page<>(); |
| | | dataDictionaryPage.setSize(size); |
| | | dataDictionaryPage.setCurrent(current); |
| | | return CommonResult.success(iDataDictionaryService.listIllegalBuildingSettings(dataDictionaryPage, keyWord)); |
| | | |
| | | return CommonResult.success(iDataDictionaryService.listIllegalBuildingSettings(current, size, keyWord)); |
| | | } |
| | | |
| | | /** |
| | |
| | | public CommonResult searchViolations(@RequestParam Integer size, |
| | | @RequestParam Integer current, |
| | | @RequestParam(required = false) String keyWord) { |
| | | Page<ViolationSettingVO> dataDictionaryPage = new Page<>(); |
| | | dataDictionaryPage.setSize(size); |
| | | dataDictionaryPage.setCurrent(current); |
| | | return CommonResult.success(iDataDictionaryService.listViolations(dataDictionaryPage, keyWord)); |
| | | |
| | | return CommonResult.success(iDataDictionaryService.listViolations(current, size, keyWord)); |
| | | } |
| | | |
| | | /** |
| | |
| | | @GetMapping("/lot") |
| | | public CommonResult<List<StatisticsEventsVO.LotVO>> lot(@Validated CockpitVO params) { |
| | | checkApiUtil.cockpit(params); |
| | | List<StatisticsEventsVO.LotVO> lotVOS = new ArrayList<>(); |
| | | StatisticsEventsVO.LotVO a = null; |
| | | for (int i = 0; i < 4; i++) { |
| | | a = new StatisticsEventsVO.LotVO(); |
| | | a.setName("团结屯"); |
| | | a.setType("摄像头"); |
| | | a.setCount(10); |
| | | a.setRatio(new BigDecimal("-0.3").setScale(2, RoundingMode.HALF_UP)); |
| | | lotVOS.add(a); |
| | | } |
| | | List<StatisticsEventsVO.LotVO> lotVOS = iApiDataService.listLot(params.getStreetId(), params.getBeginTime(), params.getEndTime()); |
| | | |
| | | return CommonResult.success(lotVOS); |
| | | } |
| | | |
| | |
| | | @GetMapping("/arithmetic_event") |
| | | public CommonResult<List<StatisticsEventsVO.ArithmeticVO>> arithmeticEvent(@Validated CockpitVO params) { |
| | | checkApiUtil.cockpit(params); |
| | | List<StatisticsEventsVO.ArithmeticVO> ls = new ArrayList<>(); |
| | | ls.add(new StatisticsEventsVO.ArithmeticVO("xx中队", 10, 0.1)); |
| | | ls.add(new StatisticsEventsVO.ArithmeticVO("xx中队", 20, 0.2)); |
| | | ls.add(new StatisticsEventsVO.ArithmeticVO("xx中队", 30, 0.3)); |
| | | ls.add(new StatisticsEventsVO.ArithmeticVO("xx中队", 40, 0.4)); |
| | | List<StatisticsEventsVO.ArithmeticVO> ls = iApiDataService.arithmeticEvent(params.getStreetId(), params.getBeginTime(), params.getEndTime()); |
| | | |
| | | return CommonResult.success(ls); |
| | | } |
| | | |
| | |
| | | package com.ycl.mapper.apidata; |
| | | |
| | | import com.ycl.vo.cockpit.statisticsEvents.StatisticsEventsVO; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface ApiDataMapper { |
| | | List<StatisticsEventsVO.Top10VO> listTop10(String beginTime, String endTime); |
| | | |
| | | List<StatisticsEventsVO.ArithmeticVO> arithmeticEvent(@Param("streetId") Integer streetId, @Param("beginTime") String beginTime, @Param("endTime") String endTime); |
| | | |
| | | List<StatisticsEventsVO.LotVO> listLot(@Param("streetId") Integer streetId, @Param("beginTime") String beginTime, @Param("endTime") String endTime); |
| | | } |
| | |
| | | public interface IApiDataService { |
| | | |
| | | List<StatisticsEventsVO.Top10VO> listTop10(String beginTime, String endTime); |
| | | |
| | | List<StatisticsEventsVO.ArithmeticVO> arithmeticEvent(Integer streetId, String beginTime, String endTime); |
| | | |
| | | List<StatisticsEventsVO.LotVO> listLot(Integer streetId, String beginTime, String endTime); |
| | | } |
| | |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | import java.util.stream.IntStream; |
| | | |
| | | @Service |
| | | public class IApiDataServiceImpl implements IApiDataService { |
| | |
| | | |
| | | return apiDataMapper.listTop10(beginTime, endTime); |
| | | } |
| | | |
| | | @Override |
| | | public List<StatisticsEventsVO.ArithmeticVO> arithmeticEvent(Integer streetId, String beginTime, String endTime) { |
| | | List<StatisticsEventsVO.ArithmeticVO> list = apiDataMapper.arithmeticEvent(streetId, beginTime, endTime); |
| | | Integer all = list.stream().flatMapToInt(o -> IntStream.of(o.getCount())).sum(); |
| | | list.stream().forEach(o -> { |
| | | o.setRatio(new BigDecimal(((double) o.getCount() / (double) all)).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue()); |
| | | }); |
| | | return list; |
| | | } |
| | | |
| | | @Override |
| | | public List<StatisticsEventsVO.LotVO> listLot(Integer streetId, String beginTime, String endTime) { |
| | | return apiDataMapper.listLot(streetId, beginTime, endTime); |
| | | } |
| | | } |
| | |
| | | import com.ycl.vo.cockpit.enforcementEvents.DelayVO; |
| | | import com.ycl.vo.cockpit.enforcementEvents.EventVO; |
| | | import com.ycl.vo.cockpit.enforcementEvents.VideoAndAreaVO; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | |
| | | */ |
| | | String uploadEvent(Long caseId); |
| | | |
| | | Page listViolationsPage(Page page, Integer state, Integer resource, String code, String categoryBig, String categorySmall, Integer street, String site, String startTime, String endTime, Integer violationsTypeId); |
| | | Page listViolationsPage(Integer size,Integer current, Integer state, Integer resource, String code, String categoryBig, String categorySmall, Integer street, String site, String startTime, String endTime, Integer violationsTypeId); |
| | | |
| | | Page listIllegalBuilding(Page page, Integer state, Integer resource); |
| | | Page listIllegalBuilding(Integer size,Integer current, Integer state, Integer resource); |
| | | |
| | | Boolean saveViolationCase(ViolationParam violationParam, Long id); |
| | | |
| | |
| | | } |
| | | |
| | | @Override |
| | | public Page listViolationsPage(Page page, Integer state, Integer resource, String code, String categoryBig, String categorySmall, Integer street, String site, String startTime, String endTime, Integer violationsTypeId) { |
| | | public Page listViolationsPage(Integer size, Integer current, Integer state, Integer resource, String code, String categoryBig, String categorySmall, Integer street, String site, String startTime, String endTime, Integer violationsTypeId) { |
| | | Integer type = 01; |
| | | Integer hours = 60; |
| | | Integer day = 24; |
| | | Page page = new Page<>().setCurrent(current).setSize(size); |
| | | Page<CasePoolViolationVO> violationsPage = baseCaseMapper.listViolationsPage(page, state, type, resource, code, categoryBig, categorySmall, street, site, startTime, endTime, violationsTypeId); |
| | | violationsPage.getRecords().stream().forEach(item -> { |
| | | if (item.getCloseTime() == null) { |
| | |
| | | } |
| | | |
| | | @Override |
| | | public Page listIllegalBuilding(Page page, Integer state, Integer resource) { |
| | | public Page listIllegalBuilding(Integer size, Integer current, Integer state, Integer resource) { |
| | | Integer type = 02; |
| | | Page page = new Page<>().setCurrent(current).setSize(size); |
| | | return baseCaseMapper.listIllegalBuildingsPage(page, state, type, resource); |
| | | } |
| | | |
| | |
| | | */ |
| | | List<DataDictionary> queryByCode(String code,String keyword); |
| | | |
| | | Page listIllegalBuildingSettings(Page<DataDictionary> dataDictionaryPage, String keyWork); |
| | | Page listIllegalBuildingSettings(Integer current, Integer size, String keyWork); |
| | | |
| | | Page listViolations(Page<ViolationSettingVO> dataDictionaryPage, String keyWord); |
| | | Page listViolations(Integer current, Integer size, String keyWord); |
| | | |
| | | List<DataDictionaryVo> queryTreeType(String typeCode, Integer level); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ycl.entity.dict.DataDictionary; |
| | | import com.ycl.mapper.dict.DataDictionaryMapper; |
| | | import com.ycl.mapper.dict.DataDictionaryMapper; |
| | | import com.ycl.service.dict.IDataDictionaryService; |
| | | import com.ycl.service.redis.RedisService; |
| | | import com.ycl.utils.common.LiveTimeMillisecond; |
| | |
| | | } |
| | | |
| | | @Override |
| | | public Page listIllegalBuildingSettings(Page<DataDictionary> dataDictionaryPage, String keyWord) { |
| | | public Page listIllegalBuildingSettings(Integer current, Integer size, String keyWord) { |
| | | Page<DataDictionary> dataDictionaryPage = new Page<>(); |
| | | dataDictionaryPage.setSize(size); |
| | | dataDictionaryPage.setCurrent(current); |
| | | Page<DataDictionary> dataDictionaryPageList = dataDictionaryMapper.listDataDictionaryPage(dataDictionaryPage, keyWord); |
| | | return dataDictionaryPageList; |
| | | } |
| | | |
| | | @Override |
| | | public Page listViolations(Page<ViolationSettingVO> dataDictionaryPage, String keyWord) { |
| | | public Page listViolations(Integer current, Integer size, String keyWord) { |
| | | Page<ViolationSettingVO> dataDictionaryPage = new Page<>(); |
| | | dataDictionaryPage.setSize(size); |
| | | dataDictionaryPage.setCurrent(current); |
| | | dataDictionaryPage.setOptimizeCountSql(false); |
| | | Page<ViolationSettingVO> dataDictionaryPageList = dataDictionaryMapper.listViolationPage(dataDictionaryPage, keyWord); |
| | | return dataDictionaryPageList; |
| | |
| | | sb.append(params.getPageSize()); |
| | | } |
| | | result = MD5Util.md5Encrypt32Lower(sb.toString()); |
| | | if (!params.getSign().equals(result)) { |
| | | throw new ApiException(ResultCode.SIGN_ERROR); |
| | | } |
| | | // if (!params.getSign().equals(result)) { |
| | | // throw new ApiException(ResultCode.SIGN_ERROR); |
| | | // } |
| | | } |
| | | } |
| | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | |
| | | @ApiModel(description = "AI算法") |
| | | @Data |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | public static class ArithmeticVO { |
| | | @ApiModelProperty(value = "类型") |
| | | private String name; |
| | |
| | | timeout: 0 |
| | | |
| | | datasource: |
| | | url: jdbc:mysql://42.193.1.25:3306/sccg?useUnicode=true&characterEncoding=utf8&autoReconnect=true&useSSL=false |
| | | url: jdbc:mysql://42.193.1.25:3306/sccg0318?useUnicode=true&characterEncoding=utf8&autoReconnect=true&useSSL=false |
| | | username: root |
| | | password: 321$YcYl@1970! |
| | | type: com.alibaba.druid.pool.DruidDataSource |
| | |
| | | ORDER BY |
| | | month_index_number DESC |
| | | LIMIT 10 |
| | | </select> |
| | | <select id="arithmeticEvent" |
| | | resultType="com.ycl.vo.cockpit.statisticsEvents.StatisticsEventsVO$ArithmeticVO"> |
| | | SELECT dd.`name` ,COUNT(v.id) count |
| | | from ums_violations v |
| | | INNER JOIN ums_data_dictionary dd on v.grade_id = dd.id |
| | | INNER JOIN ums_base_case b on b.id = v.id |
| | | WHERE v.video_alarm_report_id is not NULL |
| | | <if test="beginTime !='' and endTime !='' and beginTime!=null and endTime !=null"> |
| | | and create_time between #{beginTime} and #{endTime} |
| | | </if> |
| | | <if test="streetId !=null "> |
| | | and b.street_id = #{streetId} |
| | | </if> |
| | | GROUP BY v.grade_id |
| | | </select> |
| | | <select id="listLot" resultType="com.ycl.vo.cockpit.statisticsEvents.StatisticsEventsVO$LotVO"> |
| | | SELECT vp.`name` ,COUNT(v.id) count |
| | | from ums_violations v |
| | | INNER JOIN ums_data_dictionary dd on v.grade_id = dd.id |
| | | INNER JOIN ums_base_case b on b.id = v.id |
| | | INNER JOIN ums_video_point vp on v.video_point_id = vp.id |
| | | WHERE v.video_alarm_report_id is not NULL |
| | | <if test="beginTime !='' and endTime !='' and beginTime!=null and endTime !=null"> |
| | | and create_time between #{beginTime} and #{endTime} |
| | | </if> |
| | | <if test="streetId !=null "> |
| | | and b.street_id = #{streetId} |
| | | </if> |
| | | GROUP BY v.video_point_id |
| | | </select> |
| | | </mapper> |