add: 代码提交
This commit is contained in:
@@ -71,6 +71,10 @@
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-aop</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-data-elasticsearch</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-context-support</artifactId>
|
||||
|
||||
@@ -344,6 +344,7 @@ public class FlwInstanceServiceImpl extends FlowServiceNoFactory implements FlwI
|
||||
TicketsEntity ticketsEntity = new TicketsEntity();
|
||||
ticketsEntity.setTicketsId(Long.valueOf(ticketsId));
|
||||
ticketsEntity.setStatus(TicketsStatusEnums.CANCEL.getCode());
|
||||
ticketsEntity.setUpdateTime(new Date());
|
||||
ticketsService.updateById(ticketsEntity);
|
||||
|
||||
return R.ok("操作成功");
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
package com.boge.modules.tickets.controller;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
|
||||
import com.boge.common.utils.ShiroUtils;
|
||||
import com.boge.modules.sys.entity.SysUserEntity;
|
||||
import com.boge.modules.tickets.dto.TicketsDTO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
@@ -60,6 +63,9 @@ public class TicketsController {
|
||||
@RequestMapping("/save")
|
||||
//@RequiresPermissions("tickets:tickets:save")
|
||||
public R save(@RequestBody TicketsEntity tickets){
|
||||
SysUserEntity loginUser = ShiroUtils.getUserEntity();
|
||||
tickets.setCreateTime(new Date());
|
||||
tickets.setCreateUser(loginUser.getNickname());
|
||||
ticketsService.save(tickets);
|
||||
|
||||
return R.ok();
|
||||
|
||||
@@ -6,7 +6,11 @@ import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import lombok.Data;
|
||||
import org.springframework.data.elasticsearch.annotations.Document;
|
||||
import org.springframework.data.elasticsearch.annotations.Field;
|
||||
import org.springframework.data.elasticsearch.annotations.FieldType;
|
||||
|
||||
import org.springframework.data.annotation.Id;
|
||||
/**
|
||||
*
|
||||
*
|
||||
@@ -16,6 +20,7 @@ import lombok.Data;
|
||||
*/
|
||||
@Data
|
||||
@TableName("sys_tickets")
|
||||
@Document(indexName = "#{index.tickets}",createIndex = true)
|
||||
public class TicketsEntity implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@@ -23,6 +28,7 @@ public class TicketsEntity implements Serializable {
|
||||
* 工单id
|
||||
*/
|
||||
@TableId
|
||||
@Id
|
||||
private Long ticketsId;
|
||||
/**
|
||||
* 小车类型
|
||||
@@ -53,9 +59,9 @@ public class TicketsEntity implements Serializable {
|
||||
*/
|
||||
private String deptPhone;
|
||||
/**
|
||||
* 创建者ID
|
||||
* 创建者
|
||||
*/
|
||||
private Long createUserId;
|
||||
private String createUser;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.boge.modules.tickets.repository;
|
||||
|
||||
|
||||
import com.boge.modules.tickets.entity.TicketsEntity;
|
||||
import org.springframework.data.elasticsearch.repository.ElasticsearchRepository;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
@Repository
|
||||
public interface TickesRepository extends ElasticsearchRepository<TicketsEntity, String> {
|
||||
|
||||
}
|
||||
@@ -51,10 +51,10 @@ public class TicketsServiceImpl extends ServiceImpl<TicketsDao, TicketsEntity> i
|
||||
List<Long> longs = sysUserRoleService.queryRoleIdList(loginUser.getUserId());
|
||||
//判断是否是超级管理员
|
||||
if (longs.contains(2L)){
|
||||
ticketsEntityQueryWrapper.orderBy(true, true,"create_time");
|
||||
ticketsEntityQueryWrapper.orderBy(true, false,"create_time");
|
||||
}else {
|
||||
ticketsEntityQueryWrapper.eq("assign_user_id", loginUser.getUserId())
|
||||
.orderBy(true, true,"create_time");;
|
||||
.orderBy(true, false,"create_time");;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -32,3 +32,7 @@ spring:
|
||||
wall:
|
||||
config:
|
||||
multi-statement-allow: true
|
||||
|
||||
elasticsearch:
|
||||
rest:
|
||||
uris: http://localhost:9200
|
||||
|
||||
Reference in New Issue
Block a user