恢复企业管理
parent
de724ddfbd
commit
bf66fae3f7
|
@ -0,0 +1,24 @@
|
|||
//package com.muyu.analyze.feign;
|
||||
//
|
||||
//import com.muyu.system.common.domain.Fence;
|
||||
//import org.springframework.cloud.openfeign.FeignClient;
|
||||
//import org.springframework.web.bind.annotation.PostMapping;
|
||||
//import org.springframework.web.bind.annotation.RequestBody;
|
||||
//
|
||||
///**
|
||||
// * @ProjectName: cloud-vehicles
|
||||
// * @PackageName: com.muyu.analyze.feign
|
||||
// * @Description TODO
|
||||
// * @Author HuangDaJu
|
||||
// * @Date 2024/4/6 21:19
|
||||
// * @Version 1.0
|
||||
// */
|
||||
//@FeignClient("muyu-business")
|
||||
//public interface BusinessFeignService {
|
||||
//
|
||||
// @PostMapping("")
|
||||
// public void alarmLogsService(@RequestBody Fence fence);
|
||||
//
|
||||
//
|
||||
//
|
||||
//}
|
|
@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSON;
|
|||
import com.muyu.analyze.mapper.VehicleMapper;
|
||||
import com.muyu.analyze.service.VehicleService;
|
||||
import com.muyu.business.remote.RemoteAlarmLogsService;
|
||||
import com.muyu.common.redis.service.RedisService;
|
||||
import com.muyu.system.common.domain.Car;
|
||||
import com.muyu.system.common.domain.Fence;
|
||||
import com.muyu.system.common.domain.VehicleData;
|
||||
|
@ -14,6 +15,7 @@ import org.springframework.stereotype.Service;
|
|||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
|
@ -31,7 +33,7 @@ import static java.lang.Double.parseDouble;
|
|||
public class FenceAlarmImpl implements VehicleService {
|
||||
|
||||
@Autowired
|
||||
private StringRedisTemplate redisTemplate;
|
||||
private RedisService redisService;
|
||||
@Autowired
|
||||
private VehicleMapper vehicleMapper;
|
||||
|
||||
|
@ -73,9 +75,12 @@ public class FenceAlarmImpl implements VehicleService {
|
|||
|
||||
String key = "fenceType1";
|
||||
String value = JSON.toJSONString(fence);
|
||||
redisTemplate.opsForSet().add(key, value);
|
||||
HashSet<Fence> fences = new HashSet<>();
|
||||
Fence fence1 = JSON.parseObject(value, Fence.class);
|
||||
fences.add(fence1);
|
||||
redisService.setCacheSet(key, fences);
|
||||
long expireTime = 30;
|
||||
redisTemplate.expire(key, expireTime, TimeUnit.MINUTES);
|
||||
redisService.expire(key, expireTime, TimeUnit.MINUTES);
|
||||
|
||||
|
||||
}
|
||||
|
@ -86,11 +91,14 @@ public class FenceAlarmImpl implements VehicleService {
|
|||
if (withinFence){
|
||||
System.out.println("车辆vin:"+vin+"------驶入禁行区----报警");
|
||||
|
||||
String key = "fenceType1";
|
||||
String value = JSON.toJSONString(fence);
|
||||
redisTemplate.opsForSet().add(key, value);
|
||||
long expireTime = 30;
|
||||
redisTemplate.expire(key, expireTime, TimeUnit.MINUTES);
|
||||
String key = "fenceType1";
|
||||
String value = JSON.toJSONString(fence);
|
||||
HashSet<Fence> fences = new HashSet<>();
|
||||
Fence fence1 = JSON.parseObject(value, Fence.class);
|
||||
fences.add(fence1);
|
||||
redisService.setCacheSet(key, fences);
|
||||
long expireTime = 30;
|
||||
redisService.expire(key, expireTime, TimeUnit.MINUTES);
|
||||
|
||||
}else{
|
||||
System.out.println("车辆vin:"+vin+"------在安全区");
|
||||
|
|
|
@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|||
import com.muyu.analyze.mapper.VehicleMapper;
|
||||
import com.muyu.analyze.service.VehicleService;
|
||||
import com.muyu.system.common.domain.VehicleData;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
|
@ -16,12 +17,13 @@ import org.springframework.stereotype.Service;
|
|||
* @Version 1.0
|
||||
*/
|
||||
@Service("realTimeDataEvent")
|
||||
@Slf4j
|
||||
public class RealTimeDataEventImpl implements VehicleService {
|
||||
|
||||
@Override
|
||||
public void eventResolution(VehicleData analyze) {
|
||||
// System.out.println("我是实时数据");
|
||||
// System.out.println(analyze);
|
||||
|
||||
log.info("我是实时数据");
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -36,18 +36,18 @@ public class StoredEventImpl implements VehicleService {
|
|||
public void eventResolution(VehicleData analyze) {
|
||||
|
||||
|
||||
// list.add(analyze);
|
||||
// if (list.size() >= 50) {
|
||||
// log.info("集合满50,存储事件开始");
|
||||
// Boolean i= vehicleMapper.addVehicleStoredEvent(list);
|
||||
//
|
||||
// if (i) {
|
||||
// list.clear();
|
||||
// log.info("存储事件结束");
|
||||
//
|
||||
// }
|
||||
//
|
||||
// }
|
||||
list.add(analyze);
|
||||
if (list.size() >= 50) {
|
||||
log.info("集合满50,存储事件开始");
|
||||
Boolean i= vehicleMapper.addVehicleStoredEvent(list);
|
||||
|
||||
if (i) {
|
||||
list.clear();
|
||||
log.info("存储事件结束");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -42,9 +42,11 @@ public class FaultLogsServiceImpl extends ServiceImpl<FaultLogsMapper, FaultLogs
|
|||
*/
|
||||
@Autowired
|
||||
private FaultCodesService faultCodesService;
|
||||
|
||||
@Autowired
|
||||
private StringRedisTemplate redisTemplate;
|
||||
|
||||
|
||||
@Override
|
||||
public List<FaultLogsResponse> selectFaultLogsList(FaultLogsReq faultLogsReq) {
|
||||
LambdaQueryWrapper<FaultLogs> wrapper = new LambdaQueryWrapper<>();
|
||||
|
@ -96,17 +98,19 @@ public class FaultLogsServiceImpl extends ServiceImpl<FaultLogsMapper, FaultLogs
|
|||
@Override
|
||||
public void faultLogsService() {
|
||||
// 获取key对应的Set中所有成员(即序列化后的Fence对象)
|
||||
Set<String> fenceValues = redisTemplate.opsForSet().members("breakdown");
|
||||
// Set<String> fenceValues = redisTemplate.opsForSet().members("breakdown");
|
||||
|
||||
// 遍历Set,将每个序列化的Fence对象反序列化为Fence对象
|
||||
for (String serializedFence : fenceValues) {
|
||||
|
||||
FaultLogsAddReq faultLogsAddReq = JSON.parseObject(serializedFence, FaultLogsAddReq.class);
|
||||
|
||||
faultLogsMapper.FaultLogsService(faultLogsAddReq);
|
||||
}
|
||||
|
||||
// for (String serializedFence : fenceValues) {
|
||||
//
|
||||
// FaultLogsAddReq faultLogsAddReq = JSON.parseObject(serializedFence, FaultLogsAddReq.class);
|
||||
// Integer faultLevel = faultLogsAddReq.getFaultLevel();
|
||||
//
|
||||
//
|
||||
// }
|
||||
// faultLogsMapper.FaultLogsService(faultLogsAddReq);
|
||||
|
||||
System.out.println("添加了故障日志数据库");
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Tomcat
|
||||
server:
|
||||
port: 9007
|
||||
port: 9009
|
||||
|
||||
# Spring
|
||||
spring:
|
||||
|
|
|
@ -0,0 +1,164 @@
|
|||
package com.muyu.system.common.domain;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.muyu.common.core.annotation.Excel;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 企业管理对象 enterprise_info
|
||||
*
|
||||
* @author huangdaju
|
||||
* @date 2024-03-28
|
||||
*/
|
||||
public class EnterpriseInfo extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** $column.columnComment */
|
||||
private Long enterpriseId;
|
||||
|
||||
/** 企业名称 */
|
||||
@Excel(name = "企业名称")
|
||||
private String enterpriseName;
|
||||
|
||||
/** 联系人邮箱 */
|
||||
@Excel(name = "联系人邮箱")
|
||||
private String email;
|
||||
|
||||
/** 企业地址 */
|
||||
@Excel(name = "企业地址")
|
||||
private String enterpriseAddress;
|
||||
|
||||
/** 企业联系电话 */
|
||||
@Excel(name = "企业联系电话")
|
||||
private String phoneNumber;
|
||||
|
||||
/** 行业类型 */
|
||||
@Excel(name = "行业类型")
|
||||
private String industry;
|
||||
|
||||
/** 企业状态 */
|
||||
@Excel(name = "企业状态")
|
||||
private String status;
|
||||
|
||||
/** 企业标识 */
|
||||
@Excel(name = "企业标识")
|
||||
private String deptId;
|
||||
|
||||
/** 删除标志(0代表存在 2代表删除) */
|
||||
private String delFlag;
|
||||
|
||||
/** 负责人 */
|
||||
@Excel(name = "负责人")
|
||||
private String leader;
|
||||
|
||||
public void setEnterpriseId(Long enterpriseId)
|
||||
{
|
||||
this.enterpriseId = enterpriseId;
|
||||
}
|
||||
|
||||
public Long getEnterpriseId()
|
||||
{
|
||||
return enterpriseId;
|
||||
}
|
||||
public void setEnterpriseName(String enterpriseName)
|
||||
{
|
||||
this.enterpriseName = enterpriseName;
|
||||
}
|
||||
|
||||
public String getEnterpriseName()
|
||||
{
|
||||
return enterpriseName;
|
||||
}
|
||||
public void setEmail(String email)
|
||||
{
|
||||
this.email = email;
|
||||
}
|
||||
|
||||
public String getEmail()
|
||||
{
|
||||
return email;
|
||||
}
|
||||
public void setEnterpriseAddress(String enterpriseAddress)
|
||||
{
|
||||
this.enterpriseAddress = enterpriseAddress;
|
||||
}
|
||||
|
||||
public String getEnterpriseAddress()
|
||||
{
|
||||
return enterpriseAddress;
|
||||
}
|
||||
public void setPhoneNumber(String phoneNumber)
|
||||
{
|
||||
this.phoneNumber = phoneNumber;
|
||||
}
|
||||
|
||||
public String getPhoneNumber()
|
||||
{
|
||||
return phoneNumber;
|
||||
}
|
||||
public void setIndustry(String industry)
|
||||
{
|
||||
this.industry = industry;
|
||||
}
|
||||
|
||||
public String getIndustry()
|
||||
{
|
||||
return industry;
|
||||
}
|
||||
public void setStatus(String status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
public void setDeptId(String deptId)
|
||||
{
|
||||
this.deptId = deptId;
|
||||
}
|
||||
|
||||
public String getDeptId()
|
||||
{
|
||||
return deptId;
|
||||
}
|
||||
public void setDelFlag(String delFlag)
|
||||
{
|
||||
this.delFlag = delFlag;
|
||||
}
|
||||
|
||||
public String getDelFlag()
|
||||
{
|
||||
return delFlag;
|
||||
}
|
||||
public void setLeader(String leader)
|
||||
{
|
||||
this.leader = leader;
|
||||
}
|
||||
|
||||
public String getLeader()
|
||||
{
|
||||
return leader;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("enterpriseId", getEnterpriseId())
|
||||
.append("enterpriseName", getEnterpriseName())
|
||||
.append("email", getEmail())
|
||||
.append("enterpriseAddress", getEnterpriseAddress())
|
||||
.append("phoneNumber", getPhoneNumber())
|
||||
.append("industry", getIndustry())
|
||||
.append("status", getStatus())
|
||||
.append("deptId", getDeptId())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("delFlag", getDelFlag())
|
||||
.append("leader", getLeader())
|
||||
.toString();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,92 @@
|
|||
package com.muyu.system.common.domain.vo;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @ProjectName: cloud-vehicles
|
||||
* @PackageName: com.muyu.system.common.vo
|
||||
* @Description TODO
|
||||
* @Author HuangDaJu
|
||||
* @Date 2024/3/29 18:18
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@TableName("sys_dept")
|
||||
public class BusinessVo {
|
||||
|
||||
/** 部门ID */
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long deptId;
|
||||
|
||||
/** 父部门ID 默认查询100*/
|
||||
private Long parentId;
|
||||
|
||||
|
||||
private String logoType;
|
||||
|
||||
/** 祖级列表 */
|
||||
private String ancestors;
|
||||
|
||||
/** 部门名称 */
|
||||
private String deptName;
|
||||
|
||||
/** 显示顺序 */
|
||||
private Integer orderNum;
|
||||
|
||||
/** 负责人 */
|
||||
private String leader;
|
||||
|
||||
/** 联系电话 */
|
||||
private String phone;
|
||||
|
||||
/** 邮箱 */
|
||||
private String email;
|
||||
|
||||
/** 部门状态:0正常,1停用 */
|
||||
private String status;
|
||||
|
||||
/** 删除标志(0代表存在 2代表删除) */
|
||||
private String delFlag;
|
||||
|
||||
/**
|
||||
* 当前页
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private Integer pageNum;
|
||||
|
||||
/**
|
||||
* 每页大小
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private Integer pageSize;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date updateTime;
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,114 @@
|
|||
package com.muyu.system.controller;
|
||||
|
||||
import java.util.List;
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.utils.poi.ExcelUtil;
|
||||
import com.muyu.common.core.web.page.TableDataInfo;
|
||||
import com.muyu.system.common.domain.EnterpriseInfo;
|
||||
import com.muyu.system.common.domain.SysDept;
|
||||
|
||||
import com.muyu.system.common.domain.vo.BusinessVo;
|
||||
import com.muyu.system.service.ISysDeptService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.muyu.common.log.annotation.Log;
|
||||
import com.muyu.common.log.enums.BusinessType;
|
||||
import com.muyu.common.security.annotation.RequiresPermissions;
|
||||
|
||||
import com.muyu.system.service.IEnterpriseInfoService;
|
||||
import com.muyu.common.core.web.controller.BaseController;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
|
||||
/**
|
||||
* 企业管理Controller
|
||||
*
|
||||
* @author huangdaju
|
||||
* @date 2024-03-28
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/info")
|
||||
public class EnterpriseInfoController extends BaseController{
|
||||
/**
|
||||
* 通过@Autowired注解自动注入IEnterpriseInfoService接口的实现,用于处理企业信息的服务。
|
||||
*/
|
||||
@Autowired
|
||||
private IEnterpriseInfoService enterpriseInfoService;
|
||||
@Autowired
|
||||
private ISysDeptService iSysDeptService;
|
||||
|
||||
/**
|
||||
* 查询企业管理列表
|
||||
*/
|
||||
@RequiresPermissions("system:info:list")
|
||||
@GetMapping("/list")
|
||||
public Result<TableDataInfo> list(BusinessVo businessVo) {
|
||||
startPage();
|
||||
List<BusinessVo> list = enterpriseInfoService.selectList(businessVo);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出企业管理列表
|
||||
*/
|
||||
@RequiresPermissions("system:info:export")
|
||||
@Log(title = "企业管理", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, SysDept sysDept) {
|
||||
List<SysDept> list = iSysDeptService.selectDeptList(sysDept);
|
||||
list.forEach(System.out::println);
|
||||
ExcelUtil<SysDept> util = new ExcelUtil<SysDept>(SysDept.class);
|
||||
util.exportExcel(response, list, "企业管理数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取企业管理详细信息 为外边提供接口
|
||||
*/
|
||||
@RequiresPermissions("system:info:query")
|
||||
@GetMapping(value = "/{deptId}")
|
||||
public Result getInfo(@PathVariable("deptId") Long deptId) {
|
||||
return success(enterpriseInfoService.selectEnterpriseInfoByEnterpriseId(deptId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改企业管理
|
||||
*/
|
||||
@RequiresPermissions("system:info:edit")
|
||||
@Log(title = "企业管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public Result edit(@RequestBody BusinessVo BusinessVo) {
|
||||
return toAjax(enterpriseInfoService.updateEnterpriseInfo(BusinessVo));
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增企业管理
|
||||
*/
|
||||
@RequiresPermissions("system:info:add")
|
||||
@Log(title = "企业管理", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public Result add(@RequestBody BusinessVo businessVo)
|
||||
{
|
||||
return toAjax(enterpriseInfoService.insertEnterpriseInfo(businessVo));
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除企业管理
|
||||
*/
|
||||
@RequiresPermissions("system:info:remove")
|
||||
@Log(title = "企业管理", businessType = BusinessType.DELETE)
|
||||
@PostMapping("/{deptId}")
|
||||
public Result remove(@PathVariable Long[] deptId) {
|
||||
|
||||
return toAjax(enterpriseInfoService.deleteEnterpriseInfoByDateIds(deptId));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
package com.muyu.system.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.muyu.system.common.domain.EnterpriseInfo;
|
||||
import com.muyu.system.common.domain.SysDept;
|
||||
import com.muyu.system.common.domain.vo.BusinessVo;
|
||||
|
||||
|
||||
/**
|
||||
* 企业管理Mapper接口
|
||||
*
|
||||
* @author huangdaju
|
||||
* @date 2024-03-28
|
||||
*/
|
||||
public interface EnterpriseInfoMapper extends BaseMapper<BusinessVo>{
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,73 @@
|
|||
package com.muyu.system.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.muyu.system.common.domain.EnterpriseInfo;
|
||||
import com.muyu.system.common.domain.SysDept;
|
||||
import com.muyu.system.common.domain.vo.BusinessVo;
|
||||
|
||||
|
||||
/**
|
||||
* 企业管理Service接口
|
||||
*
|
||||
* @author huangdaju
|
||||
* @Date 2024-03-28
|
||||
*/
|
||||
public interface IEnterpriseInfoService extends IService<BusinessVo>
|
||||
{
|
||||
/**
|
||||
* 查询企业管理
|
||||
*
|
||||
* @param enterpriseId 企业管理主键
|
||||
* @return 企业管理
|
||||
*/
|
||||
public BusinessVo selectEnterpriseInfoByEnterpriseId(Long enterpriseId);
|
||||
|
||||
/**
|
||||
* 查询企业管理列表
|
||||
*
|
||||
* @param enterpriseInfo 企业管理
|
||||
* @return 企业管理集合
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* 新增企业管理
|
||||
*
|
||||
* @param businessVo 企业管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertEnterpriseInfo(BusinessVo businessVo);
|
||||
|
||||
/**
|
||||
* 修改企业管理
|
||||
*
|
||||
* @param businessVo 企业管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateEnterpriseInfo(BusinessVo businessVo);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 批量删除企业管理
|
||||
*
|
||||
* @param deptId 需要删除的企业管理主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteEnterpriseInfoByDateIds(Long[] deptId);
|
||||
|
||||
|
||||
/**
|
||||
* 根据传入的业务对象查询相关信息列表。
|
||||
* @param businessVo 业务对象,包含查询条件。
|
||||
* @return 返回业务信息列表。
|
||||
*/
|
||||
List<BusinessVo> selectList(BusinessVo businessVo);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -42,8 +42,7 @@ public class CarServiceImpl extends ServiceImpl<CarMapper,Car> implements CarSer
|
|||
private CarMapper carMapper;
|
||||
@Autowired
|
||||
private RestTemplate restTemplate;
|
||||
@Autowired
|
||||
private StringRedisTemplate redisTemplate;
|
||||
|
||||
/**
|
||||
* 查询车辆信息
|
||||
* @param carVo
|
||||
|
@ -51,10 +50,10 @@ public class CarServiceImpl extends ServiceImpl<CarMapper,Car> implements CarSer
|
|||
@Override
|
||||
public Result<PageResult<Car>> list(CarVo carVo) {
|
||||
|
||||
List<Fence> list1 = carMapper.selectFenceList();
|
||||
for (Fence fence : list1) {
|
||||
redisTemplate.opsForList().rightPush("fenceKey:", JSON.toJSONString(fence));
|
||||
}
|
||||
// List<Fence> list1 = carMapper.selectFenceList();
|
||||
// for (Fence fence : list1) {
|
||||
// redisTemplate.opsForList().rightPush("fenceKey:", JSON.toJSONString(fence));
|
||||
// }
|
||||
|
||||
PageHelper.startPage(carVo.getPageNum(),carVo.getPageSize());
|
||||
LambdaQueryWrapper<Car> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
|
@ -88,9 +87,6 @@ public class CarServiceImpl extends ServiceImpl<CarMapper,Car> implements CarSer
|
|||
}
|
||||
List<Car> list=this.list(lambdaQueryWrapper);
|
||||
|
||||
for (Car car : list) {
|
||||
redisTemplate.opsForSet().add("carKey:", JSON.toJSONString(car));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,132 @@
|
|||
package com.muyu.system.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.muyu.common.core.utils.DateUtils;
|
||||
import com.muyu.common.core.utils.StringUtils;
|
||||
import com.muyu.common.security.utils.SecurityUtils;
|
||||
import com.muyu.system.common.domain.EnterpriseInfo;
|
||||
import com.muyu.system.common.domain.SysDept;
|
||||
|
||||
import com.muyu.system.common.domain.vo.BusinessVo;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.muyu.system.mapper.EnterpriseInfoMapper;
|
||||
|
||||
import com.muyu.system.service.IEnterpriseInfoService;
|
||||
|
||||
/**
|
||||
* 企业管理Service业务层处理
|
||||
*
|
||||
* @author huangdaju
|
||||
* @date 2024-03-28
|
||||
*/
|
||||
@Service
|
||||
public class EnterpriseInfoServiceImpl extends ServiceImpl<EnterpriseInfoMapper, BusinessVo> implements IEnterpriseInfoService {
|
||||
|
||||
/**
|
||||
* 注入EnterpriseInfoMapper,用于操作企业信息的数据访问层。
|
||||
*/
|
||||
@Autowired
|
||||
private EnterpriseInfoMapper enterpriseInfoMapper;
|
||||
|
||||
|
||||
/**
|
||||
* 查询企业管理
|
||||
*
|
||||
* @param deptId 企业管理主键
|
||||
* @return 企业管理
|
||||
*/
|
||||
@Override
|
||||
public BusinessVo selectEnterpriseInfoByEnterpriseId(Long deptId){
|
||||
return enterpriseInfoMapper.selectById(deptId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询企业管理
|
||||
*
|
||||
* @param businessVo 企业管理列表
|
||||
* @return 企业管理列表
|
||||
*/
|
||||
@Override
|
||||
public List<BusinessVo> selectList(BusinessVo businessVo) {
|
||||
/**
|
||||
* 100L为 部门表公司数据
|
||||
*/
|
||||
businessVo.setParentId(100L);
|
||||
LambdaQueryWrapper<BusinessVo> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.like(StringUtils.isNotEmpty(businessVo.getDeptName()),BusinessVo::getDeptName,businessVo.getDeptName());
|
||||
queryWrapper.like(StringUtils.isNotEmpty(businessVo.getLeader()),BusinessVo::getLeader,businessVo.getLeader());
|
||||
queryWrapper.like(StringUtils.isNotEmpty(businessVo.getStatus()),BusinessVo::getStatus,businessVo.getStatus());
|
||||
queryWrapper.eq(StringUtils.isNotNull(businessVo.getParentId()),BusinessVo::getParentId,businessVo.getParentId());
|
||||
queryWrapper.eq(BusinessVo::getDelFlag,"0");
|
||||
return enterpriseInfoMapper.selectList(queryWrapper);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 新增企业管理
|
||||
*
|
||||
* @param businessVo 企业管理
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertEnterpriseInfo(BusinessVo businessVo)
|
||||
{
|
||||
// 添加条件
|
||||
// "logoType": "hdj",
|
||||
// "deptName": "黄大举有限公司",
|
||||
// "leader": "黄大举",
|
||||
// "phone": "15358324552",
|
||||
// "email": "87755"
|
||||
|
||||
//和公司同级别的权限
|
||||
businessVo.setAncestors("0,100");
|
||||
businessVo.setParentId(100L);
|
||||
|
||||
businessVo.setOrderNum(0);
|
||||
businessVo.setDelFlag("0");
|
||||
businessVo.setStatus("0");
|
||||
businessVo.setCreateTime(DateUtils.getNowDate());
|
||||
return enterpriseInfoMapper.insert(businessVo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改企业管理
|
||||
*
|
||||
* @param businessVo 企业管理
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateEnterpriseInfo(BusinessVo businessVo){
|
||||
businessVo.setUpdateTime(DateUtils.getNowDate());
|
||||
return enterpriseInfoMapper.updateById(businessVo);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 批量删除企业管理
|
||||
*
|
||||
* @param deptIds 需要删除的企业管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteEnterpriseInfoByDateIds(Long[] deptIds){
|
||||
|
||||
UpdateWrapper<BusinessVo> updateWrapper = new UpdateWrapper<>();
|
||||
updateWrapper.in("dept_id", deptIds);
|
||||
BusinessVo updateEntity = new BusinessVo();
|
||||
updateEntity.setDelFlag("2");
|
||||
return enterpriseInfoMapper.update(updateEntity, updateWrapper);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
Loading…
Reference in New Issue