Merge branch 'dev' of http://221.0.232.152:9393/ability-center/share-platform into dev
* 'dev' of http://221.0.232.152:9393/ability-center/share-platform: 补充置顶状态与置顶时间 屮 全局搜索统计各类型能力数量 ... .. .. 增加置顶接口 排序修改 sql ... 增加能力置顶字段 parallelStream 使用自定义 ForkJoinPool防止任务堆积 屮 ... ... 会议室功能后端开发
This commit is contained in:
commit
ed20fbd0a4
|
@ -0,0 +1,7 @@
|
|||
ALTER TABLE `tb_data_resource`
|
||||
ADD COLUMN `pin_top` int NULL COMMENT '是否置顶' ,
|
||||
ADD COLUMN `pin_top_time` datetime NULL COMMENT '置顶操作时间';
|
||||
|
||||
UPDATE tb_data_resource
|
||||
SET pin_top = 0,
|
||||
pin_top_time = NOW();
|
|
@ -0,0 +1,49 @@
|
|||
package io.renren.common.utils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* list分页工具
|
||||
*/
|
||||
public class PageUtil {
|
||||
/**
|
||||
* 手动分页类
|
||||
* @param datas
|
||||
* @param pageSize
|
||||
* @param pageNo
|
||||
* @param <T>
|
||||
* @return
|
||||
*/
|
||||
public static <T> List<T> getPageSizeDataForRelations(List<T> datas,int pageSize,int pageNo){
|
||||
int startNum = (pageNo-1)* pageSize+1 ; //起始截取数据位置
|
||||
if(startNum > datas.size()){
|
||||
return null;
|
||||
}
|
||||
List<T> res = new ArrayList<>();
|
||||
int rum = datas.size() - startNum;
|
||||
if(rum < 0){
|
||||
return null;
|
||||
}
|
||||
if(rum == 0){ //说明正好是最后一个了
|
||||
int index = datas.size() -1;
|
||||
res.add(datas.get(index));
|
||||
return res;
|
||||
}
|
||||
if(rum / pageSize >= 1){ //剩下的数据还够1页,返回整页的数据
|
||||
for(int i=startNum;i<startNum + pageSize;i++){ //截取从startNum开始的数据
|
||||
res.add(datas.get(i-1));
|
||||
}
|
||||
return res;
|
||||
}else if((rum / pageSize == 0) && rum > 0){ //不够一页,直接返回剩下数据
|
||||
for(int j = startNum ;j<=datas.size();j++){
|
||||
res.add(datas.get(j-1));
|
||||
}
|
||||
return res;
|
||||
}else{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,120 @@
|
|||
package io.renren.modules.meeting.controller;
|
||||
|
||||
import io.renren.common.annotation.LogOperation;
|
||||
import io.renren.common.constant.Constant;
|
||||
import io.renren.common.page.PageData;
|
||||
import io.renren.common.utils.Result;
|
||||
import io.renren.common.validator.ValidatorUtils;
|
||||
import io.renren.common.validator.group.AddGroup;
|
||||
import io.renren.common.validator.group.DefaultGroup;
|
||||
import io.renren.common.validator.group.UpdateGroup;
|
||||
import io.renren.modules.meeting.dto.TMeetingroomBookDTO;
|
||||
import io.renren.modules.meeting.dto.TMeetingroomDTO;
|
||||
import io.renren.modules.meeting.service.TMeetingroomBookService;
|
||||
import io.renren.modules.meeting.service.TMeetingroomService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import springfox.documentation.annotations.ApiIgnore;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.text.ParseException;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Api(tags="预约会议室")
|
||||
@RestController
|
||||
@RequestMapping("bookMeeting")
|
||||
public class BookMeetingRoomController {
|
||||
|
||||
@Resource
|
||||
private TMeetingroomBookService tMeetingroomBookService;
|
||||
@Resource
|
||||
private TMeetingroomService tMeetingroomService;
|
||||
|
||||
@GetMapping("list")
|
||||
@ApiOperation("搜索可以预约的会议室")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = Constant.PAGE, value = "当前页码,从1开始", paramType = "query", required = true, dataType="int") ,
|
||||
@ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query",required = true, dataType="int") ,
|
||||
@ApiImplicitParam(name = "name", value = "会议室名称", paramType = "query", dataType="String") ,
|
||||
@ApiImplicitParam(name = "bookDate", value = "预约开始时间", paramType = "query", dataType="String") ,
|
||||
@ApiImplicitParam(name = "startTime", value = "预约开始时间", paramType = "query", dataType="String") ,
|
||||
@ApiImplicitParam(name = "endTime", value = "预约结束时间", paramType = "query", dataType="String") ,
|
||||
})
|
||||
public Result<PageData<TMeetingroomDTO>> list(@ApiIgnore @RequestParam Map<String, Object> params){
|
||||
PageData<TMeetingroomDTO> list = tMeetingroomService.selectFreeRoom(params);
|
||||
return new Result<PageData<TMeetingroomDTO>>().ok(list);
|
||||
}
|
||||
|
||||
@GetMapping("page")
|
||||
@ApiOperation("分页查询预约记录")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = Constant.PAGE, value = "当前页码,从1开始", paramType = "query", required = true, dataType="int") ,
|
||||
@ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query",required = true, dataType="int") ,
|
||||
@ApiImplicitParam(name = "roomName", value = "会议室名称", paramType = "query", dataType="String") ,
|
||||
})
|
||||
public Result<PageData<TMeetingroomBookDTO>> page(@ApiIgnore @RequestParam Map<String, Object> params){
|
||||
PageData<TMeetingroomBookDTO> page = tMeetingroomBookService.queryList(params);
|
||||
return new Result<PageData<TMeetingroomBookDTO>>().ok(page);
|
||||
}
|
||||
|
||||
@GetMapping("availableDate")
|
||||
@ApiOperation("根据日期获取会议室当天的可用时段")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "roomId", value = "会议室主键", paramType = "query", required = true, dataType="int") ,
|
||||
@ApiImplicitParam(name = "date", value = "查询的天数", paramType = "query", required = true, dataType="String") ,
|
||||
})
|
||||
public Result<List<String>> availableDate(@ApiIgnore @RequestParam Map<String, Object> params) throws ParseException {
|
||||
List<String> stringList = tMeetingroomBookService.queryFreeForDate(params);
|
||||
return new Result<List<String>>().ok(stringList);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@ApiOperation("新增预约")
|
||||
@LogOperation("新增")
|
||||
public Result save(@RequestBody TMeetingroomBookDTO dto){
|
||||
//效验数据
|
||||
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
|
||||
if (tMeetingroomBookService.checkBookRepeat(dto)){
|
||||
return new Result().error("该会议室在预申请时段已经存在申请会议,请申请其他会议室或者选择其他时段");
|
||||
}
|
||||
dto.setState(1);
|
||||
tMeetingroomBookService.save(dto);
|
||||
return new Result();
|
||||
}
|
||||
|
||||
@GetMapping("{id}")
|
||||
@ApiOperation("查看预约信息")
|
||||
public Result<TMeetingroomBookDTO> get(@PathVariable("id") Long id){
|
||||
TMeetingroomBookDTO data = tMeetingroomBookService.get(id);
|
||||
return new Result<TMeetingroomBookDTO>().ok(data);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@GetMapping("auditPage")
|
||||
@ApiOperation("分页查询预约记录(管理端)")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = Constant.PAGE, value = "当前页码,从1开始", paramType = "query", required = true, dataType="int") ,
|
||||
@ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query",required = true, dataType="int") ,
|
||||
@ApiImplicitParam(name = "roomName", value = "会议室名称", paramType = "query", dataType="String") ,
|
||||
@ApiImplicitParam(name = "state", value = "预约状态", paramType = "query", dataType="int") ,
|
||||
})
|
||||
public Result<PageData<TMeetingroomBookDTO>> auditPage(@ApiIgnore @RequestParam Map<String, Object> params){
|
||||
PageData<TMeetingroomBookDTO> page = tMeetingroomBookService.queryAuditList(params);
|
||||
return new Result<PageData<TMeetingroomBookDTO>>().ok(page);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@ApiOperation("审核预约")
|
||||
@LogOperation("修改")
|
||||
public Result update(@RequestBody TMeetingroomBookDTO dto){
|
||||
//效验数据
|
||||
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
|
||||
tMeetingroomBookService.update(dto);
|
||||
return new Result();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,78 @@
|
|||
package io.renren.modules.meeting.controller;
|
||||
|
||||
import java.util.Map;
|
||||
import javax.annotation.Resource;
|
||||
import io.renren.common.annotation.LogOperation;
|
||||
import io.renren.common.constant.Constant;
|
||||
import io.renren.common.page.PageData;
|
||||
import io.renren.common.utils.Result;
|
||||
import io.renren.common.validator.ValidatorUtils;
|
||||
import io.renren.common.validator.group.AddGroup;
|
||||
import io.renren.common.validator.group.DefaultGroup;
|
||||
import io.renren.common.validator.group.UpdateGroup;
|
||||
import io.renren.modules.meeting.dto.TMeetingroomDTO;
|
||||
import io.renren.modules.meeting.service.TMeetingroomService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
|
||||
|
||||
import springfox.documentation.annotations.ApiIgnore;
|
||||
|
||||
@Api(tags="会议室")
|
||||
@RestController
|
||||
@RequestMapping("meeting")
|
||||
public class MeetingroomController {
|
||||
|
||||
@Resource
|
||||
private TMeetingroomService meetingroomService;
|
||||
|
||||
|
||||
@GetMapping("page")
|
||||
@ApiOperation("分页")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = Constant.PAGE, value = "当前页码,从1开始", paramType = "query", required = true, dataType="int") ,
|
||||
@ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query",required = true, dataType="int") ,
|
||||
@ApiImplicitParam(name = "name", value = "会议室名称", paramType = "query",dataType="String") ,
|
||||
})
|
||||
public Result<PageData<TMeetingroomDTO>> page(@ApiIgnore @RequestParam Map<String, Object> params){
|
||||
PageData<TMeetingroomDTO> page = meetingroomService.queryList(params);
|
||||
return new Result<PageData<TMeetingroomDTO>>().ok(page);
|
||||
}
|
||||
|
||||
@GetMapping("{id}")
|
||||
@ApiOperation("信息")
|
||||
public Result<TMeetingroomDTO> get(@PathVariable("id") Long id){
|
||||
TMeetingroomDTO data = meetingroomService.get(id);
|
||||
return new Result<TMeetingroomDTO>().ok(data);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@ApiOperation("新增")
|
||||
@LogOperation("新增")
|
||||
public Result save(@RequestBody TMeetingroomDTO dto){
|
||||
//效验数据
|
||||
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
|
||||
|
||||
if (meetingroomService.checkMeetingRepeat(dto.getName())){
|
||||
return new Result().error("已经存在相同名称的会议室,请勿重复新增");
|
||||
}
|
||||
meetingroomService.save(dto);
|
||||
return new Result();
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@ApiOperation("修改、删除")
|
||||
@LogOperation("修改")
|
||||
public Result update(@RequestBody TMeetingroomDTO dto){
|
||||
//效验数据
|
||||
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
|
||||
meetingroomService.update(dto);
|
||||
return new Result();
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,37 @@
|
|||
package io.renren.modules.meeting.dao;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import io.renren.common.dao.BaseDao;
|
||||
import io.renren.modules.meeting.dto.TMeetingroomBookDTO;
|
||||
import io.renren.modules.meeting.entity.TMeetingroomBook;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
@Mapper
|
||||
public interface TMeetingroomBookMapper extends BaseDao<TMeetingroomBook> {
|
||||
|
||||
List<TMeetingroomBookDTO> selectByRoomAndTime(@Param("roomId") Long roomId,
|
||||
@Param("bookDate") String bookDate,
|
||||
@Param("startTime") String startTime,
|
||||
@Param("endTime") String endTime);
|
||||
|
||||
int queryCountByRoomName(@Param("userId") Long userId,
|
||||
@Param("roomName") String roomName);
|
||||
|
||||
List<TMeetingroomBookDTO> queryList(@Param("currentNum") int currentNum,
|
||||
@Param("pageSize")int pageSizeint,
|
||||
@Param("userId") Long userId,
|
||||
@Param("roomName") String roomName);
|
||||
|
||||
int queryCountByState(@Param("roomName") String roomName,
|
||||
@Param("state") Integer state);
|
||||
|
||||
List<TMeetingroomBookDTO> queryListForAudit(@Param("currentNum") int currentNum,
|
||||
@Param("pageSize") int pageSize,
|
||||
@Param("roomName")String roomName,
|
||||
@Param("state")Integer state);
|
||||
|
||||
List<TMeetingroomBook> selectInvalid(Date date);
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
package io.renren.modules.meeting.dao;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import io.renren.common.dao.BaseDao;
|
||||
import io.renren.modules.meeting.dto.TMeetingroomDTO;
|
||||
import io.renren.modules.meeting.entity.TMeetingroom;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
|
||||
@Mapper
|
||||
public interface TMeetingroomMapper extends BaseDao<TMeetingroom> {
|
||||
|
||||
int queryCount(String name);
|
||||
|
||||
List<TMeetingroomDTO> queryList(@Param("currentNum") int currentNum,
|
||||
@Param("pageSize")int pageSize,
|
||||
@Param("name")String name);
|
||||
|
||||
List<TMeetingroomDTO> selectByName(String name);
|
||||
|
||||
}
|
|
@ -0,0 +1,56 @@
|
|||
package io.renren.modules.meeting.dto;
|
||||
|
||||
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.util.Date;
|
||||
|
||||
|
||||
|
||||
@Data
|
||||
@ApiModel(value = "会议室预约")
|
||||
public class TMeetingroomBookDTO implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "主键,新增时不传")
|
||||
private Long id;
|
||||
@ApiModelProperty(value = "会议室id")
|
||||
private Long roomId;
|
||||
@ApiModelProperty(value = "预约时间,请传时间格式为2000-01-01")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private Date bookDate;
|
||||
@JsonFormat(pattern = "HH:mm:ss")
|
||||
@ApiModelProperty(value = "预约开始时间,请传时间格式为12:00:00")
|
||||
private Date startTime;
|
||||
@JsonFormat(pattern = "HH:mm:ss")
|
||||
@ApiModelProperty(value = "预约结束时间,请传时间格式为12:00:00")
|
||||
private Date endTime;
|
||||
@ApiModelProperty(value = "预约人")
|
||||
private String name;
|
||||
@ApiModelProperty(value = "联系电话")
|
||||
private String phone;
|
||||
@ApiModelProperty(value = "预约部门")
|
||||
private String dept;
|
||||
@ApiModelProperty(value = "使用事项")
|
||||
private String matter;
|
||||
@ApiModelProperty(value = "附件")
|
||||
private String file;
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private Date createDate;
|
||||
@ApiModelProperty(value = "创建者")
|
||||
private Long creator;
|
||||
@ApiModelProperty(value = "审核状态,审核时传,2-通过,3-不通过")
|
||||
private Integer state;
|
||||
@ApiModelProperty(value = "审核意见")
|
||||
private String auditViem;
|
||||
@ApiModelProperty(value = "审核者,审核时传")
|
||||
private Long auditor;
|
||||
@ApiModelProperty(value = "审核时间")
|
||||
private Date auditTime;
|
||||
|
||||
private String roomName;
|
||||
}
|
|
@ -0,0 +1,44 @@
|
|||
package io.renren.modules.meeting.dto;
|
||||
|
||||
import io.renren.common.entity.BaseEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 会议室
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(value = "会议室表")
|
||||
public class TMeetingroomDTO implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "主键,新增时不传")
|
||||
private Long id;
|
||||
@ApiModelProperty(value = "房间号")
|
||||
private String num;
|
||||
@ApiModelProperty(value = "名称")
|
||||
private String name;
|
||||
@ApiModelProperty(value = "面积")
|
||||
private String area;
|
||||
@ApiModelProperty(value = "可容纳人数")
|
||||
private Integer capacity;
|
||||
@ApiModelProperty(value = "会议室图片")
|
||||
private String pic;
|
||||
@ApiModelProperty(value = "描述")
|
||||
private String description;
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private Date createTime;
|
||||
@ApiModelProperty(value = "修改时间,修改和删除时传")
|
||||
private Date modifyTime;
|
||||
@ApiModelProperty(value = "创建人")
|
||||
private Long creator;
|
||||
@ApiModelProperty(value = "修改人,修改和删除时传")
|
||||
private Long modifier;
|
||||
@ApiModelProperty(value = "是否删除,0-未删除,1-删除")
|
||||
private Integer delFlag;
|
||||
|
||||
}
|
|
@ -0,0 +1,40 @@
|
|||
package io.renren.modules.meeting.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.renren.common.entity.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 会议室
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper=false)
|
||||
@TableName("t_meetingroom")
|
||||
public class TMeetingroom extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 房间号 */
|
||||
private String num;
|
||||
/** 名称 */
|
||||
private String name;
|
||||
/** 面积 */
|
||||
private String area;
|
||||
/** 可容纳人数 */
|
||||
private Integer capacity;
|
||||
/** 会议室图片 */
|
||||
private String pic;
|
||||
/** 描述 */
|
||||
private String description;
|
||||
/** 修改时间 */
|
||||
@TableField(fill = FieldFill.UPDATE)
|
||||
private Date modifyTime;
|
||||
|
||||
private Integer delFlag;
|
||||
@TableField(fill = FieldFill.UPDATE)
|
||||
private Long modifier;
|
||||
}
|
|
@ -0,0 +1,47 @@
|
|||
package io.renren.modules.meeting.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.renren.common.entity.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 会议室预约
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper=false)
|
||||
@TableName("t_meetingroom_book")
|
||||
public class TMeetingroomBook extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 会议室id */
|
||||
private Long roomId;
|
||||
private Date bookDate;
|
||||
/** 预约开始时间 */
|
||||
private Date startTime;
|
||||
/** 预约结束时间 */
|
||||
private Date endTime;
|
||||
/** 预约人 */
|
||||
private String name;
|
||||
/** 联系电话 */
|
||||
private String phone;
|
||||
/** 预约部门 */
|
||||
private String dept;
|
||||
/** 使用事项 */
|
||||
private String matter;
|
||||
/** 附件 */
|
||||
private String file;
|
||||
/** 审核状态 */
|
||||
private Integer state;
|
||||
/** 审核意见 */
|
||||
private String auditViem;
|
||||
/** 审核者 */
|
||||
private Long auditor;
|
||||
/** 审核时间 */
|
||||
@TableField(fill = FieldFill.UPDATE)
|
||||
private Date auditTime;
|
||||
}
|
|
@ -0,0 +1,161 @@
|
|||
package io.renren.modules.meeting.service.Impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import io.renren.common.page.PageData;
|
||||
import io.renren.common.service.impl.CrudServiceImpl;
|
||||
import io.renren.modules.meeting.dao.TMeetingroomBookMapper;
|
||||
import io.renren.modules.meeting.dao.TMeetingroomMapper;
|
||||
import io.renren.modules.meeting.dto.TMeetingroomBookDTO;
|
||||
import io.renren.modules.meeting.dto.TMeetingroomDTO;
|
||||
import io.renren.modules.meeting.entity.TMeetingroom;
|
||||
import io.renren.modules.meeting.entity.TMeetingroomBook;
|
||||
import io.renren.modules.meeting.service.TMeetingroomBookService;
|
||||
import io.renren.modules.meeting.service.TMeetingroomService;
|
||||
import io.renren.modules.security.user.SecurityUser;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collector;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
public class TMeetingroomBookServiceImpl extends CrudServiceImpl<TMeetingroomBookMapper, TMeetingroomBook, TMeetingroomBookDTO> implements TMeetingroomBookService {
|
||||
|
||||
@Resource
|
||||
private TMeetingroomBookMapper tMeetingroomBookMapper;
|
||||
|
||||
@Override
|
||||
public PageData<TMeetingroomBookDTO> queryList(Map<String, Object> params) {
|
||||
Long userId = SecurityUser.getUserId();
|
||||
//分页参数
|
||||
int page = 1;
|
||||
int pageSize = 10;
|
||||
if(params.containsKey("limit") && StringUtils.isNotBlank(params.get("limit").toString())){
|
||||
pageSize = Integer.parseInt(params.get("limit").toString());
|
||||
}
|
||||
if(params.containsKey("page") && StringUtils.isNotBlank(params.get("page").toString())){
|
||||
page = Integer.parseInt(params.get("page").toString());
|
||||
}
|
||||
int currentNum = (page-1)*pageSize;
|
||||
|
||||
String roomName = null;
|
||||
if(params.containsKey("roomName") && StringUtils.isNotBlank(params.get("roomName").toString())){
|
||||
roomName = params.get("roomName").toString();
|
||||
}
|
||||
|
||||
|
||||
int count = tMeetingroomBookMapper.queryCountByRoomName(userId,roomName);
|
||||
List<TMeetingroomBookDTO> list = tMeetingroomBookMapper.queryList(currentNum,pageSize,userId,roomName);
|
||||
|
||||
return new PageData<>(list,count);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> queryFreeForDate(Map<String, Object> params) throws ParseException {
|
||||
List<String> free = new ArrayList<>();
|
||||
Long roomId = Long.valueOf(params.get("roomId").toString());
|
||||
|
||||
if(!params.containsKey("date")){
|
||||
return free;
|
||||
}
|
||||
|
||||
String date = params.get("date").toString();
|
||||
List<TMeetingroomBookDTO> tMeetingroomBookDTOS = tMeetingroomBookMapper.selectByRoomAndTime(roomId,date+" 00:00:00",
|
||||
"1970-01-01 00:00:00","1970-01-01 23:59:59");
|
||||
if (CollectionUtils.isEmpty(tMeetingroomBookDTOS)){
|
||||
free.add("00:00:00 - 23:59:59");
|
||||
} else {
|
||||
// 将所有预约的开始时间和结束时间都整理成列表
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss");
|
||||
List<Date> startList = tMeetingroomBookDTOS.stream().map(TMeetingroomBookDTO::getStartTime).collect(Collectors.toList());
|
||||
List<Date> endList = tMeetingroomBookDTOS.stream().map(TMeetingroomBookDTO::getEndTime).collect(Collectors.toList());
|
||||
|
||||
Date zero = sdf.parse("00:00:00");
|
||||
for (int i = 0; i < startList.size(); i++){
|
||||
Date start = startList.get(i);
|
||||
if (zero.before(start)){
|
||||
free.add(sdf.format(zero) + " - " + sdf.format(start));
|
||||
}
|
||||
|
||||
zero = endList.get(i);
|
||||
if (i == startList.size()-1){
|
||||
// 最后一次
|
||||
free.add(sdf.format(endList.get(i)) + " - 23:59:59");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return free;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageData<TMeetingroomBookDTO> queryAuditList(Map<String, Object> params) {
|
||||
//分页参数
|
||||
int page = 1;
|
||||
int pageSize = 10;
|
||||
if(params.containsKey("limit") && StringUtils.isNotBlank(params.get("limit").toString())){
|
||||
pageSize = Integer.parseInt(params.get("limit").toString());
|
||||
}
|
||||
if(params.containsKey("page") && StringUtils.isNotBlank(params.get("page").toString())){
|
||||
page = Integer.parseInt(params.get("page").toString());
|
||||
}
|
||||
int currentNum = (page-1)*pageSize;
|
||||
|
||||
String roomName = null;
|
||||
if(params.containsKey("roomName") && StringUtils.isNotBlank(params.get("roomName").toString())){
|
||||
roomName = params.get("roomName").toString();
|
||||
}
|
||||
|
||||
Integer state = null;
|
||||
if (params.containsKey("state") && StringUtils.isNotBlank(params.get("state").toString())){
|
||||
state = Integer.valueOf(params.get("state").toString());
|
||||
}
|
||||
|
||||
int count = tMeetingroomBookMapper.queryCountByState(roomName,state);
|
||||
List<TMeetingroomBookDTO> list = tMeetingroomBookMapper.queryListForAudit(currentNum,pageSize,roomName,state);
|
||||
|
||||
return new PageData<>(list,count);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkBookRepeat(TMeetingroomBookDTO tMeetingroomBookDTO) {
|
||||
boolean flag = false;
|
||||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
||||
SimpleDateFormat timeFormat = new SimpleDateFormat("HH:mm:ss");
|
||||
|
||||
List<TMeetingroomBookDTO> tMeetingroomBookDTOS = tMeetingroomBookMapper.selectByRoomAndTime(tMeetingroomBookDTO.getRoomId(),
|
||||
dateFormat.format(tMeetingroomBookDTO.getBookDate())+" 00:00:00",
|
||||
"1970-01-01 "+timeFormat.format(tMeetingroomBookDTO.getStartTime()),
|
||||
"1970-01-01 "+timeFormat.format(tMeetingroomBookDTO.getEndTime()));
|
||||
if (CollectionUtils.isNotEmpty(tMeetingroomBookDTOS)){
|
||||
flag = true;
|
||||
}
|
||||
|
||||
return flag;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public QueryWrapper<TMeetingroomBook> getWrapper(Map<String, Object> params) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public void updateInvalidBook(){
|
||||
// 获得当日的日期,将本日之前的,预约状态为申请中的预约更新为状态4(已失效)
|
||||
Date date = new Date();
|
||||
List<TMeetingroomBook> tMeetingroomBooks = tMeetingroomBookMapper.selectInvalid(date);
|
||||
for (TMeetingroomBook tMeetingroomBook : tMeetingroomBooks){
|
||||
tMeetingroomBook.setState(4);
|
||||
tMeetingroomBookMapper.updateById(tMeetingroomBook);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,121 @@
|
|||
package io.renren.modules.meeting.service.Impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import io.renren.common.page.PageData;
|
||||
import io.renren.common.service.impl.CrudServiceImpl;
|
||||
import io.renren.common.utils.PageUtil;
|
||||
import io.renren.modules.meeting.dao.TMeetingroomBookMapper;
|
||||
import io.renren.modules.meeting.dao.TMeetingroomMapper;
|
||||
import io.renren.modules.meeting.dto.TMeetingroomBookDTO;
|
||||
import io.renren.modules.meeting.dto.TMeetingroomDTO;
|
||||
import io.renren.modules.meeting.entity.TMeetingroom;
|
||||
import io.renren.modules.meeting.service.TMeetingroomService;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
public class TMeetingroomServiceImpl extends CrudServiceImpl<TMeetingroomMapper, TMeetingroom, TMeetingroomDTO> implements TMeetingroomService {
|
||||
|
||||
@Resource
|
||||
private TMeetingroomMapper tMeetingroomMapper;
|
||||
@Resource
|
||||
private TMeetingroomBookMapper tMeetingroomBookMapper;
|
||||
|
||||
@Override
|
||||
public PageData<TMeetingroomDTO> queryList(Map<String, Object> params) {
|
||||
//分页参数
|
||||
int page = 1;
|
||||
int pageSize = 10;
|
||||
if(params.containsKey("limit") && StringUtils.isNotBlank(params.get("limit").toString())){
|
||||
pageSize = Integer.parseInt(params.get("limit").toString());
|
||||
}
|
||||
if(params.containsKey("page") && StringUtils.isNotBlank(params.get("page").toString())){
|
||||
page = Integer.parseInt(params.get("page").toString());
|
||||
}
|
||||
int currentNum = (page-1)*pageSize;
|
||||
|
||||
String name = null;
|
||||
if (params.containsKey("name") && StringUtils.isNotBlank(params.get("name").toString())){
|
||||
name = params.get("name").toString();
|
||||
}
|
||||
|
||||
int count = tMeetingroomMapper.queryCount(name);
|
||||
List<TMeetingroomDTO> list = tMeetingroomMapper.queryList(currentNum,pageSize,name);
|
||||
|
||||
return new PageData<>(list,count);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageData<TMeetingroomDTO> selectFreeRoom(Map<String, Object> params) {
|
||||
int page = 1;
|
||||
int pageSize = 10;
|
||||
if(params.containsKey("limit") && StringUtils.isNotBlank(params.get("limit").toString())){
|
||||
pageSize = Integer.parseInt(params.get("limit").toString());
|
||||
}
|
||||
if(params.containsKey("page") && StringUtils.isNotBlank(params.get("page").toString())){
|
||||
page = Integer.parseInt(params.get("page").toString());
|
||||
}
|
||||
String name = null;
|
||||
if (params.containsKey("name") && StringUtils.isNotBlank(params.get("name").toString())){
|
||||
name = params.get("name").toString();
|
||||
}
|
||||
|
||||
String bookDate = null;
|
||||
if (params.containsKey("bookDate") && StringUtils.isNotBlank(params.get("bookDate").toString())){
|
||||
bookDate = params.get("bookDate").toString();
|
||||
}
|
||||
|
||||
String startTime = "";
|
||||
if (params.containsKey("startTime") && StringUtils.isNotBlank(params.get("startTime").toString())){
|
||||
startTime = params.get("startTime").toString();
|
||||
}
|
||||
|
||||
String endTime = "";
|
||||
if (params.containsKey("endTime") && StringUtils.isNotBlank(params.get("endTime").toString())){
|
||||
endTime = params.get("endTime").toString();
|
||||
}
|
||||
|
||||
List<TMeetingroomDTO> tMeetingroomDTOS = tMeetingroomMapper.selectByName(name);
|
||||
|
||||
String finalBookDate = bookDate + " 00:00:00";
|
||||
String finalStartTime = "1970-01-01 "+startTime;
|
||||
String finalEndTime = "1970-01-01 "+endTime;
|
||||
tMeetingroomDTOS = tMeetingroomDTOS.stream().filter(room -> {
|
||||
// 根据时间段去预约表搜,如果搜不到,那就芜湖起飞
|
||||
boolean flag = false;
|
||||
List<TMeetingroomBookDTO> meetingroomBookDTOS = tMeetingroomBookMapper.selectByRoomAndTime(room.getId(), finalBookDate,
|
||||
finalStartTime, finalEndTime);
|
||||
if (CollectionUtils.isEmpty(meetingroomBookDTOS)){
|
||||
flag = true;
|
||||
}
|
||||
return flag;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
List<TMeetingroomDTO> pageSizeDataForRelations = PageUtil.getPageSizeDataForRelations(tMeetingroomDTOS, pageSize, page);
|
||||
|
||||
return new PageData<>(pageSizeDataForRelations,tMeetingroomDTOS.size());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkMeetingRepeat(String name) {
|
||||
boolean flag = false;
|
||||
|
||||
int count = tMeetingroomMapper.queryCount(name);
|
||||
if (count > 0){
|
||||
flag = true;
|
||||
}
|
||||
|
||||
return flag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public QueryWrapper<TMeetingroom> getWrapper(Map<String, Object> params) {
|
||||
return null;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
package io.renren.modules.meeting.service;
|
||||
|
||||
import io.renren.common.page.PageData;
|
||||
import io.renren.common.service.CrudService;
|
||||
import io.renren.modules.meeting.dto.TMeetingroomBookDTO;
|
||||
import io.renren.modules.meeting.entity.TMeetingroomBook;
|
||||
|
||||
import java.text.ParseException;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public interface TMeetingroomBookService extends CrudService<TMeetingroomBook, TMeetingroomBookDTO> {
|
||||
|
||||
PageData<TMeetingroomBookDTO> queryList(Map<String, Object> params);
|
||||
|
||||
List<String> queryFreeForDate(Map<String, Object> params) throws ParseException;
|
||||
|
||||
PageData<TMeetingroomBookDTO> queryAuditList(Map<String, Object> params);
|
||||
|
||||
boolean checkBookRepeat(TMeetingroomBookDTO tMeetingroomBookDTO);
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
package io.renren.modules.meeting.service;
|
||||
|
||||
import io.renren.common.page.PageData;
|
||||
import io.renren.common.service.CrudService;
|
||||
import io.renren.modules.meeting.dto.TMeetingroomDTO;
|
||||
import io.renren.modules.meeting.entity.TMeetingroom;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public interface TMeetingroomService extends CrudService<TMeetingroom, TMeetingroomDTO> {
|
||||
|
||||
PageData<TMeetingroomDTO> queryList(Map<String, Object> params);
|
||||
|
||||
PageData<TMeetingroomDTO> selectFreeRoom(Map<String, Object> params);
|
||||
|
||||
boolean checkMeetingRepeat(String name);
|
||||
}
|
||||
|
|
@ -1,8 +1,5 @@
|
|||
package io.renren.modules.monitor.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.google.common.collect.Lists;
|
||||
import io.renren.modules.monitor.dto.*;
|
||||
import io.renren.modules.monitor.entity.*;
|
||||
import io.renren.modules.monitor.mapper.*;
|
||||
|
@ -19,7 +16,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
@ -604,6 +600,21 @@ public class Controller {
|
|||
queryMap.replace("pageNum", (pageNum - 1) * pageSize);
|
||||
queryMap.replace("pageSize", pageSize);
|
||||
}
|
||||
//cgcs2000转为wgs84坐标
|
||||
//if (StringUtils.isNotBlank(queryMap.get("gpsY").toString())) {
|
||||
// String gpsY = queryMap.get("gpsY").toString();
|
||||
// String gpsX = queryMap.get("gpsX").toString();
|
||||
// if (gpsY.length() > 15) {
|
||||
// gpsY = gpsY.substring(0, gpsY.length() - 1);
|
||||
// }
|
||||
// if (gpsX.length() > 15) {
|
||||
// gpsX = gpsX.substring(0, gpsX.length() - 1);
|
||||
// }
|
||||
// double[] gps84 = CGS2000ToWGS84(Double.parseDouble(gpsY), Double.parseDouble(gpsX));
|
||||
// queryMap.replace("gpsY", String.valueOf(gps84[0]));
|
||||
// queryMap.replace("gpsX", String.valueOf(gps84[1]));
|
||||
//
|
||||
//}
|
||||
List<String> list1 = null;
|
||||
if (null != labelCodes && labelCodes.length > 0) {
|
||||
list1 = Arrays.asList(labelCodes);
|
||||
|
@ -622,6 +633,46 @@ public class Controller {
|
|||
|
||||
}
|
||||
|
||||
//2000转84
|
||||
public static double[] CGS2000ToWGS84(double X, double Y) {
|
||||
double L0 = 120.19;//中央子午线需根据实际情况设置
|
||||
double lat ,lon;
|
||||
Y-=500000;
|
||||
double [] result = new double[2];
|
||||
double iPI = 0.0174532925199433;//pi/180
|
||||
double a = 6378137.0; //长半轴 m
|
||||
double b = 6356752.31414; //短半轴 m
|
||||
double f = 1/298.257222101;//扁率 a-b/a
|
||||
double e = 0.0818191910428; //第一偏心率 Math.sqrt(5)
|
||||
double ee = Math.sqrt(a*a-b*b)/b; //第二偏心率
|
||||
double bf = 0; //底点纬度
|
||||
double a0 = 1+(3*e*e/4) + (45*e*e*e*e/64) + (175*e*e*e*e*e*e/256) + (11025*e*e*e*e*e*e*e*e/16384) + (43659*e*e*e*e*e*e*e*e*e*e/65536);
|
||||
double b0 = X/(a*(1-e*e)*a0);
|
||||
double c1 = 3*e*e/8 +3*e*e*e*e/16 + 213*e*e*e*e*e*e/2048 + 255*e*e*e*e*e*e*e*e/4096;
|
||||
double c2 = 21*e*e*e*e/256 + 21*e*e*e*e*e*e/256 + 533*e*e*e*e*e*e*e*e/8192;
|
||||
double c3 = 151*e*e*e*e*e*e*e*e/6144 + 151*e*e*e*e*e*e*e*e/4096;
|
||||
double c4 = 1097*e*e*e*e*e*e*e*e/131072;
|
||||
bf = b0 + c1*Math.sin(2*b0) + c2*Math.sin(4*b0) +c3*Math.sin(6*b0) + c4*Math.sin(8*b0); // bf =b0+c1*sin2b0 + c2*sin4b0 + c3*sin6b0 +c4*sin8b0 +...
|
||||
double tf = Math.tan(bf);
|
||||
double n2 = ee*ee*Math.cos(bf)*Math.cos(bf); //第二偏心率平方成bf余弦平方
|
||||
double c = a*a/b;
|
||||
double v=Math.sqrt(1+ ee*ee*Math.cos(bf)*Math.cos(bf));
|
||||
double mf = c/(v*v*v); //子午圈半径
|
||||
double nf = c/v;//卯酉圈半径
|
||||
|
||||
//纬度计算
|
||||
lat=bf-(tf/(2*mf)*Y)*(Y/nf) * (1-1/12*(5+3*tf*tf+n2-9*n2*tf*tf)*(Y*Y/(nf*nf))+1/360*(61+90*tf*tf+45*tf*tf*tf*tf)*(Y*Y*Y*Y/(nf*nf*nf*nf)));
|
||||
//经度偏差
|
||||
lon=1/(nf*Math.cos(bf))*Y -(1/(6*nf*nf*nf*Math.cos(bf)))*(1+2*tf*tf +n2)*Y*Y*Y + (1/(120*nf*nf*nf*nf*nf*Math.cos(bf)))*(5+28*tf*tf+24*tf*tf*tf*tf)*Y*Y*Y*Y*Y;
|
||||
result[0] =formatby6(lat/iPI);
|
||||
result[1] =formatby6(L0+lon/iPI);
|
||||
return result;
|
||||
}
|
||||
|
||||
private static double formatby6(double num) {
|
||||
return Double.parseDouble(String.format("%.6f", num));
|
||||
}
|
||||
|
||||
/**
|
||||
* 摄像头按照市区进行聚合查询
|
||||
*/
|
||||
|
@ -636,7 +687,7 @@ public class Controller {
|
|||
* 事件版的保存区域组织信息
|
||||
*/
|
||||
@GetMapping("/saveOrgenizationEvent")
|
||||
public Result saveOrgenizationEvent() throws Exception{
|
||||
public Result saveOrgenizationEvent() {
|
||||
monitorService.getAndSaveOrgenization();
|
||||
return Result.success();
|
||||
}
|
||||
|
|
|
@ -153,6 +153,16 @@ public class ResourceController {
|
|||
return new Result<>().ok(resourceService.pageWithAttrs(jsonObject, resourceService.selectDTOPageSpecilTotal(resourceDTO)));
|
||||
}
|
||||
|
||||
@PutMapping("/pin_top/{id}")
|
||||
@LogOperation(value = "置顶该能力资源")
|
||||
public Result pinTop(@PathVariable("id") Long id) {
|
||||
ResourceDTO data = resourceService.get(id);
|
||||
data.setPinTop(1);
|
||||
data.setPinTopTime(new Date());
|
||||
resourceService.update(data);
|
||||
return new Result<>().ok(id);
|
||||
}
|
||||
|
||||
@GetMapping("/{id}")
|
||||
@ApiOperation("查询能力资源详细信息")
|
||||
@LogOperation("查询能力资源详细信息")
|
||||
|
@ -253,7 +263,7 @@ public class ResourceController {
|
|||
if (!"f".equals(source) && dto.getId() != null) {//后台挂架直接上架
|
||||
try {
|
||||
apiGatewayService.registerApi2Gateway(dto.getId().toString());
|
||||
}catch (Exception exception){
|
||||
} catch (Exception exception) {
|
||||
//注册失败忽略,简单记录一下
|
||||
logger.error("挂接网关注册失败", exception);
|
||||
}
|
||||
|
@ -268,7 +278,7 @@ public class ResourceController {
|
|||
try {
|
||||
apiGatewayService.resetApiGroup(source);
|
||||
apiGatewayService.registerApi2Gateway(source);
|
||||
}catch (Exception exception){
|
||||
} catch (Exception exception) {
|
||||
//注册失败忽略,简单记录一下
|
||||
logger.error("挂接网关注册失败", exception);
|
||||
return new Result().error(exception.getMessage());
|
||||
|
@ -594,5 +604,12 @@ public class ResourceController {
|
|||
return new Result<>().ok(resourceService.selectAppList(params));
|
||||
}
|
||||
|
||||
@GetMapping("/getCountByFuzzyQuery")
|
||||
@ApiOperation("获取各类资源模糊查询总数")
|
||||
@LogOperation("获取各类资源模糊查询总数")
|
||||
public Result getCountByFuzzyQuery(@RequestParam String keyWorld) {
|
||||
return new Result<>().ok(resourceService.getCountByFuzzyQuery(keyWorld));
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -174,4 +174,6 @@ public interface ResourceDao extends BaseDao<ResourceEntity> {
|
|||
List<Map> selectAppList(@Param("pageNum") int pageNum, @Param("type") Integer type);
|
||||
|
||||
String selectPicByResId(@Param("id") String id);
|
||||
|
||||
List<Map> selectTypeCountByName(@Param("keyWorld") String keyWorld);
|
||||
}
|
|
@ -116,6 +116,12 @@ public class ResourceDTO extends AuditingBaseDTO implements Serializable {
|
|||
@ApiModelProperty(value = "申请单号")
|
||||
private String applyNumber;
|
||||
|
||||
@ApiModelProperty(value = "置顶标识")
|
||||
private Integer pinTop;
|
||||
|
||||
@ApiModelProperty(value = "置顶时间")
|
||||
private Date pinTopTime;
|
||||
|
||||
public String getDelFlagTip() {
|
||||
if (this.delFlag != null) {
|
||||
Optional<ResourceEntityDelFlag> resourceEntityDelFlagOptional = Optional.ofNullable(ResourceEntityDelFlag.getByFlag(this.delFlag));
|
||||
|
|
|
@ -140,6 +140,17 @@ public class ResourceEntity extends BaseEntity {
|
|||
*/
|
||||
private String undercarriageEnclosure;
|
||||
|
||||
|
||||
/**
|
||||
* 置顶标识
|
||||
*/
|
||||
private Integer pinTop;
|
||||
|
||||
/**
|
||||
* 置顶时间
|
||||
*/
|
||||
private Date pinTopTime;
|
||||
|
||||
@TableField(value = "info_list", typeHandler = FastjsonTypeHandler.class)
|
||||
private List<AttrEntity> infoList;
|
||||
|
||||
|
|
|
@ -136,4 +136,6 @@ public interface ResourceService extends CrudService<ResourceEntity, ResourceDTO
|
|||
PageData<Map<String,Object>> resourceInstallationOrDataResourceDetails(Map<String, Object> params);
|
||||
|
||||
Object selectAppList(Map params);
|
||||
|
||||
Object getCountByFuzzyQuery(String keyWorld);
|
||||
}
|
|
@ -46,6 +46,7 @@ import io.renren.modules.sys.dao.SysDeptDao;
|
|||
import io.renren.modules.sys.dto.SysUserDTO;
|
||||
import io.renren.modules.sys.service.SysDeptService;
|
||||
import io.renren.modules.sys.service.SysUserService;
|
||||
import lombok.SneakyThrows;
|
||||
import okhttp3.*;
|
||||
import org.activiti.engine.HistoryService;
|
||||
import org.activiti.engine.history.HistoricProcessInstance;
|
||||
|
@ -87,12 +88,7 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
|
|||
/**
|
||||
* 公共http客户端
|
||||
*/
|
||||
private static final OkHttpClient client = new OkHttpClient().newBuilder()
|
||||
.connectTimeout(1, TimeUnit.MINUTES)
|
||||
.readTimeout(1, TimeUnit.MINUTES)
|
||||
.connectionPool(new ConnectionPool(CPU_NUM * 2, 2, TimeUnit.MINUTES))
|
||||
.retryOnConnectionFailure(false)
|
||||
.build();
|
||||
private static final OkHttpClient client = new OkHttpClient().newBuilder().connectTimeout(1, TimeUnit.MINUTES).readTimeout(1, TimeUnit.MINUTES).connectionPool(new ConnectionPool(CPU_NUM * 2, 2, TimeUnit.MINUTES)).retryOnConnectionFailure(false).build();
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(ResourceServiceImpl.class);
|
||||
|
||||
|
@ -388,7 +384,18 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
|
|||
Integer pageNum = jsonObject.getInteger("pageNum");
|
||||
Integer pageSize = jsonObject.getInteger("pageSize");
|
||||
//默认按上架时间降序排列
|
||||
String orderField = StringUtils.isBlank(jsonObject.getString("orderField")) ? "total" : jsonObject.getString("orderField");
|
||||
String orderField;
|
||||
if (StringUtils.isBlank(jsonObject.getString("orderField"))) {
|
||||
if ("应用资源".equals(jsonObject.getString("type"))) {
|
||||
orderField = "deptSort";
|
||||
} else if ("组件服务".equals(jsonObject.getString("type"))) {
|
||||
orderField = "pin_top";
|
||||
} else {
|
||||
orderField = "total";
|
||||
}
|
||||
} else {
|
||||
orderField = jsonObject.getString("orderField");
|
||||
}
|
||||
String orderType = StringUtils.isBlank(jsonObject.getString("orderType")) ? "DESC" : jsonObject.getString("orderType");
|
||||
Page<ResourceDTO> resultPage = new Page<>(pageNum, pageSize);
|
||||
switch (Constant.ProjectPlace.getByFlag(projectPlace)) {
|
||||
|
@ -408,7 +415,7 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
|
|||
if (response.isSuccessful()) {
|
||||
String body = response.body().string();
|
||||
JSONObject jsonObject_ = JSON.parseObject(body);
|
||||
logger.info("西海岸接口{}返回:{}" , url, body);
|
||||
logger.info("西海岸接口{}返回:{}", url, body);
|
||||
if (jsonObject_.containsKey("data")) {
|
||||
if (jsonObject_.getJSONObject("data").containsKey("list")) {
|
||||
resultPage.setTotal(jsonObject_.getJSONObject("data").getLongValue("total"));
|
||||
|
@ -453,30 +460,32 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
|
|||
/**
|
||||
* 从本库内查询
|
||||
*/
|
||||
@SneakyThrows
|
||||
private Page<ResourceDTO> common(Page<ResourceDTO> resultPage, List<Map> selectDTOPageSpecilTotal, ResourceDTO resourceDTO, String orderField, String orderType, Integer pageNum, Integer pageSize) {
|
||||
if (resourceDTO.getInfoList().isEmpty()) {
|
||||
List<ResourceDTO> resourceDTOS;
|
||||
if (orderField.equals("total")) { // 对总体评价特殊处理
|
||||
List<Long> ids = new CopyOnWriteArrayList<>();
|
||||
ForkJoinPool customThreadPool = new ForkJoinPool(CPU_NUM * 3);
|
||||
switch (orderType.toUpperCase()) {
|
||||
case "DESC": // total 倒序
|
||||
ids = selectDTOPageSpecilTotal.parallelStream().map(Map.class::cast).sorted(Comparator.comparing(x -> {
|
||||
Map index = (Map) x;
|
||||
String string = (index.get("total") == null) ? "0" : index.get("total").toString();
|
||||
return Long.valueOf(string);
|
||||
}
|
||||
).reversed()).skip((long) (pageNum - 1) * pageSize).limit(pageSize).map(x ->
|
||||
Long.valueOf(x.get("id").toString())
|
||||
).limit(pageSize).collect(Collectors.toList());
|
||||
ids = customThreadPool.submit(() -> {
|
||||
List<Long> temp = selectDTOPageSpecilTotal.parallelStream().map(Map.class::cast).sorted(Comparator.comparing(x -> {
|
||||
Map index = (Map) x;
|
||||
String string = (index.get("total") == null) ? "0" : index.get("total").toString();
|
||||
return Long.valueOf(string);
|
||||
}).reversed()).skip((long) (pageNum - 1) * pageSize).limit(pageSize).map(x -> Long.valueOf(x.get("id").toString())).limit(pageSize).collect(Collectors.toList());
|
||||
return temp;
|
||||
}).get();
|
||||
break;
|
||||
case "ASC": // total 升序
|
||||
ids = selectDTOPageSpecilTotal.parallelStream().map(Map.class::cast).sorted(Comparator.comparing(x -> {
|
||||
String string = (x.get("total") == null) ? "0" : x.get("total").toString();
|
||||
return Long.valueOf(string);
|
||||
}
|
||||
)).skip((pageNum - 1) * pageSize).limit(pageSize).map(x ->
|
||||
Long.valueOf(x.get("id").toString())
|
||||
).limit(pageSize).collect(Collectors.toList());
|
||||
ids = customThreadPool.submit(() -> {
|
||||
List<Long> temp = selectDTOPageSpecilTotal.parallelStream().map(Map.class::cast).sorted(Comparator.comparing(x -> {
|
||||
String string = (x.get("total") == null) ? "0" : x.get("total").toString();
|
||||
return Long.valueOf(string);
|
||||
})).skip((pageNum - 1) * pageSize).limit(pageSize).map(x -> Long.valueOf(x.get("id").toString())).limit(pageSize).collect(Collectors.toList());
|
||||
return temp;
|
||||
}).get();
|
||||
break;
|
||||
}
|
||||
resourceDTOS = resourceDao.selectDTOPage(resourceDTO, null, null, null, null, ids);
|
||||
|
@ -491,6 +500,7 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
|
|||
return index.getTotal() == null ? 0L : index.getTotal();
|
||||
})).collect(Collectors.toList()));
|
||||
}
|
||||
customThreadPool.shutdown();
|
||||
} else { // 非总体评价排序时
|
||||
resourceDTOS = resourceDao.selectDTOPage(resourceDTO, (pageNum - 1) * pageSize, pageSize, orderField, orderType, null);
|
||||
}
|
||||
|
@ -503,13 +513,11 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
|
|||
resultPage.setRecords(new ArrayList<>());
|
||||
resultPage.setTotal(0);
|
||||
} else {
|
||||
List<ResourceDTO> recordLists = resourceDTOS.stream()
|
||||
.skip((pageNum - 1) * pageSize).limit(pageSize)
|
||||
.map(dto_ -> {
|
||||
ResourceDTO get = this.selectWithAttrs(dto_.getId());
|
||||
BeanUtils.copyProperties(get, dto_);
|
||||
return dto_;
|
||||
}).collect(Collectors.toList());
|
||||
List<ResourceDTO> recordLists = resourceDTOS.stream().skip((pageNum - 1) * pageSize).limit(pageSize).map(dto_ -> {
|
||||
ResourceDTO get = this.selectWithAttrs(dto_.getId());
|
||||
BeanUtils.copyProperties(get, dto_);
|
||||
return dto_;
|
||||
}).collect(Collectors.toList());
|
||||
resultPage.setRecords(recordLists);
|
||||
resultPage.setTotal(resourceDTOS.size());
|
||||
}
|
||||
|
@ -520,9 +528,7 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
|
|||
@Override
|
||||
public List<AttrEntity> selectAttrsByResourceId(Long resourceId) {
|
||||
QueryWrapper<AttrEntity> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("data_resource_id", resourceId)
|
||||
.eq("del_flag", ResourceEntityDelFlag.NORMAL.getFlag())
|
||||
.orderByDesc("attr_type");
|
||||
wrapper.eq("data_resource_id", resourceId).eq("del_flag", ResourceEntityDelFlag.NORMAL.getFlag()).orderByDesc("attr_type");
|
||||
return attrDao.selectList(wrapper);
|
||||
}
|
||||
|
||||
|
@ -534,42 +540,40 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
|
|||
case TSINGTAO_XHA: { // 青岛西海岸
|
||||
CompletableFuture allAmount = CompletableFuture.supplyAsync(() -> { // 获取平台总基础设施数目
|
||||
List<Long> result = new CopyOnWriteArrayList<>();
|
||||
CompletableFuture cloud =
|
||||
CompletableFuture.runAsync(() -> { // 云脑专网
|
||||
String url = tsingtao_xhaProperties.getCamCount();
|
||||
logger.info(url);
|
||||
Request request = new Request.Builder().url(url).build();
|
||||
try (Response response = client.newCall(request).execute()) {
|
||||
if (response.isSuccessful()) {
|
||||
JSONObject jsonObject = JSON.parseObject(response.body().string());
|
||||
if (jsonObject.containsKey("errorNo") && jsonObject.getLongValue("errorNo") == 200) {
|
||||
result.add(jsonObject.getLongValue("body"));
|
||||
}
|
||||
} else {
|
||||
logger.error("青岛西海岸获取失败");
|
||||
}
|
||||
} catch (Exception exception) {
|
||||
logger.error("青岛西海岸失败", exception);
|
||||
CompletableFuture cloud = CompletableFuture.runAsync(() -> { // 云脑专网
|
||||
String url = tsingtao_xhaProperties.getCamCount();
|
||||
logger.info(url);
|
||||
Request request = new Request.Builder().url(url).build();
|
||||
try (Response response = client.newCall(request).execute()) {
|
||||
if (response.isSuccessful()) {
|
||||
JSONObject jsonObject = JSON.parseObject(response.body().string());
|
||||
if (jsonObject.containsKey("errorNo") && jsonObject.getLongValue("errorNo") == 200) {
|
||||
result.add(jsonObject.getLongValue("body"));
|
||||
}
|
||||
}, executor);
|
||||
CompletableFuture local =
|
||||
CompletableFuture.runAsync(() -> { // 金宏网
|
||||
String url = tsingtao_xhaProperties.getLocalcam();
|
||||
logger.info(url);
|
||||
Request request = new Request.Builder().url(url).build();
|
||||
try (Response response = client.newCall(request).execute()) {
|
||||
if (response.isSuccessful()) {
|
||||
JSONObject jsonObject = JSON.parseObject(response.body().string());
|
||||
if (jsonObject.containsKey("errorNo") && jsonObject.getLongValue("errorNo") == 200) {
|
||||
result.add(jsonObject.getLongValue("body"));
|
||||
}
|
||||
} else {
|
||||
logger.error("青岛西海岸获取失败");
|
||||
}
|
||||
} catch (Exception exception) {
|
||||
logger.error("青岛西海岸失败", exception);
|
||||
} else {
|
||||
logger.error("青岛西海岸获取失败");
|
||||
}
|
||||
} catch (Exception exception) {
|
||||
logger.error("青岛西海岸失败", exception);
|
||||
}
|
||||
}, executor);
|
||||
CompletableFuture local = CompletableFuture.runAsync(() -> { // 金宏网
|
||||
String url = tsingtao_xhaProperties.getLocalcam();
|
||||
logger.info(url);
|
||||
Request request = new Request.Builder().url(url).build();
|
||||
try (Response response = client.newCall(request).execute()) {
|
||||
if (response.isSuccessful()) {
|
||||
JSONObject jsonObject = JSON.parseObject(response.body().string());
|
||||
if (jsonObject.containsKey("errorNo") && jsonObject.getLongValue("errorNo") == 200) {
|
||||
result.add(jsonObject.getLongValue("body"));
|
||||
}
|
||||
}, executor);
|
||||
} else {
|
||||
logger.error("青岛西海岸获取失败");
|
||||
}
|
||||
} catch (Exception exception) {
|
||||
logger.error("青岛西海岸失败", exception);
|
||||
}
|
||||
}, executor);
|
||||
CompletableFuture all = CompletableFuture.allOf(cloud, local);
|
||||
all.join();
|
||||
return result.stream().filter(Objects::nonNull).findAny().orElse(0L);
|
||||
|
@ -617,11 +621,7 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
|
|||
re.add(new HashMap<String, Object>() {
|
||||
{
|
||||
QueryWrapper<CameraChannel> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("check_status", 1)
|
||||
.ne("gps_x", "")
|
||||
.ne("gps_y", "")
|
||||
.isNotNull("gps_x")
|
||||
.isNotNull("gps_y");
|
||||
queryWrapper.eq("check_status", 1).ne("gps_x", "").ne("gps_y", "").isNotNull("gps_x").isNotNull("gps_y");
|
||||
put("count", cameraChannelMapper.selectCount(queryWrapper) + "");
|
||||
put("type", "基础设施");
|
||||
}
|
||||
|
@ -678,8 +678,7 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
|
|||
ResourceEntity entity = new ResourceEntity();
|
||||
entity.setVisits((resourceEntity.getVisits() == null ? 0 : resourceEntity.getVisits()) + 1);
|
||||
UpdateWrapper<ResourceEntity> updateWrapper = new UpdateWrapper<>();
|
||||
updateWrapper.lambda().eq(ResourceEntity::getId, resourceEntity.getId())
|
||||
.eq(ResourceEntity::getDelFlag, ResourceEntityDelFlag.NORMAL.getFlag());
|
||||
updateWrapper.lambda().eq(ResourceEntity::getId, resourceEntity.getId()).eq(ResourceEntity::getDelFlag, ResourceEntityDelFlag.NORMAL.getFlag());
|
||||
resourceDao.update(entity, updateWrapper);
|
||||
|
||||
Integer num = jdbcTemplate.queryForObject("SELECT round(tb_data_resource_assignmark.total) FROM tb_data_resource_assignmark WHERE id =" + id, Integer.class);
|
||||
|
@ -728,14 +727,6 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
|
|||
}
|
||||
});
|
||||
} while (page.getRecords().size() < 9);
|
||||
//for (int i = 0; page.getRecords().size() < 9; i++) {
|
||||
// for (int j = 0; j < page.getRecords().size(); j++) {
|
||||
// if (!page.getRecords().get(j).getId().equals(resultPage.getRecords().get(i).getId())) {
|
||||
// page.getRecords().add(resultPage.getRecords().get(i));
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
}
|
||||
return page;
|
||||
} else {
|
||||
|
@ -769,21 +760,20 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
|
|||
}
|
||||
Map<String, List<Map<String, Object>>> listMap = typeMapList.stream().collect(Collectors.groupingBy(m -> m.get("type").toString()));
|
||||
//区级要根据行政区划多加一层结构
|
||||
List<CompletableFuture> tasks =
|
||||
listMap.entrySet().stream().filter(index -> !"区级".equals(index.getKey())).map(item -> {
|
||||
CompletableFuture task = CompletableFuture.runAsync(() -> {
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
map.put("type", item.getKey());
|
||||
Integer integer = resourceDao.selectTypeCountByDept(item.getKey(), jsonObject.getString("type"));
|
||||
map.put("total", integer);
|
||||
item.getValue().forEach(item1 -> item1.remove("type"));
|
||||
map.put("dataList", item.getValue());
|
||||
if (integer != 0) {
|
||||
resultList.add(map);
|
||||
}
|
||||
}, executor);
|
||||
return task;
|
||||
}).collect(Collectors.toList());
|
||||
List<CompletableFuture> tasks = listMap.entrySet().stream().filter(index -> !"区级".equals(index.getKey())).map(item -> {
|
||||
CompletableFuture task = CompletableFuture.runAsync(() -> {
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
map.put("type", item.getKey());
|
||||
Integer integer = resourceDao.selectTypeCountByDept(item.getKey(), jsonObject.getString("type"));
|
||||
map.put("total", integer);
|
||||
item.getValue().forEach(item1 -> item1.remove("type"));
|
||||
map.put("dataList", item.getValue());
|
||||
if (integer != 0) {
|
||||
resultList.add(map);
|
||||
}
|
||||
}, executor);
|
||||
return task;
|
||||
}).collect(Collectors.toList());
|
||||
CompletableFuture.allOf(tasks.toArray(new CompletableFuture[tasks.size()])).join();
|
||||
|
||||
Optional<List<Map<String, Object>>> areaList = Optional.ofNullable(listMap.get("区级"));
|
||||
|
@ -959,16 +949,14 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
|
|||
List<Map> typeList = new ArrayList<>();
|
||||
final Long[] maxTypeCount = {0L};
|
||||
final String[] maxTypeString = new String[1];
|
||||
typeListOld.forEach(map -> {
|
||||
typeList.add(new HashMap() {{
|
||||
put("type", map.get("type"));
|
||||
put("total", map.get("count"));
|
||||
if (Long.parseLong(map.get("count").toString()) > maxTypeCount[0]) {
|
||||
maxTypeCount[0] = Long.parseLong(map.get("count").toString());
|
||||
maxTypeString[0] = map.get("type").toString();
|
||||
}
|
||||
}});
|
||||
});
|
||||
typeListOld.forEach(map -> typeList.add(new HashMap() {{
|
||||
put("type", map.get("type"));
|
||||
put("total", map.get("count"));
|
||||
if (Long.parseLong(map.get("count").toString()) > maxTypeCount[0]) {
|
||||
maxTypeCount[0] = Long.parseLong(map.get("count").toString());
|
||||
maxTypeString[0] = map.get("type").toString();
|
||||
}
|
||||
}}));
|
||||
resultMap.put("typeList", typeList);
|
||||
HashMap<String, Object> maxdeptMap = new HashMap<>();
|
||||
if (maxTypeCount[0] > 0) {
|
||||
|
@ -976,12 +964,10 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
|
|||
if ("基础设施".equals(maxTypeString[0])) {
|
||||
List<Map> resourceList = new ArrayList<>();
|
||||
Map<String, Object> infrastructureList = (Map<String, Object>) this.selectInfrastructureList();
|
||||
infrastructureList.forEach((k, v) -> {
|
||||
resourceList.add(new HashMap() {{
|
||||
put("id", k + v + "项");
|
||||
put("name", k + v + "项");
|
||||
}});
|
||||
});
|
||||
infrastructureList.forEach((k, v) -> resourceList.add(new HashMap() {{
|
||||
put("id", k + v + "项");
|
||||
put("name", k + v + "项");
|
||||
}}));
|
||||
maxdeptMap.put("resourceList", resourceList);
|
||||
} else if ("数据资源".equals(maxTypeString[0])) {
|
||||
GetDataResourceListDto dto = new GetDataResourceListDto();
|
||||
|
@ -1053,12 +1039,10 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
|
|||
@Override
|
||||
public Object getApplyCameraList(Long instanceId) {
|
||||
QueryWrapper<TAbilityApplicationEntity> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("instance_id", instanceId)
|
||||
.eq("approve_status", "通过");
|
||||
queryWrapper.eq("instance_id", instanceId).eq("approve_status", "通过");
|
||||
List<TAbilityApplicationEntity> applicationEntities = tAbilityApplicationDao.selectList(queryWrapper);
|
||||
ArrayList cameraList = new ArrayList();
|
||||
applicationEntities.forEach(index -> {
|
||||
//List<CameraChannelDto1> channelDto1s = cameraChannelMapper.selectByChannelCode(index.getCameraList().replaceAll("\"", ""));
|
||||
CameraChannelDto1 channelDto1s = JSON.toJavaObject(JSON.parseObject(index.getCameraList()), CameraChannelDto1.class);
|
||||
if (ObjectUtils.allNotNull(channelDto1s)) {
|
||||
cameraList.add(channelDto1s);
|
||||
|
@ -1072,12 +1056,10 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
|
|||
if ("基础设施".equals(type)) {
|
||||
List<Map> resourceList = new ArrayList<>();
|
||||
Map<String, Object> infrastructureList = (Map<String, Object>) this.selectInfrastructureList();
|
||||
infrastructureList.forEach((k, v) -> {
|
||||
resourceList.add(new HashMap() {{
|
||||
put("id", k + v + "项");
|
||||
put("name", k + v + "项");
|
||||
}});
|
||||
});
|
||||
infrastructureList.forEach((k, v) -> resourceList.add(new HashMap() {{
|
||||
put("id", k + v + "项");
|
||||
put("name", k + v + "项");
|
||||
}}));
|
||||
return resourceList;
|
||||
} else if ("数据资源".equals(type)) {
|
||||
GetDataResourceListDto dto = new GetDataResourceListDto();
|
||||
|
@ -1121,6 +1103,7 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
|
|||
public void KnowledgeBase() {
|
||||
final List<String> knowledgeUUID = jdbcTemplate.queryForList("SELECT note1 FROM tb_data_resource WHERE type ='知识库' AND note1 IS NOT NULL FOR UPDATE;", String.class).stream().distinct().collect(Collectors.toList());
|
||||
final int pageSize = CPU_NUM * 10;
|
||||
ForkJoinPool customThreadPool = new ForkJoinPool(CPU_NUM * 3);
|
||||
Arrays.stream(catalogIds).map(index -> {
|
||||
logger.info("处理:{}", index);
|
||||
CopyOnWriteArrayList<CompletableFuture> task = new CopyOnWriteArrayList<>();
|
||||
|
@ -1130,7 +1113,7 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
|
|||
do {
|
||||
final long timestamp = LocalDateTime.now().toInstant(ZoneOffset.ofHours(8)).toEpochMilli();
|
||||
int page = pageIndex.getAndIncrement();
|
||||
logger.info("处理:{}分页{}", index, page);
|
||||
logger.info("处理:{} 分页{}", index, page);
|
||||
task.add(CompletableFuture.supplyAsync(() -> {
|
||||
try {
|
||||
logger.info("分页任务处理:{}分页{} 时间--> {}", index, page, timestamp);
|
||||
|
@ -1142,19 +1125,13 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
|
|||
String bizContent = bizContentParam.toJSONString();
|
||||
logger.info("biz_content参数:{}", bizContent);
|
||||
// 通过FormBody对象构建Builder来添加表单参数
|
||||
FormBody.Builder signFormBody = new FormBody.Builder().add("app_id", appId)
|
||||
.add("interface_id", methodId).
|
||||
add("version", version).
|
||||
add("timestamp", String.valueOf(timestamp)).
|
||||
add("origin", origin).
|
||||
add("charset", charset).
|
||||
add("biz_content", bizContent);
|
||||
logger.info("{}分页{}对接知识库数据请求参数:{}", index, page, signFormBody.build().contentType().toString());
|
||||
FormBody.Builder signFormBody = new FormBody.Builder().add("app_id", appId).add("interface_id", methodId).add("version", version).add("timestamp", String.valueOf(timestamp)).add("origin", origin).add("charset", charset).add("biz_content", bizContent);
|
||||
logger.info("{} 分页 {} 对接知识库数据请求参数:{}", index, page, signFormBody.build().contentType().toString());
|
||||
|
||||
Request signRequest = new Request.Builder().url(sign).post(signFormBody.build()).build();
|
||||
Response signResponse = client.newCall(signRequest).execute();
|
||||
String signResult = signResponse.body().string();
|
||||
logger.info("{}分页signResult数据:{}", page, signResult);
|
||||
logger.info("{} 分页signResult数据:{}", page, signResult);
|
||||
JSONObject signJsonObject = JSON.parseObject(signResult);
|
||||
if (!signJsonObject.containsKey("data")) {
|
||||
logger.info("获取sign异常:{}", signResult);
|
||||
|
@ -1173,7 +1150,7 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
|
|||
Request gatewayRequest = new Request.Builder().url(gateway).post(signFormBody.build()).build();
|
||||
Response gatewayResponse = client.newCall(gatewayRequest).execute();
|
||||
String gatewayResult = gatewayResponse.body().string();
|
||||
logger.info("{}分页数据:" + gatewayResult, page);
|
||||
logger.info("{}分页数据:{}", page, gatewayResult);
|
||||
JSONObject gatewayJsonObject = JSON.parseObject(gatewayResult);
|
||||
JSONObject gatewayData = JSON.parseObject(gatewayJsonObject.get("data").toString());
|
||||
JSONArray infos = gatewayData.getJSONObject("data").getJSONArray("infos");
|
||||
|
@ -1195,62 +1172,66 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
|
|||
}
|
||||
}, executor).thenAcceptAsync(list -> {
|
||||
logger.info("知识库数据量:{}", list.size());
|
||||
if (list.size() < 1) {
|
||||
if (list.isEmpty() || list.size() < pageSize) {
|
||||
end.set(false);
|
||||
}
|
||||
list.parallelStream().filter(resource -> {
|
||||
Map<String, Object> map = (Map<String, Object>) resource;
|
||||
return !knowledgeUUID.contains(map.get("uuid").toString());
|
||||
}).forEach(resource -> {
|
||||
Map<String, Object> map = (Map<String, Object>) resource;
|
||||
ResourceDTO dto = new ResourceDTO();
|
||||
dto.setName(map.get("title").toString());
|
||||
dto.setType("知识库");
|
||||
dto.setVisits(0L);
|
||||
//所属部门暂时设为青岛市政府办公厅
|
||||
dto.setDeptId(1517116100113850370L);
|
||||
dto.setNote1(map.get("uuid").toString());
|
||||
dto.setDelFlag(0);
|
||||
ArrayList<AttrEntity> infoList = new ArrayList<>();
|
||||
map.forEach((key, value) -> {
|
||||
switch (key) {
|
||||
case "title":
|
||||
dto.setName(value.toString());
|
||||
break;
|
||||
case "url":
|
||||
dto.setLink(value.toString());
|
||||
break;
|
||||
case "createtime":
|
||||
Date createDate = new Date(Long.parseLong(value.toString()));
|
||||
dto.setCreateDate(createDate);
|
||||
break;
|
||||
default:
|
||||
AttrEntity attrEntity = new AttrEntity();
|
||||
attrEntity.setDelFlag(0);
|
||||
attrEntity.setAttrType(key);
|
||||
attrEntity.setAttrValue(value.toString());
|
||||
infoList.add(attrEntity);
|
||||
break;
|
||||
customThreadPool.submit(() -> {
|
||||
list.parallelStream().filter(resource -> {
|
||||
Map<String, Object> map = (Map<String, Object>) resource;
|
||||
return !knowledgeUUID.contains(map.get("uuid").toString());
|
||||
}).forEach(resource -> {
|
||||
Map<String, Object> map = (Map<String, Object>) resource;
|
||||
ResourceDTO dto = new ResourceDTO();
|
||||
dto.setName(map.get("title").toString());
|
||||
dto.setType("知识库");
|
||||
dto.setVisits(0L);
|
||||
//所属部门暂时设为青岛市政府办公厅
|
||||
dto.setDeptId(1517116100113850370L);
|
||||
dto.setNote1(map.get("uuid").toString());
|
||||
dto.setDelFlag(0);
|
||||
ArrayList<AttrEntity> infoList = new ArrayList<>();
|
||||
map.forEach((key, value) -> {
|
||||
switch (key) {
|
||||
case "title":
|
||||
dto.setName(value.toString());
|
||||
break;
|
||||
case "url":
|
||||
dto.setLink(value.toString());
|
||||
break;
|
||||
case "createtime":
|
||||
Date createDate = new Date(Long.parseLong(value.toString()));
|
||||
dto.setCreateDate(createDate);
|
||||
break;
|
||||
default:
|
||||
AttrEntity attrEntity = new AttrEntity();
|
||||
attrEntity.setDelFlag(0);
|
||||
attrEntity.setAttrType(key);
|
||||
attrEntity.setAttrValue(value.toString());
|
||||
infoList.add(attrEntity);
|
||||
break;
|
||||
}
|
||||
});
|
||||
AttrEntity attrEntity = new AttrEntity();
|
||||
attrEntity.setDelFlag(0);
|
||||
attrEntity.setAttrType("文件类型");
|
||||
if ("f49561afc7204f008c4bb3cd821eb6ba".equals(index)) {
|
||||
attrEntity.setAttrValue("政府公报");
|
||||
} else {
|
||||
attrEntity.setAttrValue("政策解读");
|
||||
}
|
||||
infoList.add(attrEntity);
|
||||
dto.setInfoList(infoList);
|
||||
this.insertWithAttrs(dto);
|
||||
logger.info("插入:{}", dto.getName());
|
||||
});
|
||||
AttrEntity attrEntity = new AttrEntity();
|
||||
attrEntity.setDelFlag(0);
|
||||
attrEntity.setAttrType("文件类型");
|
||||
if ("f49561afc7204f008c4bb3cd821eb6ba".equals(index)) {
|
||||
attrEntity.setAttrValue("政府公报");
|
||||
} else {
|
||||
attrEntity.setAttrValue("政策解读");
|
||||
}
|
||||
infoList.add(attrEntity);
|
||||
dto.setInfoList(infoList);
|
||||
this.insertWithAttrs(dto);
|
||||
logger.info("插入:{}", dto.getName());
|
||||
});
|
||||
}).join();
|
||||
customThreadPool.shutdown();
|
||||
}, executor));
|
||||
try {
|
||||
Thread.sleep(300L);
|
||||
Thread.sleep(100L); // 防止任务运行过快,无法跳出循环
|
||||
} catch (InterruptedException e) {
|
||||
throw new RuntimeException(e);
|
||||
logger.info("知识库同步异常", e);
|
||||
// throw new RuntimeException(e);
|
||||
}
|
||||
} while (end.get() || pageIndex.get() < maxPage.get());
|
||||
return task;
|
||||
|
@ -1278,34 +1259,19 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
|
|||
public PageData<Map<String, Object>> resourceBusinessDetails(Map<String, Object> params) {
|
||||
List<Map<String, Object>> result = new CopyOnWriteArrayList<>();
|
||||
|
||||
List<Map> deptList = new ArrayList<>();//保存部门 发布总数 访问量
|
||||
// params.put("pageNum", (Integer.parseInt(params.get("page").toString()) - 1) * Integer.parseInt(params.get("limit").toString()));
|
||||
// params.put("pageSize", params.get("limit"));
|
||||
|
||||
Integer page = Integer.parseInt(params.get("page").toString()) - 1;
|
||||
Integer pageSize = Integer.parseInt(params.get("limit").toString());
|
||||
|
||||
Object[] pas = {params.get("id"), params.get("id")};
|
||||
|
||||
List<Map<String, Object>> result2 = new ArrayList<>();
|
||||
List<Map<String, Object>> result2;
|
||||
if (Long.parseLong(params.get("id").toString()) == 0) {
|
||||
result2 = jdbcTemplate.queryForList("SELECT COUNT(a.id) AS resourceNum,a.dept_id AS deptId,b.name AS deptName,\n" +
|
||||
"SUM(a.visits) AS resourceVisits \n" +
|
||||
"FROM tb_data_resource a INNER JOIN sys_dept b ON a.dept_id = b.id\n" +
|
||||
"WHERE a.type = '组件服务' AND a.del_flag = 0\n" +
|
||||
"GROUP BY a.dept_id,b.name\n" +
|
||||
"ORDER BY a.dept_id,b.name\n");
|
||||
result2 = jdbcTemplate.queryForList("SELECT COUNT(a.id) AS resourceNum,a.dept_id AS deptId,b.name AS deptName,\n" + "SUM(a.visits) AS resourceVisits \n" + "FROM tb_data_resource a INNER JOIN sys_dept b ON a.dept_id = b.id\n" + "WHERE a.type = '组件服务' AND a.del_flag = 0\n" + "GROUP BY a.dept_id,b.name\n" + "ORDER BY a.dept_id,b.name\n");
|
||||
} else {
|
||||
result2 = jdbcTemplate.queryForList("SELECT COUNT(a.id) AS resourceNum,a.dept_id AS deptId,b.name AS deptName,\n" +
|
||||
"SUM(a.visits) AS resourceVisits \n" +
|
||||
"FROM tb_data_resource a INNER JOIN sys_dept b ON a.dept_id = b.id\n" +
|
||||
"WHERE a.type = '组件服务' AND a.del_flag = 0\n" +
|
||||
"AND (b.ID = ? OR INSTR(b.pids,?))\n" +
|
||||
"GROUP BY a.dept_id,b.name\n" +
|
||||
"ORDER BY a.dept_id,b.name\n", pas);
|
||||
result2 = jdbcTemplate.queryForList("SELECT COUNT(a.id) AS resourceNum,a.dept_id AS deptId,b.name AS deptName,\n" + "SUM(a.visits) AS resourceVisits \n" + "FROM tb_data_resource a INNER JOIN sys_dept b ON a.dept_id = b.id\n" + "WHERE a.type = '组件服务' AND a.del_flag = 0\n" + "AND (b.ID = ? OR INSTR(b.pids,?))\n" + "GROUP BY a.dept_id,b.name\n" + "ORDER BY a.dept_id,b.name\n", pas);
|
||||
}
|
||||
|
||||
if (result2.size() > 0) {
|
||||
if (!result2.isEmpty()) {
|
||||
List<List<Map<String, Object>>> partition = Lists.partition(result2, pageSize);
|
||||
result.addAll(partition.get(page));
|
||||
} else {
|
||||
|
@ -1368,43 +1334,32 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
|
|||
CompletableFuture<Void> all = CompletableFuture.allOf(voidCompletableFuture01, voidCompletableFuture02, voidCompletableFuture03, voidCompletableFuture04, voidCompletableFuture05);
|
||||
all.join();
|
||||
|
||||
PageData<Map<String, Object>> pageData = new PageData<>(result, result2.size());
|
||||
return pageData;
|
||||
return new PageData<>(result, result2.size());
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageData<Map<String, Object>> resourceApplicationDetails(Map<String, Object> params) {
|
||||
List<Map<String, Object>> result = new CopyOnWriteArrayList<>();
|
||||
List<Map<String, Object>> result;
|
||||
Integer page = Integer.parseInt(params.get("page").toString()) - 1;
|
||||
Integer pageSize = Integer.parseInt(params.get("limit").toString());
|
||||
Object[] pas = {params.get("id"), params.get("id")};
|
||||
|
||||
List<Map<String, Object>> result2 = new ArrayList<>();
|
||||
List<Map<String, Object>> result2;
|
||||
if (Long.parseLong(params.get("id").toString()) == 0) {
|
||||
result2 = jdbcTemplate.queryForList("SELECT COUNT(a.id) AS resourceNum,a.dept_id AS deptId,b.name AS deptName\n" +
|
||||
"FROM tb_data_resource a INNER JOIN sys_dept b ON a.dept_id = b.id\n" +
|
||||
"WHERE a.type = '应用资源' AND a.del_flag = 0\n" +
|
||||
"GROUP BY a.dept_id,b.name\n" +
|
||||
"ORDER BY a.dept_id,b.name\n");
|
||||
result2 = jdbcTemplate.queryForList("SELECT COUNT(a.id) AS resourceNum,a.dept_id AS deptId,b.name AS deptName\n" + "FROM tb_data_resource a INNER JOIN sys_dept b ON a.dept_id = b.id\n" + "WHERE a.type = '应用资源' AND a.del_flag = 0\n" + "GROUP BY a.dept_id,b.name\n" + "ORDER BY a.dept_id,b.name\n");
|
||||
} else {
|
||||
result2 = jdbcTemplate.queryForList("SELECT COUNT(a.id) AS resourceNum,a.dept_id AS deptId,b.name AS deptName\n" +
|
||||
"FROM tb_data_resource a INNER JOIN sys_dept b ON a.dept_id = b.id\n" +
|
||||
"WHERE a.type = '应用资源' AND a.del_flag = 0\n" +
|
||||
"AND (b.ID = ? OR b.pids LIKE CONCAT(CONCAT('%',?),'%'))\n" +
|
||||
"GROUP BY a.dept_id,b.name\n" +
|
||||
"ORDER BY a.dept_id,b.name\n", pas);
|
||||
result2 = jdbcTemplate.queryForList("SELECT COUNT(a.id) AS resourceNum,a.dept_id AS deptId,b.name AS deptName\n" + "FROM tb_data_resource a INNER JOIN sys_dept b ON a.dept_id = b.id\n" + "WHERE a.type = '应用资源' AND a.del_flag = 0\n" + "AND (b.ID = ? OR b.pids LIKE CONCAT(CONCAT('%',?),'%'))\n" + "GROUP BY a.dept_id,b.name\n" + "ORDER BY a.dept_id,b.name\n", pas);
|
||||
}
|
||||
|
||||
if (result2.size() > 0) {
|
||||
if (!result2.isEmpty()) {
|
||||
List<List<Map<String, Object>>> partition = Lists.partition(result2, pageSize);
|
||||
result.addAll(partition.get(page));
|
||||
result = new CopyOnWriteArrayList<>(partition.get(page));
|
||||
} else {
|
||||
return new PageData<>(result2, result2.size());
|
||||
return new PageData<>(result2, 0);
|
||||
}
|
||||
|
||||
CompletableFuture<Void> voidCompletableFuture01 = CompletableFuture.runAsync(() -> { //应用浏览数量
|
||||
result.forEach(r -> {
|
||||
Object[] qu = {r.get("deptId")};
|
||||
Integer integer = baseDao.selectResourceBrowseNum(params);
|
||||
r.put("resourceBrowseNum", integer);
|
||||
});
|
||||
|
@ -1412,7 +1367,6 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
|
|||
|
||||
CompletableFuture<Void> voidCompletableFuture02 = CompletableFuture.runAsync(() -> { //应用收藏量
|
||||
result.forEach(r -> {
|
||||
Object[] qu = {r.get("deptId")};
|
||||
Integer integer = baseDao.selectResourceCollectionNum(params);
|
||||
r.put("resourceCollectionNum", integer);
|
||||
});
|
||||
|
@ -1421,8 +1375,7 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
|
|||
CompletableFuture<Void> all = CompletableFuture.allOf(voidCompletableFuture01, voidCompletableFuture02);
|
||||
all.join();
|
||||
|
||||
PageData<Map<String, Object>> pageData = new PageData<>(result, result2.size());
|
||||
return pageData;
|
||||
return new PageData<>(result, result2.size());
|
||||
}
|
||||
|
||||
|
||||
|
@ -1430,8 +1383,6 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
|
|||
List<Map<String, Object>> result;
|
||||
Integer page = Integer.parseInt(params.get("page").toString()) - 1;
|
||||
Integer pageSize = Integer.parseInt(params.get("limit").toString());
|
||||
Object[] pas = {params.get("id"), params.get("id")};
|
||||
|
||||
List<Map<String, Object>> result2;
|
||||
result2 = resourceDao.resourceInstallationOrDataResourceDetails(params);
|
||||
|
||||
|
@ -1487,18 +1438,9 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
|
|||
|
||||
List<Map<String, Object>> result2;
|
||||
if (Long.parseLong(params.get("id").toString()) == 0) {
|
||||
result2 = jdbcTemplate.queryForList("SELECT COUNT(a.id) AS resourceNum,a.dept_id AS deptId,b.name AS deptName\n" +
|
||||
"FROM tb_data_resource a INNER JOIN sys_dept b ON a.dept_id = b.id\n" +
|
||||
"WHERE a.type = '基础设施' AND a.del_flag = 0\n" +
|
||||
"GROUP BY a.dept_id,b.name\n" +
|
||||
"ORDER BY a.dept_id,b.name\n");
|
||||
result2 = jdbcTemplate.queryForList("SELECT COUNT(a.id) AS resourceNum,a.dept_id AS deptId,b.name AS deptName\n" + "FROM tb_data_resource a INNER JOIN sys_dept b ON a.dept_id = b.id\n" + "WHERE a.type = '基础设施' AND a.del_flag = 0\n" + "GROUP BY a.dept_id,b.name\n" + "ORDER BY a.dept_id,b.name\n");
|
||||
} else {
|
||||
result2 = jdbcTemplate.queryForList("SELECT COUNT(a.id) AS resourceNum,a.dept_id AS deptId,b.name AS deptName\n" +
|
||||
"FROM tb_data_resource a INNER JOIN sys_dept b ON a.dept_id = b.id\n" +
|
||||
"WHERE a.type = '基础设施' AND a.del_flag = 0\n" +
|
||||
"AND (b.ID = ? OR INSTR(b.pids,?))\n" +
|
||||
"GROUP BY a.dept_id,b.name\n" +
|
||||
"ORDER BY a.dept_id,b.name\n", pas);
|
||||
result2 = jdbcTemplate.queryForList("SELECT COUNT(a.id) AS resourceNum,a.dept_id AS deptId,b.name AS deptName\n" + "FROM tb_data_resource a INNER JOIN sys_dept b ON a.dept_id = b.id\n" + "WHERE a.type = '基础设施' AND a.del_flag = 0\n" + "AND (b.ID = ? OR INSTR(b.pids,?))\n" + "GROUP BY a.dept_id,b.name\n" + "ORDER BY a.dept_id,b.name\n", pas);
|
||||
}
|
||||
|
||||
if (!result2.isEmpty()) {
|
||||
|
@ -1544,18 +1486,9 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
|
|||
|
||||
List<Map<String, Object>> result2;
|
||||
if (Long.parseLong(params.get("id").toString()) == 0) {
|
||||
result2 = jdbcTemplate.queryForList("SELECT COUNT(a.id) AS resourceNum,a.dept_id AS deptId,b.name AS deptName\n" +
|
||||
"FROM tb_data_resource a INNER JOIN sys_dept b ON a.dept_id = b.id\n" +
|
||||
"WHERE a.type = '数据资源' AND a.del_flag = 0\n" +
|
||||
"GROUP BY a.dept_id,b.name\n" +
|
||||
"ORDER BY a.dept_id,b.name\n");
|
||||
result2 = jdbcTemplate.queryForList("SELECT COUNT(a.id) AS resourceNum,a.dept_id AS deptId,b.name AS deptName\n" + "FROM tb_data_resource a INNER JOIN sys_dept b ON a.dept_id = b.id\n" + "WHERE a.type = '数据资源' AND a.del_flag = 0\n" + "GROUP BY a.dept_id,b.name\n" + "ORDER BY a.dept_id,b.name\n");
|
||||
} else {
|
||||
result2 = jdbcTemplate.queryForList("SELECT COUNT(a.id) AS resourceNum,a.dept_id AS deptId,b.name AS deptName\n" +
|
||||
"FROM tb_data_resource a INNER JOIN sys_dept b ON a.dept_id = b.id\n" +
|
||||
"WHERE a.type = '数据资源' AND a.del_flag = 0\n" +
|
||||
"AND (b.ID = ? OR INSTR(b.pids,?))\n" +
|
||||
"GROUP BY a.dept_id,b.name\n" +
|
||||
"ORDER BY a.dept_id,b.name\n", pas);
|
||||
result2 = jdbcTemplate.queryForList("SELECT COUNT(a.id) AS resourceNum,a.dept_id AS deptId,b.name AS deptName\n" + "FROM tb_data_resource a INNER JOIN sys_dept b ON a.dept_id = b.id\n" + "WHERE a.type = '数据资源' AND a.del_flag = 0\n" + "AND (b.ID = ? OR INSTR(b.pids,?))\n" + "GROUP BY a.dept_id,b.name\n" + "ORDER BY a.dept_id,b.name\n", pas);
|
||||
}
|
||||
|
||||
|
||||
|
@ -1601,20 +1534,9 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
|
|||
Object[] pas = {params.get("id"), params.get("id")};
|
||||
|
||||
if (Long.parseLong(params.get("id").toString()) == 0) {
|
||||
result = jdbcTemplate.queryForList(
|
||||
"SELECT COUNT(a.id) AS resourceNum,b.name AS deptName\n" +
|
||||
"FROM tb_data_resource a INNER JOIN sys_dept b ON a.dept_id = b.id\n" +
|
||||
"WHERE a.type = '知识库' AND a.del_flag = 0\n" +
|
||||
"GROUP BY b.name\n" +
|
||||
"ORDER BY b.name ");
|
||||
result = jdbcTemplate.queryForList("SELECT COUNT(a.id) AS resourceNum,b.name AS deptName\n" + "FROM tb_data_resource a INNER JOIN sys_dept b ON a.dept_id = b.id\n" + "WHERE a.type = '知识库' AND a.del_flag = 0\n" + "GROUP BY b.name\n" + "ORDER BY b.name ");
|
||||
} else {
|
||||
result = jdbcTemplate.queryForList(
|
||||
"SELECT COUNT(a.id) AS resourceNum,b.name AS deptName\n" +
|
||||
"FROM tb_data_resource a INNER JOIN sys_dept b ON a.dept_id = b.id\n" +
|
||||
"WHERE a.type = '知识库' AND a.del_flag = 0\n" +
|
||||
"AND (b.ID = ? OR INSTR(b.pids,?))\n" +
|
||||
"GROUP BY b.name\n" +
|
||||
"ORDER BY b.name ", pas);
|
||||
result = jdbcTemplate.queryForList("SELECT COUNT(a.id) AS resourceNum,b.name AS deptName\n" + "FROM tb_data_resource a INNER JOIN sys_dept b ON a.dept_id = b.id\n" + "WHERE a.type = '知识库' AND a.del_flag = 0\n" + "AND (b.ID = ? OR INSTR(b.pids,?))\n" + "GROUP BY b.name\n" + "ORDER BY b.name ", pas);
|
||||
}
|
||||
|
||||
List<List<Map<String, Object>>> partition = Lists.partition(result, pageSize);
|
||||
|
@ -1710,9 +1632,7 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
|
|||
public List<Map<String, Object>> assemblerCarDetail(Map<String, Object> params) {
|
||||
List<Map<String, Object>> result;
|
||||
Object[] ps = {params.get("resourceType"), params.get("id"), (Integer.parseInt(params.get("page").toString()) - 1) * Integer.parseInt(params.get("limit").toString()), Integer.parseInt(params.get("limit").toString())};
|
||||
result = jdbcTemplate.queryForList("SELECT a.* FROM tb_resource_car a INNER JOIN sys_user b ON a.creator = b.id " +
|
||||
"INNER JOIN tb_data_resource d ON a.resource_id = d.id WHERE a.del_flag = 0 AND d.type = ? AND " +
|
||||
"d.dept_id = ? AND d.del_flag = 0 ORDER BY a.create_date DESC LIMIT ?,?", ps);
|
||||
result = jdbcTemplate.queryForList("SELECT a.* FROM tb_resource_car a INNER JOIN sys_user b ON a.creator = b.id " + "INNER JOIN tb_data_resource d ON a.resource_id = d.id WHERE a.del_flag = 0 AND d.type = ? AND " + "d.dept_id = ? AND d.del_flag = 0 ORDER BY a.create_date DESC LIMIT ?,?", ps);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -1903,8 +1823,7 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
|
|||
resourceIds.add(Long.parseLong(abilityApplicationDTO1.getResourceId()));
|
||||
} else {
|
||||
TResourceMountApplyDTO resourceMountApplyDTO = tResourceMountApplyService.get(Long.valueOf(his.getBusinessKey()));
|
||||
if (resourceMountApplyDTO != null && resourceMountApplyDTO.getResourceDTO() != null
|
||||
&& resourceMountApplyDTO.getResourceDTO().getId() != null) {
|
||||
if (resourceMountApplyDTO != null && resourceMountApplyDTO.getResourceDTO() != null && resourceMountApplyDTO.getResourceDTO().getId() != null) {
|
||||
resourceIds.add(resourceMountApplyDTO.getResourceDTO().getId());
|
||||
if (resourceMountApplyDTO.getResourceId() != null) {
|
||||
ResourceDTO resourceDTO = get(resourceMountApplyDTO.getResourceId());
|
||||
|
@ -1979,21 +1898,15 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
|
|||
Map componentMap = new HashMap();
|
||||
componentMap.put("title", "组件服务");
|
||||
Map<String, List> map = new ConcurrentHashMap<>();
|
||||
List<CompletableFuture> tasks = resourceTypeMap.get("组件服务").stream().map(it -> {
|
||||
CompletableFuture task = CompletableFuture.runAsync(() -> {
|
||||
selectAttrsByResourceId(Long.parseLong(it.get("id").toString())).stream().filter(temp -> "组件类型".equals(temp.getAttrType())).forEach(attr -> {
|
||||
if (map.get(attr.getAttrValue()) != null) {
|
||||
map.get(attr.getAttrValue()).add(it);
|
||||
} else {
|
||||
map.put(attr.getAttrValue(), (List) Collections.synchronizedList(new ArrayList() {{
|
||||
add(it);
|
||||
}}));
|
||||
}
|
||||
});
|
||||
}, executor);
|
||||
return task;
|
||||
}).collect(Collectors.toList());
|
||||
CompletableFuture.allOf(tasks.toArray(new CompletableFuture[tasks.size()])).join();
|
||||
CompletableFuture.allOf(resourceTypeMap.get("组件服务").stream().map(it -> CompletableFuture.runAsync(() -> selectAttrsByResourceId(Long.parseLong(it.get("id").toString())).stream().filter(temp -> "组件类型".equals(temp.getAttrType())).forEach(attr -> {
|
||||
if (map.get(attr.getAttrValue()) != null) {
|
||||
map.get(attr.getAttrValue()).add(it);
|
||||
} else {
|
||||
map.put(attr.getAttrValue(), (List) Collections.synchronizedList(new ArrayList() {{
|
||||
add(it);
|
||||
}}));
|
||||
}
|
||||
}), executor)).toArray(CompletableFuture[]::new)).join();
|
||||
componentMap.put("children", map.entrySet().stream().map(it -> new HashMap() {{
|
||||
put("title", it.getKey());
|
||||
put("children", it.getValue());
|
||||
|
@ -2002,7 +1915,64 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
|
|||
}
|
||||
return result;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getCountByFuzzyQuery(String keyWorld) {
|
||||
ArrayList<Map> resultList = new ArrayList<>();
|
||||
CompletableFuture<Void> DBresourceCount = CompletableFuture.runAsync(() -> resultList.addAll(resourceDao.selectTypeCountByName(keyWorld)));
|
||||
|
||||
switch (Constant.ProjectPlace.getByFlag(projectPlace)) {
|
||||
case TSINGTAO_XHA:
|
||||
break;
|
||||
case TSINGTAO: {
|
||||
CompletableFuture<Void> dataResourceCount = CompletableFuture.runAsync(() -> { //数据资源
|
||||
//青岛市局数据资源
|
||||
TsingtaoDataResourceService tsingtaoDataResourceService = new TsingtaoDataResourceService();
|
||||
GetDataResourceListDto getDataResourceListDto = new GetDataResourceListDto().setPageNum(1).setPageSize(5).setServiceName(keyWorld);
|
||||
HashMap dataResource = (HashMap) tsingtaoDataResourceService.getDataResource(getDataResourceListDto);
|
||||
resultList.add(new HashMap<String, Object>() {
|
||||
{
|
||||
put("count", null == dataResource ? "0" : dataResource.get("rows") + "");
|
||||
put("type", "数据资源");
|
||||
}
|
||||
});
|
||||
}, executor);
|
||||
|
||||
CompletableFuture<Void> infrastructureCount = CompletableFuture.runAsync(() -> { //基础设施
|
||||
HashMap<Object, Object> queryMap = new HashMap<>();
|
||||
queryMap.put("cameraName",keyWorld);
|
||||
Integer countNew = cameraChannelMapper.selectByParentIdCountNew(queryMap, null, "");
|
||||
resultList.add(new HashMap<String, Object>() {
|
||||
{
|
||||
put("count", countNew + "");
|
||||
put("type", "基础设施");
|
||||
}
|
||||
});
|
||||
|
||||
}, executor);
|
||||
|
||||
CompletableFuture<Void> all = CompletableFuture.allOf(DBresourceCount, dataResourceCount, infrastructureCount);
|
||||
all.join();
|
||||
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
//未查到的类型返回数量0
|
||||
List<String> temp = new ArrayList<>();
|
||||
resultList.forEach(map -> temp.add(map.get("type").toString()));
|
||||
Arrays.stream(censusTypes).filter(index -> !temp.contains(index)).forEach(index -> {
|
||||
Map<String, Object> nullMap = new HashMap<String, Object>() {
|
||||
{
|
||||
put("count", "0");
|
||||
put("type", index);
|
||||
}
|
||||
};
|
||||
resultList.add(nullMap);
|
||||
});
|
||||
return resultList;
|
||||
}
|
||||
|
||||
}
|
|
@ -25,7 +25,6 @@ public class ShiroSessionManager extends DefaultWebSessionManager {
|
|||
@Override
|
||||
protected Serializable getSessionId(ServletRequest request, ServletResponse response) {
|
||||
String sessionId = WebUtils.toHttp(request).getHeader(HEADER_TOKEN_NAME);
|
||||
log.error("获取的sessionId为------>{}", sessionId);
|
||||
if (StringUtils.isEmpty(sessionId)) {
|
||||
return super.getSessionId(request, response);
|
||||
} else {
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
DROP TABLE IF EXISTS `t_api_count_history`;
|
||||
CREATE TABLE `t_api_count_history` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`version` bigint COMMENT '数据版本号,从0递增',
|
||||
`current_count`bigint COMMENT '当前总数,只有最新一条有效',
|
||||
`history_count`bigint COMMENT '保存历史重启的数量',
|
||||
`create_time` datetime NULL DEFAULT NULL,
|
||||
`update_time` datetime NULL DEFAULT NULL,
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB COMMENT = '网关历史调用总数';
|
|
@ -0,0 +1,7 @@
|
|||
ALTER TABLE `tb_data_resource`
|
||||
ADD COLUMN `pin_top` int NULL COMMENT '是否置顶' ,
|
||||
ADD COLUMN `pin_top_time` datetime NULL COMMENT '置顶操作时间';
|
||||
|
||||
UPDATE tb_data_resource
|
||||
SET pin_top = 0,
|
||||
pin_top_time = NOW();
|
|
@ -0,0 +1,144 @@
|
|||
<?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="io.renren.modules.meeting.dao.TMeetingroomBookMapper">
|
||||
<resultMap id="BaseResultMap" type="io.renren.modules.meeting.entity.TMeetingroomBook">
|
||||
<result column="id" property="id" />
|
||||
<result column="room_id" property="roomId" />
|
||||
<result column="book_date" property="bookDate"/>
|
||||
<result column="start_time" property="startTime" />
|
||||
<result column="end_time" property="endTime" />
|
||||
<result column="name" property="name" />
|
||||
<result column="phone" property="phone" />
|
||||
<result column="dept" property="dept" />
|
||||
<result column="matter" property="matter" />
|
||||
<result column="file" property="file" />
|
||||
<result column="create_date" property="createDate" />
|
||||
<result column="creator" property="creator" />
|
||||
<result column="state" property="state" />
|
||||
<result column="audit_viem" property="auditViem" />
|
||||
<result column="auditor" property="auditor" />
|
||||
<result column="audit_time" property="auditTime" />
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="dtoMap" type="io.renren.modules.meeting.dto.TMeetingroomBookDTO">
|
||||
<result column="id" property="id" />
|
||||
<result column="room_id" property="roomId" />
|
||||
<result column="book_date" property="bookDate"/>
|
||||
<result column="start_time" property="startTime" />
|
||||
<result column="end_time" property="endTime" />
|
||||
<result column="name" property="name" />
|
||||
<result column="phone" property="phone" />
|
||||
<result column="dept" property="dept" />
|
||||
<result column="matter" property="matter" />
|
||||
<result column="file" property="file" />
|
||||
<result column="create_date" property="createDate" />
|
||||
<result column="creator" property="creator" />
|
||||
<result column="state" property="state" />
|
||||
<result column="audit_viem" property="auditViem" />
|
||||
<result column="auditor" property="auditor" />
|
||||
<result column="audit_time" property="auditTime" />
|
||||
</resultMap>
|
||||
|
||||
<!-- 表字段 -->
|
||||
<sql id="baseColumns">
|
||||
t.id
|
||||
, t.room_id
|
||||
, t.book_date
|
||||
, t.start_time
|
||||
, t.end_time
|
||||
, t.name
|
||||
, t.phone
|
||||
, t.dept
|
||||
, t.matter
|
||||
, t.file
|
||||
, t.create_date
|
||||
, t.creator
|
||||
, t.state
|
||||
, t.audit_viem
|
||||
, t.auditor
|
||||
, t.audit_time
|
||||
</sql>
|
||||
|
||||
<select id="selectByRoomAndTime" resultMap="dtoMap">
|
||||
select <include refid="baseColumns"/>
|
||||
from t_meetingroom_book t
|
||||
where t.room_id = #{roomId}
|
||||
and t.state != 3
|
||||
<if test="bookDate != 'null 00:00:00'.toString()">
|
||||
and t.book_date = #{bookDate}
|
||||
</if>
|
||||
<if test="startTime.length() == 19 and startTime.substring(11,19) != null
|
||||
and endTime.length() == 19 and endTime.substring(11,19) != null ">
|
||||
and t.end_time >= #{startTime} and #{endTime} >= t.start_time
|
||||
</if>
|
||||
order by t.start_time asc
|
||||
</select>
|
||||
<select id="queryCountByRoomName" resultType="java.lang.Integer">
|
||||
select count(t.id) from t_meetingroom_book t
|
||||
left join t_meetingroom tm on t.room_id = tm.id and tm.del_flag = 0
|
||||
where t.creator = #{userId}
|
||||
<if test="roomName != null and roomName != ''">
|
||||
and tm.name like CONCAT('%',#{roomName},'%')
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="queryList" resultMap="dtoMap">
|
||||
select <include refid="baseColumns"/>,tm.name as roomName
|
||||
from t_meetingroom_book t
|
||||
left join t_meetingroom tm on t.room_id = tm.id and tm.del_flag = 0
|
||||
where t.creator = #{userId}
|
||||
<if test="roomName != null and roomName != ''">
|
||||
and tm.name like CONCAT('%',#{roomName},'%')
|
||||
</if>
|
||||
order by t.create_date desc
|
||||
limit #{currentNum},#{pageSize}
|
||||
</select>
|
||||
<select id="queryCountByState" resultType="java.lang.Integer">
|
||||
select count(t.id) from t_meetingroom_book t
|
||||
left join t_meetingroom tm on t.room_id = tm.id and tm.del_flag = 0
|
||||
<where>
|
||||
<if test="roomName != null and roomName != ''">
|
||||
and tm.name like CONCAT('%',#{roomName},'%')
|
||||
</if>
|
||||
<if test="state != null">
|
||||
<choose>
|
||||
<when test="state == 1">
|
||||
and t.state = #{state}
|
||||
</when>
|
||||
<otherwise>
|
||||
and t.state in (2,3)
|
||||
</otherwise>
|
||||
</choose>
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="queryListForAudit" resultType="io.renren.modules.meeting.dto.TMeetingroomBookDTO">
|
||||
select <include refid="baseColumns"/>,tm.name as roomName
|
||||
from t_meetingroom_book t
|
||||
left join t_meetingroom tm on t.room_id = tm.id and tm.del_flag = 0
|
||||
<where>
|
||||
<if test="roomName != null and roomName != ''">
|
||||
and tm.name like CONCAT('%',#{roomName},'%')
|
||||
</if>
|
||||
<if test="state != null">
|
||||
<choose>
|
||||
<when test="state == 1">
|
||||
and t.state = #{state}
|
||||
</when>
|
||||
<otherwise>
|
||||
and t.state in (2,3)
|
||||
</otherwise>
|
||||
</choose>
|
||||
</if>
|
||||
</where>
|
||||
order by t.state asc,t.create_date desc
|
||||
limit #{currentNum},#{pageSize}
|
||||
</select>
|
||||
<select id="selectInvalid" resultMap="BaseResultMap">
|
||||
select <include refid="baseColumns"/>
|
||||
from t_meetingroom_book t
|
||||
where t.state = 1
|
||||
and #{date} > t.book_date
|
||||
</select>
|
||||
|
||||
</mapper>
|
|
@ -0,0 +1,79 @@
|
|||
<?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="io.renren.modules.meeting.dao.TMeetingroomMapper">
|
||||
<resultMap id="BaseResultMap" type="io.renren.modules.meeting.entity.TMeetingroom">
|
||||
<result column="id" property="id" />
|
||||
<result column="num" property="num" />
|
||||
<result column="name" property="name" />
|
||||
<result column="area" property="area" />
|
||||
<result column="capacity" property="capacity" />
|
||||
<result column="pic" property="pic" />
|
||||
<result column="description" property="description" />
|
||||
<result property="creator" column="creator"/>
|
||||
<result property="createDate" column="create_date"/>
|
||||
<result column="modify_time" property="modifyTime" />
|
||||
<result column="del_flag" property="delFlag"/>
|
||||
<result column="modifier" property="modifier"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="meetingroomDto" type="io.renren.modules.meeting.dto.TMeetingroomDTO">
|
||||
<result column="id" property="id" />
|
||||
<result column="num" property="num" />
|
||||
<result column="name" property="name" />
|
||||
<result column="area" property="area" />
|
||||
<result column="capacity" property="capacity" />
|
||||
<result column="pic" property="pic" />
|
||||
<result column="description" property="description" />
|
||||
<result property="creator" column="creator"/>
|
||||
<result property="createTime" column="create_date"/>
|
||||
<result column="modify_time" property="modifyTime" />
|
||||
<result column="del_flag" property="delFlag"/>
|
||||
<result column="modifier" property="modifier"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 表字段 -->
|
||||
<sql id="baseColumns">
|
||||
t.id
|
||||
, t.num
|
||||
, t.name
|
||||
, t.area
|
||||
, t.capacity
|
||||
, t.pic
|
||||
, t.description
|
||||
, t.create_date
|
||||
, t.modify_time
|
||||
, t.del_flag
|
||||
, t.creator
|
||||
, t.modifier
|
||||
</sql>
|
||||
|
||||
<select id="queryCount" resultType="java.lang.Integer">
|
||||
select count(t.id) FROM t_meetingroom t
|
||||
where t.del_flag = 0
|
||||
<if test="name != null and name != ''">
|
||||
and t.name like CONCAT('%',#{name},'%')
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="queryList" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="baseColumns" />
|
||||
FROM t_meetingroom t
|
||||
where t.del_flag = 0
|
||||
<if test="name != null and name != ''">
|
||||
and t.name like CONCAT('%',#{name},'%')
|
||||
</if>
|
||||
ORDER BY t.create_date desc
|
||||
limit #{currentNum},#{pageSize}
|
||||
</select>
|
||||
<select id="selectByName" resultMap="meetingroomDto">
|
||||
SELECT
|
||||
<include refid="baseColumns" />
|
||||
FROM t_meetingroom t
|
||||
where t.del_flag = 0
|
||||
<if test="name != null and name != ''">
|
||||
and t.name like CONCAT('%',#{name},'%')
|
||||
</if>
|
||||
ORDER BY t.create_date desc
|
||||
</select>
|
||||
</mapper>
|
|
@ -37,6 +37,8 @@
|
|||
<result property="infoList" column="info_list"
|
||||
typeHandler="com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler"/>
|
||||
<result property="applyNumber" column="apply_number"/>
|
||||
<result property="pinTop" column="pin_top"/>
|
||||
<result property="pinTopTime" column="pin_top_time"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="resourceDTO" type="io.renren.modules.resource.dto.ResourceDTO">
|
||||
|
@ -81,6 +83,8 @@
|
|||
typeHandler="com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler"/>
|
||||
<result property="total" column="total"/>
|
||||
<result property="applyNumber" column="apply_number"/>
|
||||
<result property="pinTop" column="pin_top"/>
|
||||
<result property="pinTopTime" column="pin_top_time"/>
|
||||
</resultMap>
|
||||
|
||||
<update id="deleteByIds">
|
||||
|
@ -183,7 +187,16 @@
|
|||
)
|
||||
</if>
|
||||
<if test="orderField != null and orderField !=''">
|
||||
ORDER BY ${orderField} ${orderType}
|
||||
<if test="orderField == 'pin_top'">
|
||||
ORDER BY ${orderField} ${orderType}, pin_top_time DESC
|
||||
</if>
|
||||
<if test="orderField == 'deptSort'">
|
||||
ORDER BY sd.type, sd.sort
|
||||
</if>
|
||||
<if test="orderField != 'pin_top' and orderField != 'deptSort'">
|
||||
ORDER BY ${orderField} ${orderType}
|
||||
</if>
|
||||
|
||||
</if>
|
||||
</select>
|
||||
|
||||
|
@ -294,6 +307,8 @@
|
|||
tdr.undercarriage_reason,
|
||||
tdr.undercarriage_user_name,
|
||||
tdr.info_list,
|
||||
tdr.pin_top,
|
||||
tdr.pin_top_time,
|
||||
IFNULL( trs.score, 0 ) AS "score",
|
||||
IFNULL( taa.applyCount, 0 ) AS "applyCount",
|
||||
IFNULL( trc.collectCount, 0 ) AS "collectCount",
|
||||
|
@ -371,6 +386,8 @@
|
|||
tdr.undercarriage_user_name,
|
||||
tdr.info_list,
|
||||
tdr.total AS total,
|
||||
tdr.pin_top,
|
||||
tdr.pin_top_time,
|
||||
IFNULL(trs.score, 0 ) AS "score",
|
||||
IFNULL(taa.applyCount, 0 ) AS "applyCount",
|
||||
IFNULL(trc.collectCount, 0) AS "collectCount",
|
||||
|
@ -442,7 +459,15 @@
|
|||
</foreach>
|
||||
</if>
|
||||
<if test="orderField != null and orderField !=''">
|
||||
ORDER BY ${orderField} ${orderType}
|
||||
<if test="orderField == 'pin_top'">
|
||||
ORDER BY ${orderField} ${orderType}, pin_top_time DESC
|
||||
</if>
|
||||
<if test="orderField == 'deptSort'">
|
||||
ORDER BY sd.type, sd.sort
|
||||
</if>
|
||||
<if test="orderField != 'pin_top' and orderField != 'deptSort'">
|
||||
ORDER BY ${orderField} ${orderType}
|
||||
</if>
|
||||
LIMIT ${pageNum}, ${pageSize}
|
||||
</if>
|
||||
</select>
|
||||
|
@ -584,10 +609,12 @@
|
|||
</if>
|
||||
GROUP BY dept_id ) tdr ON sd.id = tdr.dept_id
|
||||
LEFT JOIN sys_region sr ON sd.district = sr.id
|
||||
ORDER BY sd.type, sr.sort, sd.sort
|
||||
) temp1
|
||||
WHERE
|
||||
1 = 1
|
||||
AND temp1.deptCount != 0
|
||||
|
||||
</select>
|
||||
|
||||
<select id="selectTypeCountByDept" resultType="java.lang.Integer">
|
||||
|
@ -1508,4 +1535,18 @@
|
|||
AND tdr.id = #{id}
|
||||
AND tda.del_flag = 0
|
||||
</select>
|
||||
<select id="selectTypeCountByName" resultType="java.util.Map">
|
||||
SELECT
|
||||
type,
|
||||
count(id) AS "count"
|
||||
FROM tb_data_resource
|
||||
WHERE 1 = 1
|
||||
AND del_flag = 0
|
||||
<if test="keyWorld != null and keyWorld != ''">
|
||||
AND MATCH (name) AGAINST ( #{keyWorld} IN BOOLEAN MODE)
|
||||
</if>
|
||||
AND type != '赋能案例'
|
||||
GROUP BY type
|
||||
ORDER BY type
|
||||
</select>
|
||||
</mapper>
|
Loading…
Reference in New Issue