Commit 993ebd17 by HlQ

[feat]

1.运维监测添加时区偏移功能
2.提供单独的工单列表接口给客流平台使用,并且客流平台提交的工单添加客流平台用户的 uuid
3.合同列表接口合同进度查询条件支持多选
1 parent 296af2a0
......@@ -28,6 +28,7 @@ public class MyBatisPlusConfig implements MetaObjectHandler {
// 获取当前登录用户,并填充
var vo = (UserVO) StpUtil.getTokenSession().get("curLoginUser");
this.fillHasGetter(metaObject, "creator", vo.getUserid());
this.fillHasGetter(metaObject, "createBy", vo.getUserid());
} catch (Exception ignored) {
}
}
......@@ -39,6 +40,7 @@ public class MyBatisPlusConfig implements MetaObjectHandler {
try {
var vo = (UserVO) StpUtil.getTokenSession().get("curLoginUser");
this.fillHasGetter(metaObject, "updater", vo.getUserid());
this.fillHasGetter(metaObject, "updateBy", vo.getUserid());
} catch (Exception ignored) {
}
}
......
......@@ -11,6 +11,7 @@ import vion.model.TaskTemp;
import vion.service.ITaskTempService;
import vion.vo.TaskTempVO;
import java.util.List;
import java.util.Map;
/**
......@@ -56,4 +57,16 @@ public class TaskTempController {
public Map<String, Long> getInfoByPhone(String phone) {
return taskTempService.getInfoByPhone(phone);
}
/**
* 客流平台单独使用接口
* 工单列表
*
* @param uuid 客流平台用户的uuid
* @return java.util.List<vion.vo.TaskTempVO>
*/
@GetMapping("/taskTemp/{uuid}")
public List<TaskTempVO> getTaskTempByUuid(@PathVariable String uuid) {
return taskTempService.getTaskTempByUuid(uuid);
}
}
\ No newline at end of file
......@@ -72,7 +72,9 @@ public class EventController {
@PostMapping("/bind/{agentUid}/{mallUid}")
@SaCheckPermission(value = "event:bind", orRole = "admin")
public String bind(@PathVariable String agentUid, @PathVariable String mallUid, String timeZone,
public String bind(@PathVariable String agentUid,
@PathVariable String mallUid,
@RequestParam String timeZone,
@RequestBody List<RAgentEvent> dtoList) {
return agentEventService.bind(agentUid, mallUid, timeZone, dtoList);
}
......
......@@ -36,6 +36,8 @@ public class ContractDTO extends BaseDTO {
*/
private Integer status;
private List<Integer> statusArr;
/**
* 销售人员名称
*/
......
......@@ -35,16 +35,13 @@ public class MqttClientMessageListener {
@MqttClientSubscribe(value = "${mqtt.client.server-topic:/MS/receive}", qos = MqttQoS.QOS2)
public void onMessage(String topic, byte[] payload) {
log.info("topic:[{}] 收到消息", topic);
try {
JsonNode jsonObj = JsonUtil.parseTree(payload);
String agentUid = jsonObj.path("agentUid").asText();
String type = jsonObj.path("eventType").asText();
log.info("收到[{}]消息,类型:[{}]", agentUid, type);
switch (MqttMessageType.getEnumByType(type)) {
case REGISTER -> {
String agentUid = jsonObj.path("agentUid").asText();
updateTaskByAgent(agentUid);
}
case REGISTER -> updateTaskByAgent(agentUid);
// region mall + store 共有指标
case PASSENGER_FLOW_INTERRUPT -> handlePassengerFlowInterrupt(jsonObj.toString());
case DEVICE_OFFLINE -> handleDeviceOffline(jsonObj.toString());
......@@ -270,7 +267,7 @@ public class MqttClientMessageListener {
/**
* agent 发送过来的记录入库
*
* @param payloadStr 事件记录
* @param payloadStr 事件记录
*/
private void saveRecInDB(String payloadStr) {
SendData sendData = JsonUtil.parseObject(payloadStr, SendData.class);
......
......@@ -3,6 +3,7 @@ package vion.interceptor;
import cn.dev33.satoken.interceptor.SaInterceptor;
import cn.dev33.satoken.stp.StpUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
......@@ -11,11 +12,14 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@Slf4j
public class InterceptorConfig implements WebMvcConfigurer {
@Value("${sa-token.timeout}")
private Long timeout;
@Override
public void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor(new SaInterceptor(handle -> {
StpUtil.checkLogin();
StpUtil.renewTimeout(3600L);
StpUtil.renewTimeout(timeout);
}))
.addPathPatterns("/api/**")
.excludePathPatterns("/api/dictionarys")
......@@ -29,6 +33,7 @@ public class InterceptorConfig implements WebMvcConfigurer {
.excludePathPatterns("/api/point/getBindQRCode", "/api/point/getBindOpenid")
.excludePathPatterns("/api/point/upd/{uuid}", "/api/point/get/{uuid}", "/api/point/install/submit/{uuid}", "/api/point/client/reject", "/api/point/reject/uuid/{uuid}")
.excludePathPatterns("/api/sparePart/frontSubmit", "/api/repairRec/frontSubmit")
.excludePathPatterns("/api/mqtt/**", "/api/monitor/**");
.excludePathPatterns("/api/mqtt/**", "/api/monitor/**")
.excludePathPatterns("/api/taskTemp/{uuid}", "/api/task/urge");
}
}
......@@ -92,5 +92,10 @@ public class TaskTemp {
* 微信用户id
*/
private String openid;
/**
* 客流平台直接提交的用户的uuid
*/
private String userUid;
}
......@@ -96,13 +96,13 @@ public class Event extends BaseDTO {
/**
* 创建人
*/
@TableField(value = "create_by")
@TableField(value = "create_by", fill = FieldFill.INSERT)
private String createBy;
/**
* 修改人
*/
@TableField(value = "update_by")
@TableField(value = "update_by", fill = FieldFill.INSERT_UPDATE)
private String updateBy;
@TableField(value = "create_time", fill = FieldFill.INSERT)
......
......@@ -43,6 +43,12 @@ public class Upgrade extends BaseDTO {
private Short type;
/**
* 包大小
*/
@TableField(value = "size")
private Long size;
/**
* 打包时间,utc时间
*/
@TableField(value = "build_time")
......@@ -71,4 +77,4 @@ public class Upgrade extends BaseDTO {
@TableField(exist = false)
public MultipartFile infile;
}
\ No newline at end of file
}
......@@ -6,6 +6,7 @@ import vion.dto.TaskTempDTO;
import vion.model.TaskTemp;
import vion.vo.TaskTempVO;
import java.util.List;
import java.util.Map;
public interface ITaskTempService extends MPJBaseService<TaskTemp> {
......@@ -18,4 +19,5 @@ public interface ITaskTempService extends MPJBaseService<TaskTemp> {
Map<String, Long> getInfoByPhone(String phone);
List<TaskTempVO> getTaskTempByUuid(String uuid);
}
......@@ -820,6 +820,7 @@ public class ContractServiceImpl extends MPJBaseServiceImpl<ContractMapper, Cont
MPJLambdaWrapper<Contract> wrapper = new MPJLambdaWrapper<>(converter.convert(dto, Contract.class))
.selectAll(Contract.class)
.in(CollUtil.isNotEmpty(finalIdSet), Contract::getId, finalIdSet)
.in(CollUtil.isNotEmpty(dto.getStatusArr()), Contract::getStatus, dto.getStatusArr())
.notIn(CollUtil.isNotEmpty(contractIdList), Contract::getId, contractIdList)
.between(ArrayUtil.isAllNotNull(dto.getSignDateStart(), dto.getSignDateEnd()), Contract::getSignDate, dto.getSignDateStart(), dto.getSignDateEnd());
if (StrUtil.isNotBlank(dto.getOperator()) && ObjUtil.isNotNull(dto.getAmount())) {
......@@ -875,6 +876,7 @@ public class ContractServiceImpl extends MPJBaseServiceImpl<ContractMapper, Cont
MPJLambdaWrapper<Contract> wrapper = new MPJLambdaWrapper<>(converter.convert(dto, Contract.class))
.selectAll(Contract.class)
.in(CollUtil.isNotEmpty(finalIdSet), Contract::getId, finalIdSet)
.in(CollUtil.isNotEmpty(dto.getStatusArr()), Contract::getStatus, dto.getStatusArr())
.notIn(CollUtil.isNotEmpty(contractIdList), Contract::getId, contractIdList)
.between(ArrayUtil.isAllNotNull(dto.getSignDateStart(), dto.getSignDateEnd()), Contract::getSignDate, dto.getSignDateStart(), dto.getSignDateEnd());
if (StrUtil.isNotBlank(dto.getOperator()) && ObjUtil.isNotNull(dto.getAmount())) {
......
......@@ -37,6 +37,7 @@ import java.io.File;
import java.io.IOException;
import java.time.LocalDateTime;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
......@@ -150,6 +151,17 @@ public class TaskTempServiceImpl extends MPJBaseServiceImpl<TaskTempMapper, Task
return Map.of();
}
@Override
public List<TaskTempVO> getTaskTempByUuid(String uuid) {
var wrapper = new MPJLambdaWrapper<TaskTemp>()
.selectAll(TaskTemp.class)
.selectAssociation(Task.class, TaskTempVO::getTask)
.leftJoin(Task.class, Task::getTaskTempId, TaskTemp::getId)
.eq(TaskTemp::getUserUid, uuid)
.orderByDesc(TaskTemp::getRepairTime);
return this.selectJoinList(TaskTempVO.class, wrapper);
}
String buildMsg(String userid, TaskTemp taskTemp) {
var jsonObj = JsonUtil.createObj()
.put("agent_id", 2358374016L)
......
......@@ -34,7 +34,6 @@ public class UpgradeServiceImpl extends ServiceImpl<UpgradeMapper, Upgrade> impl
Assert.notNull(infile, "升级包不能为空");
var type = FileTypeUtil.getType(infile.getInputStream());
Assert.notEquals(type, "jar", "上传的升级包类型不是jar");
// todo 测试文件保存
String path = fileUrl + FileUtil.FILE_SEPARATOR
+ "agent" + FileUtil.FILE_SEPARATOR
+ upgrade.getVersion() + FileUtil.FILE_SEPARATOR
......@@ -44,18 +43,20 @@ public class UpgradeServiceImpl extends ServiceImpl<UpgradeMapper, Upgrade> impl
upgrade.setSha256(SecureUtil.sha256(file));
upgrade.setUrl(path);
upgrade.setSize(infile.getSize());
var manifest = ManifestUtil.getManifest(file);
var version = manifest.getMainAttributes().getValue(Attributes.Name.IMPLEMENTATION_VERSION);
Assert.equals(version, upgrade.getVersion(), "升级包版本号不一致");
upgrade.setVersion(version);
var name = manifest.getMainAttributes().getValue(Attributes.Name.IMPLEMENTATION_TITLE);
Assert.equals(name, upgrade.getName(), "升级包名称不一致");
upgrade.setVersion(version);
// 打包时间为 utc 时间
var buildTime = manifest.getMainAttributes().getValue("Build-Timestamp");
upgrade.setBuildTime(buildTime);
this.save(upgrade);
return "升级包添加成功";
} catch (IOException e) {
......
......@@ -79,7 +79,7 @@ public class TimeZoneUtil {
}
// 处理步进模式 如: */5
if (field.startsWith("*/")) {
if (field.startsWith("*/") || field.startsWith("0/")) {
return field;
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!