add: 代码提交

This commit is contained in:
ls
2025-08-14 13:58:03 +08:00
parent cc1b3664f8
commit ffc757b759
7 changed files with 36 additions and 4 deletions

View File

@@ -71,6 +71,10 @@
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-aop</artifactId> <artifactId>spring-boot-starter-aop</artifactId>
</dependency> </dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-elasticsearch</artifactId>
</dependency>
<dependency> <dependency>
<groupId>org.springframework</groupId> <groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId> <artifactId>spring-context-support</artifactId>

View File

@@ -344,6 +344,7 @@ public class FlwInstanceServiceImpl extends FlowServiceNoFactory implements FlwI
TicketsEntity ticketsEntity = new TicketsEntity(); TicketsEntity ticketsEntity = new TicketsEntity();
ticketsEntity.setTicketsId(Long.valueOf(ticketsId)); ticketsEntity.setTicketsId(Long.valueOf(ticketsId));
ticketsEntity.setStatus(TicketsStatusEnums.CANCEL.getCode()); ticketsEntity.setStatus(TicketsStatusEnums.CANCEL.getCode());
ticketsEntity.setUpdateTime(new Date());
ticketsService.updateById(ticketsEntity); ticketsService.updateById(ticketsEntity);
return R.ok("操作成功"); return R.ok("操作成功");

View File

@@ -1,8 +1,11 @@
package com.boge.modules.tickets.controller; package com.boge.modules.tickets.controller;
import java.util.Arrays; import java.util.Arrays;
import java.util.Date;
import java.util.Map; 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 com.boge.modules.tickets.dto.TicketsDTO;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
@@ -60,6 +63,9 @@ public class TicketsController {
@RequestMapping("/save") @RequestMapping("/save")
//@RequiresPermissions("tickets:tickets:save") //@RequiresPermissions("tickets:tickets:save")
public R save(@RequestBody TicketsEntity tickets){ public R save(@RequestBody TicketsEntity tickets){
SysUserEntity loginUser = ShiroUtils.getUserEntity();
tickets.setCreateTime(new Date());
tickets.setCreateUser(loginUser.getNickname());
ticketsService.save(tickets); ticketsService.save(tickets);
return R.ok(); return R.ok();

View File

@@ -6,7 +6,11 @@ import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; import java.util.Date;
import lombok.Data; 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 @Data
@TableName("sys_tickets") @TableName("sys_tickets")
@Document(indexName = "#{index.tickets}",createIndex = true)
public class TicketsEntity implements Serializable { public class TicketsEntity implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@@ -23,6 +28,7 @@ public class TicketsEntity implements Serializable {
* 工单id * 工单id
*/ */
@TableId @TableId
@Id
private Long ticketsId; private Long ticketsId;
/** /**
* 小车类型 * 小车类型
@@ -53,9 +59,9 @@ public class TicketsEntity implements Serializable {
*/ */
private String deptPhone; private String deptPhone;
/** /**
* 创建者ID * 创建者
*/ */
private Long createUserId; private String createUser;
/** /**
* 创建时间 * 创建时间
*/ */

View File

@@ -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> {
}

View File

@@ -51,10 +51,10 @@ public class TicketsServiceImpl extends ServiceImpl<TicketsDao, TicketsEntity> i
List<Long> longs = sysUserRoleService.queryRoleIdList(loginUser.getUserId()); List<Long> longs = sysUserRoleService.queryRoleIdList(loginUser.getUserId());
//判断是否是超级管理员 //判断是否是超级管理员
if (longs.contains(2L)){ if (longs.contains(2L)){
ticketsEntityQueryWrapper.orderBy(true, true,"create_time"); ticketsEntityQueryWrapper.orderBy(true, false,"create_time");
}else { }else {
ticketsEntityQueryWrapper.eq("assign_user_id", loginUser.getUserId()) ticketsEntityQueryWrapper.eq("assign_user_id", loginUser.getUserId())
.orderBy(true, true,"create_time");; .orderBy(true, false,"create_time");;
} }
} }

View File

@@ -32,3 +32,7 @@ spring:
wall: wall:
config: config:
multi-statement-allow: true multi-statement-allow: true
elasticsearch:
rest:
uris: http://localhost:9200