Browse Source

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	hzims-service/safeproduct/src/main/resources/db/2.0.1.sql
zhongwei
yang_shj 6 months ago
parent
commit
9504396e74
  1. 3
      hzims-service-api/big-model-api/src/main/java/com/hnac/hzims/bigmodel/interactive/constants/FunctionConstants.java
  2. 9
      hzims-service-api/big-model-api/src/main/java/com/hnac/hzims/bigmodel/interactive/vo/DataVO.java
  3. 1
      hzims-service-api/big-model-api/src/main/java/com/hnac/hzims/bigmodel/interactive/vo/ExtraVO.java
  4. 4
      hzims-service-api/middle-api/src/main/java/com/hnac/hzims/middle/process/constant/TicketProcessConstant.java
  5. 10
      hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/standardTicket/entity/StandardTicketInfoEntity.java
  6. 36
      hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/constants/DataMethodEnum.java
  7. 40
      hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/constants/DateEnum.java
  8. 3
      hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/constants/FuncRouteEnum.java
  9. 34
      hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/controller/AnalyseDataController.java
  10. 16
      hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/IAnalyseDataService.java
  11. 150
      hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/impl/AnalyseDataServiceImpl.java
  12. 42
      hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/impl/ExtraResolveStrategyService.java
  13. 18
      hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/impl/InteractiveServiceImpl.java
  14. 35
      hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/vo/HistoryDataSearchVO.java
  15. 72
      hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/serviceimpl/OfflineOperationTicketProcessServiceImpl.java
  16. 1
      hzims-service/hzims-middle/src/main/resources/db/3.0.0.sql
  17. 2
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/mapper/ProjectContentMapper.xml
  18. 2
      hzims-service/safeproduct/src/main/resources/db/2.0.1.sql
  19. 17
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/controller/OperationTicketController.java
  20. 3
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/OperationTicketService.java
  21. 9
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/OperationTicketServiceImpl.java
  22. 12
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/vo/operation/StandardTicketInfoVo.java
  23. 6
      hzims-service/ticket/src/main/resources/db/2.0.3.sql

3
hzims-service-api/big-model-api/src/main/java/com/hnac/hzims/bigmodel/interactive/constants/FunctionConstants.java

@ -23,7 +23,8 @@ public interface FunctionConstants {
/**选项**/
CHOOSE("4"),
/**确认**/
CONFIRM("5")
CONFIRM("5"),
CHART("6");
;
@Getter
private String type;

9
hzims-service-api/big-model-api/src/main/java/com/hnac/hzims/bigmodel/interactive/vo/DataVO.java

@ -21,12 +21,15 @@ public class DataVO implements Serializable {
@JSONField(name = "time_end")
private String endTime;
/**包括:"其它"、"最大值"、"最小值"、"总和值"、"平均值"**/
private String method;
/**实时数据结果集**/
private RealDataVO real;
private DataItemVO item;
/**包括:"其它"、"最大值"、"最小值"、"总和值"、"平均值"**/
private String method;
@JSONField(name = "data_type")
private String dataType;
}

1
hzims-service-api/big-model-api/src/main/java/com/hnac/hzims/bigmodel/interactive/vo/ExtraVO.java

@ -39,4 +39,5 @@ public class ExtraVO implements Serializable {
@ApiModelProperty("选项")
private List<? extends SelectionVO> selection;
}

4
hzims-service-api/middle-api/src/main/java/com/hnac/hzims/middle/process/constant/TicketProcessConstant.java

@ -74,4 +74,8 @@ public class TicketProcessConstant {
* 风险排查标识
*/
public static final String HAZARD_RISK = "hazard_risk";
/**
* 线下操作票标识
*/
public static final String OFFLINE_OPERATION_TICKET = "OperationTicketOffline";
}

10
hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/standardTicket/entity/StandardTicketInfoEntity.java

@ -162,4 +162,14 @@ public class StandardTicketInfoEntity extends TenantEntity implements Serializab
@TableField(exist = false)
@ApiModelProperty("监护人确认结果:approved-确认,rejected-作废")
private String verifyResult;
@ApiModelProperty("是否线下 : 1-线下,0-线上")
@QueryField(condition = SqlCondition.EQUAL)
private Boolean isOffline;
@ApiModelProperty("是否审核通过,0为通过,1为未通过")
private Boolean isApproved;
@ApiModelProperty("图片附件")
private String picture;
}

36
hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/constants/DataMethodEnum.java

@ -0,0 +1,36 @@
package com.hnac.hzims.bigmodel.interactive.constants;
import lombok.AllArgsConstructor;
import lombok.Getter;
import java.util.Arrays;
/**
* @Author: huangxing
* @Date: 2024/05/29 08:31
*/
@AllArgsConstructor
public enum DataMethodEnum {
USUAL("详情",6,"详情"),
EARLIEST("最早值",0,"最早值"),
MAX("最大值",1,"最大值"),
MIN("最小值",2,"最小值"),
AVERAGE("平均值",3,"平均值"),
SUM("累计值/和值",4,"总和值"),
DIFFERENCE("变化值/差值",5,"变化值"),
LATEST("最新值",6,"最新值"),
;
@Getter
private String name;
@Getter
private Integer accessRule;
@Getter
private String method;
public static DataMethodEnum getEnumByMethod(String method) {
return Arrays.stream(DataMethodEnum.class.getEnumConstants())
.filter(e -> e.getMethod().equals(method))
.findFirst().orElse(null);
}
}

40
hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/constants/DateEnum.java

@ -0,0 +1,40 @@
package com.hnac.hzims.bigmodel.interactive.constants;
import lombok.AllArgsConstructor;
import lombok.Getter;
import java.util.Arrays;
/**
* @Author: huangxing
* @Date: 2024/05/28 11:37
*/
@AllArgsConstructor
public enum DateEnum {
YEAR("year","每年","按年",5,6),
MONTH("month","每月","按月",4,5),
DAY("day","每天","按天",3,3),
HOUR("hour","每小时","按小时",2,2),
MINUTE("minute","每分钟","按分钟",1,1),
SECOND("second","每秒","按秒",0,0),
;
@Getter
private String code;
@Getter
private String name;
@Getter
private String dateType;
@Getter
private int order;
@Getter
private Integer saveTimeType;
public static DateEnum getDateEnumByType(String dateType) {
return Arrays.stream(DateEnum.class.getEnumConstants()).filter(d -> d.getDateType().equals(dateType)).findFirst().orElse(null);
}
public static DateEnum getDateEnumByOrder(int order) {
return Arrays.stream(DateEnum.class.getEnumConstants()).filter(d -> d.getOrder() == order).findFirst().orElse(null);
}
}

3
hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/constants/FuncRouteEnum.java

@ -21,7 +21,8 @@ public enum FuncRouteEnum {
CHOOSE_FAULT("choose_fault","选择故障",null),
CONFIRM_YK("confirm_yk","遥控确认", FunctionConstants.TypeEnum.PARAMS),
SHOW_PARAM("show_param","设备参数查询", FunctionConstants.TypeEnum.PARAMS),
CHOOSE_YC("choose_yc","选择遥测数据",FunctionConstants.TypeEnum.CHOOSE)
CHOOSE_YC("choose_yc","选择遥测数据",FunctionConstants.TypeEnum.CHOOSE),
HISTORY_DATA("history_data","查询历史数据",FunctionConstants.TypeEnum.CHART),
;
@Getter
private String funcCode;

34
hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/controller/AnalyseDataController.java

@ -0,0 +1,34 @@
package com.hnac.hzims.bigmodel.interactive.controller;
import com.alibaba.fastjson.JSONObject;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.hnac.hzims.bigmodel.interactive.service.IAnalyseDataService;
import com.hnac.hzims.bigmodel.interactive.vo.HistoryDataSearchVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springblade.core.tool.api.R;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* @Author: huangxing
* @Date: 2024/05/29 09:22
*/
@RequestMapping("/analyse/data")
@AllArgsConstructor
@Api(value = "数据查询管理",tags = "数据查询管理")
@RestController
public class AnalyseDataController {
private final IAnalyseDataService analyseDataService;
@GetMapping("/getHistoryData")
@ApiOperation("获取历史数据")
@ApiOperationSupport(order = 1)
public R getHistoryData(@Validated HistoryDataSearchVO searchVO) {
return R.data(analyseDataService.getHistoryData(searchVO));
}
}

16
hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/IAnalyseDataService.java

@ -0,0 +1,16 @@
package com.hnac.hzims.bigmodel.interactive.service;
import com.alibaba.fastjson.JSONObject;
import com.hnac.hzims.bigmodel.interactive.vo.AnswerVO;
import com.hnac.hzims.bigmodel.interactive.vo.ExtraVO;
import com.hnac.hzims.bigmodel.interactive.vo.HistoryDataSearchVO;
/**
* @Author: huangxing
* @Date: 2024/05/28 11:29
*/
public interface IAnalyseDataService {
ExtraVO getHistoryData(HistoryDataSearchVO searchVO);
}

150
hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/impl/AnalyseDataServiceImpl.java

@ -0,0 +1,150 @@
package com.hnac.hzims.bigmodel.interactive.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.google.common.collect.Lists;
import com.hnac.hzims.bigmodel.interactive.constants.DataMethodEnum;
import com.hnac.hzims.bigmodel.interactive.constants.DateEnum;
import com.hnac.hzims.bigmodel.interactive.constants.FuncRouteEnum;
import com.hnac.hzims.bigmodel.interactive.constants.FunctionConstants;
import com.hnac.hzims.bigmodel.interactive.service.IAnalyseDataService;
import com.hnac.hzims.bigmodel.interactive.vo.AnswerVO;
import com.hnac.hzims.bigmodel.interactive.vo.ExtraVO;
import com.hnac.hzims.bigmodel.interactive.vo.HistoryDataSearchVO;
import com.hnac.hzinfo.sdk.core.response.Result;
import com.hnac.hzinfo.sdk.v5.device.DeviceDataClient;
import com.hnac.hzinfo.sdk.v5.device.dto.ReductionAttrDataDTO;
import com.hnac.hzinfo.sdk.v5.device.dto.ReductionDataDTO;
import com.hnac.hzinfo.sdk.v5.device.vo.ReductionDataVO;
import lombok.AllArgsConstructor;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.log.logger.BladeLogger;
import org.springblade.core.tool.utils.DateUtil;
import org.springblade.core.tool.utils.Func;
import org.springblade.core.tool.utils.StringUtil;
import org.springframework.stereotype.Service;
import org.springframework.util.Assert;
import java.time.Duration;
import java.time.LocalDateTime;
import java.time.Period;
import java.time.temporal.ChronoUnit;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* @Author: huangxing
* @Date: 2024/05/28 11:29
*/
@Service
@AllArgsConstructor
public class AnalyseDataServiceImpl implements IAnalyseDataService {
private final DeviceDataClient deviceDataClient;
private final BladeLogger logger;
public static final int DATA_COUNT_MAX = 8000;
@Override
public ExtraVO getHistoryData(HistoryDataSearchVO searchVO) {
if(Func.isEmpty(searchVO.getDataType()) || StringUtil.isBlank(searchVO.getDataType())
|| DataMethodEnum.USUAL.getMethod().equals(searchVO.getMethod())) {
searchVO.setDataType(DateEnum.SECOND.getDateType());
}
// 聚合数据方式处理
DateEnum dateEnum = DateEnum.getDateEnumByType(searchVO.getDataType());
searchVO.setDataType(dateEnum.getDateType());
// 获取最适配时间段
DateEnum adapterDate = this.getDateEnumByDuration(searchVO.getStartTime(), searchVO.getEndTime(), dateEnum);
String note = adapterDate.getDateType().equals(searchVO.getDataType()) ? "" : "(由于数据量过大,只能帮您" + adapterDate.getDateType() + "查询)";
searchVO.setDataType(adapterDate.getDateType());
ExtraVO extraVO = new ExtraVO();
extraVO.setType(FuncRouteEnum.HISTORY_DATA.getType().getType());
extraVO.setFuncCode(FuncRouteEnum.HISTORY_DATA.getFuncCode());
Map<String,Object> params = new HashMap<>(1);
ReductionDataVO dataVO = this.getPolymerizationData(searchVO);
List<Map> datalist = dataVO.getDataList().stream().map(m -> {
m.put("val", m.get(searchVO.getSignage()));
m.remove(searchVO.getSignage());
return m;
}).collect(Collectors.toList());
DataMethodEnum enumByMethod = DataMethodEnum.getEnumByMethod(searchVO.getMethod());
String label = searchVO.getStationName() + "_"
+ searchVO.getDeviceName() + "_"
+ dataVO.getFieldMap().get(searchVO.getSignage()) + "_"
+ adapterDate.getName()
+ enumByMethod.getMethod()
+ note
+ ":";
extraVO.setLabel(label);
params.put("data",datalist);
params.put("deviceName",searchVO.getDeviceName());
params.put("attrName",dataVO.getFieldMap().get(searchVO.getSignage()));
params.put("stationName",searchVO.getStationName());
extraVO.setParams(params);
return extraVO;
}
private ReductionDataVO getPolymerizationData(HistoryDataSearchVO searchVO) {
DataMethodEnum enumByMethod = DataMethodEnum.getEnumByMethod(searchVO.getMethod());
Assert.isTrue(Func.isNotEmpty(enumByMethod),() -> {
throw new ServiceException("数据查询聚合方式传参有误,查询失败!");
});
// 聚合数据方式处理
DateEnum dateEnum = DateEnum.getDateEnumByType(searchVO.getDataType());
ReductionDataDTO dataDTO = new ReductionDataDTO();
ReductionAttrDataDTO reductionAttrData = new ReductionAttrDataDTO();
reductionAttrData.setSignage(searchVO.getSignage());
reductionAttrData.setAccessRules(enumByMethod.getAccessRule());
reductionAttrData.setKeepFigures(2);
dataDTO.setBeginTime(LocalDateTime.parse(searchVO.getStartTime(),DateUtil.DATETIME_FORMATTER));
dataDTO.setEndTime(LocalDateTime.parse(searchVO.getEndTime(),DateUtil.DATETIME_FORMATTER));
dataDTO.setDeviceCode(searchVO.getDeviceCode());
dataDTO.setNeedPage(false);
dataDTO.setSaveTimeType(dateEnum.getSaveTimeType());
dataDTO.setTimeInterval(1);
dataDTO.setDtos(Lists.newArrayList(reductionAttrData));
logger.info("interactive:getPolymerizationData","config传参为:" + JSON.toJSONString(dataDTO));
Result<ReductionDataVO> dataVO = deviceDataClient.pageDeviceCodeAndSignages(dataDTO);
Assert.isTrue(dataVO.isSuccess(),() -> {
throw new ServiceException("聚合历史数据查询失败!");
});
return dataVO.getData();
}
private DateEnum getDateEnumByDuration(String startTime,String endTime,DateEnum dateEnum) {
LocalDateTime start = LocalDateTime.parse(startTime, DateUtil.DATETIME_FORMATTER);
LocalDateTime end = LocalDateTime.parse(endTime, DateUtil.DATETIME_FORMATTER);
Duration duration = Duration.between(start, end);
int count;
switch(dateEnum) {
case YEAR:
count = Long.valueOf(ChronoUnit.YEARS.between(start.toLocalDate(), end.toLocalDate())).intValue();
break;
case MONTH:
count = Long.valueOf(ChronoUnit.MONTHS.between(start.toLocalDate(), end.toLocalDate())).intValue();
break;
case DAY:
count = Long.valueOf(ChronoUnit.DAYS.between(start.toLocalDate(), end.toLocalDate())).intValue();
break;
case HOUR:
count = Long.valueOf(duration.toHours()).intValue();
break;
case MINUTE:
count = Long.valueOf(duration.toMinutes()).intValue();
break;
case SECOND:
count = Long.valueOf(duration.getSeconds()).intValue();
break;
default:
throw new ServiceException("未找到相关时间类型,查询失败!");
}
if(count <= DATA_COUNT_MAX) {
return dateEnum;
}
else {
return getDateEnumByDuration(startTime, endTime, DateEnum.getDateEnumByOrder(dateEnum.getOrder() + 1));
}
}
}

42
hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/impl/ExtraResolveStrategyService.java

@ -5,6 +5,8 @@ import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.hnac.hzims.bigmodel.interactive.constants.FuncRouteEnum;
import com.hnac.hzims.bigmodel.interactive.constants.FunctionConstants;
import com.hnac.hzims.bigmodel.interactive.constants.SearchTypeEnum;
import com.hnac.hzims.bigmodel.interactive.service.IAnalyseDataService;
import com.hnac.hzims.bigmodel.interactive.vo.*;
import com.hnac.hzims.bigmodel.websocket.constants.RedisKeyConstants;
import com.hnac.hzims.operational.station.entity.StationEntity;
@ -44,8 +46,7 @@ public class ExtraResolveStrategyService {
private final IStationVideoTypeClient videoTypeClient;
private final JumpRouteJoinStrategy jumpRouteJoinStrategy;
private final DeviceClient deviceClient;
private final BladeLogger logger;
private final RedisTemplate redisTemplate;
private final IAnalyseDataService analyseDataService;
/**
* 解析DFP返回extra
@ -101,10 +102,6 @@ public class ExtraResolveStrategyService {
}
private ExtraVO resolveShowParam(Map<String,Object> extra) {
ExtraVO result = new ExtraVO();
result.setFuncCode(FuncRouteEnum.SHOW_PARAM.getFuncCode());
result.setType(FuncRouteEnum.SHOW_PARAM.getType().getType());
Map<String,Object> param = new HashMap(1);
DataVO data = JSONObject.parseObject(JSON.toJSONString(extra.get("data")),DataVO.class);
if(Func.isNotEmpty(data)) {
if(Func.isNotEmpty(data.getReal())) {
@ -114,21 +111,26 @@ public class ExtraResolveStrategyService {
real.setTime(DateUtil.format(date,DateUtil.PATTERN_DATETIME));
}
}
// if(Func.isNotEmpty(data.getItem())) {
// if("历史".equals(data.getType())) {
// // 历史数据需要手动查询功能ID供前端使用
// DataItemVO item = data.getItem();
// R<List<DeviceInstanceAttrVO>> attrR = deviceClient.getOnlineAttr(item.getDeviceId());
// if(attrR.isSuccess() && CollectionUtil.isNotEmpty(attrR.getData())) {
// List<DeviceInstanceAttrVO> attrList = attrR.getData();
// Optional<String> facDeviceIdOptional = attrList.stream().parallel().filter(f -> item.getSignage().equals(f.getSignage()))
// .map(DeviceInstanceAttrVO::getFacDeviceAttrId).findFirst();
// logger.info("hzims-big-model:resolveShowParam:facDeviceId",facDeviceIdOptional.orElse(""));
// item.setAttrId(facDeviceIdOptional.orElse(null));
// }
// }
// }
if(Func.isNotEmpty(data.getItem()) && StringUtil.isNotBlank(data.getMethod())) {
if(SearchTypeEnum.HISTORY.getSearchType().equals(data.getType()) && Func.isNotEmpty(data.getItem())) {
DataItemVO item = data.getItem();
HistoryDataSearchVO searchVO = new HistoryDataSearchVO();
searchVO.setDataType(data.getDataType());
searchVO.setDeviceCode(item.getDeviceId());
searchVO.setDeviceName(item.getDeviceName());
searchVO.setStationName(item.getProjectName());
searchVO.setMethod(data.getMethod());
searchVO.setSignage(item.getSignage());
searchVO.setStartTime(data.getStartTime());
searchVO.setEndTime(data.getEndTime());
return analyseDataService.getHistoryData(searchVO);
}
}
}
ExtraVO result = new ExtraVO();
result.setFuncCode(FuncRouteEnum.SHOW_PARAM.getFuncCode());
result.setType(FuncRouteEnum.SHOW_PARAM.getType().getType());
Map<String,Object> param = new HashMap(1);
param.put("data", data);
result.setParams(param);
return result;

18
hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/impl/InteractiveServiceImpl.java

@ -50,6 +50,7 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
import org.springframework.util.Assert;
import org.springframework.util.StringUtils;
import javax.servlet.http.HttpServletResponse;
import java.time.LocalDateTime;
@ -229,12 +230,14 @@ public class InteractiveServiceImpl implements IInteractiveService {
params.put("ids",Func.toStrList(",",sessionIds).toArray());
HttpResponse response = HttpRequest.post(fdpHost + bigModelInvokeUrl.getAssistantStatus())
.body(JSON.toJSONString(params)).execute();
logger.info("interactive:getAnswerBySessionIds","获取答案:" + response.body());
Assert.isTrue(response.getStatus() == HttpServletResponse.SC_OK, () -> {
throw new ServiceException("远程调用大模型【获取问题答案】接口失败!");
});
XxlJobLogger.log("接收到答案:"+JSON.toJSONString(response.body()));
List<AnswerVO> result = JSONArray.parseArray(response.body(), AnswerVO.class);
if(CollectionUtil.isNotEmpty(result)) {
logger.info("interactive:getAnswerBySessionIds","获取答案:" + response.body());
}
result.stream().filter(answerVO -> answerVO.getRunning() == 0).forEach(answerVO -> {
Object[] extras = answerVO.getExtras();
if(ObjectUtil.isEmpty(answerVO.getExtras()) || extras.length == 0){
@ -275,18 +278,7 @@ public class InteractiveServiceImpl implements IInteractiveService {
throw new ServiceException("远程调用大模型【删除对话】接口失败!");
}
// 移除对应reids中问题标记
Object json = redisTemplate.opsForValue().get(HZIMS_BIGMODEL_ASK_KEY);
if(ObjectUtil.isEmpty(json)) {
return true;
}
List<String> sessionIds = JSONObject.parseArray(json.toString(),String.class);
if(CollectionUtil.isEmpty(sessionIds)){
return true;
}
if(sessionIds.contains(sessionId)){
sessionIds.remove(sessionId);
redisTemplate.opsForValue().set(HZIMS_BIGMODEL_ASK_KEY,JSONObject.toJSONString(sessionIds));
}
redisTemplate.opsForList().remove(HZIMS_BIGMODEL_ASK_KEY,1,sessionId);
return true;
}

35
hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/vo/HistoryDataSearchVO.java

@ -0,0 +1,35 @@
package com.hnac.hzims.bigmodel.interactive.vo;
import lombok.Data;
import javax.validation.constraints.NotBlank;
/**
* @Author: huangxing
* @Date: 2024/05/28 11:48
*/
@Data
public class HistoryDataSearchVO {
@NotBlank
private String startTime;
@NotBlank
private String endTime;
@NotBlank
private String deviceCode;
@NotBlank
private String signage;
@NotBlank
private String method;
private String dataType;
private String stationName;
private String deviceName;
}

72
hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/serviceimpl/OfflineOperationTicketProcessServiceImpl.java

@ -0,0 +1,72 @@
package com.hnac.hzims.middle.processflow.strategy.serviceimpl;
import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse;
import com.hnac.hzims.middle.processflow.service.ProcessDictService;
import com.hnac.hzims.middle.processflow.strategy.abstracts.ProcessAbstractService;
import com.hnac.hzims.middle.processflow.strategy.entity.WorkflowQueue;
import com.hnac.hzims.ticket.ticketprocess.feign.OperationTicketFeignClient;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.log.exception.ServiceException;
import org.springframework.stereotype.Service;
import static com.hnac.hzims.middle.process.constant.TicketProcessConstant.OFFLINE_OPERATION_TICKET;
/**
* 操作票流程实现类
*
* @Author dfy
* @Version v1.0
* @Serial 1.0
* @Date 2023/3/28 8:47
*/
@Slf4j
@Service
@RequiredArgsConstructor
public class OfflineOperationTicketProcessServiceImpl extends ProcessAbstractService {
private final OperationTicketFeignClient operationTicketFeignClient;
private final ProcessDictService processDictService;
/**
* 设置执行那种实现类
*
* @param flowQueue
* @return
*/
@Override
public Boolean isWorkflowProcess(WorkflowQueue flowQueue) {
log.info("是否执行操作票流程环节操作~~~~,流程flowQueue: {}", flowQueue);
String dictValue = processDictService.selectDictValueByKey(OFFLINE_OPERATION_TICKET);
if (dictValue.equals(flowQueue.getProcessDefinitionKey())) {
log.info("已执行操作票流程环节操作~~~~");
return true;
}
log.error("未执行操作票流程环节操作,请联系管理员~~~~");
return false;
}
/**
* 两票管理业务方法
*
* @param response
*/
@Override
public void calculate(ProcessWorkFlowResponse response) {
log.info("操作票流程消费调用fein接口开始---param",response);
Boolean pending = operationTicketFeignClient.findPending(response);
if (!pending) {
log.info("操作票流程调用fein接口异常---param",response);
throw new ServiceException("操作票流程出现异常呢");
}
log.info("操作票流程消费调用fein接口结束---param",response);
}
}

1
hzims-service/hzims-middle/src/main/resources/db/3.0.0.sql

@ -0,0 +1 @@
INSERT INTO `process_dict`(`dict_code`, `dict_sort`, `dict_key`, `dict_value`, `dict_label`, `dict_type`, `is_default`, `status`, `create_dept`, `create_time`, `update_time`, `remark`) VALUES (15, 15, 'OperationTicketOffline', 'OperationTicketOffline', '线下操作票', '线下操作票', 'Y', 0, NULL, '2023-07-25 18:35:01', '2024-05-24 11:22:14', '线下操作票流程');

2
hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/mapper/ProjectContentMapper.xml

@ -3,7 +3,7 @@
<mapper namespace="com.hnac.hzinfo.inspect.obj.mapper.ProjectContentMapper">
<select id="getListByProjectId" resultType="com.hnac.hzinfo.inspect.obj.entity.ProjectContentEntity">
SELECT t.*,c.code, c.name, c.description, c.check_type,c.CHECK_TYPE_SON,c.CAMERA_ADDR,c.OTHER_PARAM, c.record_type, c.CLOCK_ID, c.CAMERA_ID, c.DICT_TYPE
SELECT t.*,c.code, c.name, c.description, c.check_type,c.CHECK_TYPE_SON,c.CAMERA_ADDR,c.OTHER_PARAM, c.record_type, c.CLOCK_ID, c.CAMERA_ID, c.DICT_TYPE,c.CHECK_VAL
from hz_st_re_project_content t
left JOIN hz_st_re_content c on (t.content_id=c.id)
where t.project_id=#{projectId} AND t.is_deleted=0 ORDER BY t.SORT DESC

2
hzims-service/safeproduct/src/main/resources/db/2.0.1.sql

@ -31,7 +31,7 @@ CREATE TABLE IF NOT EXISTS `hzims_hygiene_template_detail` (
`id` bigint(20) NOT NULL COMMENT '主键ID',
`template_id` bigint(20) NOT NULL COMMENT '模板id',
`zone` varchar(50) NOT NULL COMMENT '责任区',
`principal` varchar(20) NOT NULL COMMENT '责任人',
`prinicipal` varchar(20) NOT NULL COMMENT '责任人',
`check_item` mediumtext NOT NULL COMMENT '检查项',
`check_item_score` varchar(255) NOT NULL COMMENT '检查项分值',
`create_user` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建人',

17
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/controller/OperationTicketController.java

@ -17,6 +17,9 @@ import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import static com.hnac.hzims.middle.process.constant.TicketProcessConstant.OFFLINE_OPERATION_TICKET;
import static com.hnac.hzims.middle.process.constant.TicketProcessConstant.OPERATION_TICKET_KEY;
/**
* 操作票
* @Author WL
@ -45,7 +48,19 @@ public class OperationTicketController {
@ApiOperation("启动流程")
@PostMapping("/startUp")
public R start(@RequestBody StandardTicketInfoVo StandardTicketInfoVo) {
operationTicketService.startUp(StandardTicketInfoVo);
operationTicketService.startUp(StandardTicketInfoVo,OPERATION_TICKET_KEY);
return R.success("申请开票成功");
}
/**
* 启动流程
*
* @return
*/
@ApiOperation("启动线下流程")
@PostMapping("/startOffineOperation")
public R startOffineOperation(@RequestBody StandardTicketInfoVo StandardTicketInfoVo) {
operationTicketService.startUp(StandardTicketInfoVo,OFFLINE_OPERATION_TICKET);
return R.success("申请开票成功");
}

3
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/OperationTicketService.java

@ -19,7 +19,7 @@ public interface OperationTicketService {
* 启动流程
* @param standardTicketInfoVo
*/
void startUp(StandardTicketInfoVo standardTicketInfoVo);
void startUp(StandardTicketInfoVo standardTicketInfoVo,String dictValueKey);
/**
@ -39,5 +39,4 @@ public interface OperationTicketService {
}

9
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/OperationTicketServiceImpl.java

@ -100,7 +100,7 @@ public class OperationTicketServiceImpl implements OperationTicketService {
* @param standardTicketInfoVo
*/
@Override
public void startUp(StandardTicketInfoVo standardTicketInfoVo) {
public void startUp(StandardTicketInfoVo standardTicketInfoVo,String dictValueKey) {
log.info("执行 com.hnac.hzims.ticket.standardTicket.service.impl【startUp】 。。。方法");
if (standardTicketInfoVo.getSignage() == null) {
throw new ServiceException("票据抬头未配置,请您到站点管理配置");
@ -134,6 +134,7 @@ public class OperationTicketServiceImpl implements OperationTicketService {
String code = processDictFeignService.getTicketByCode(standardTicketInfoVo.getSignage(), this.getTicketWichCode(standardTicketInfoVo.getTicketType()));
log.info("获取编码: {}", code);
if (StringUtils.isBlank(code)) {
log.error("获取操作票编码异常:"+code);
throw new ServiceException("服务器异常,请联系管理员");
}
standardTicketInfoVo.setCode(code);
@ -143,9 +144,10 @@ public class OperationTicketServiceImpl implements OperationTicketService {
List<StandardTicketMeasureVo> standardTicketInfoVos = this.saveStandardTicketMeasure(this.saveStandardTicketMeasureWichTicket(standardTicketInfoVo));
standardTicketInfoVo.setStandardTicketMeasureVos(standardTicketInfoVos);
//6. 查询第操作票值
String dictValue = processDictFeignService.selectDictValueByKey(OPERATION_TICKET_KEY);
String dictValue = processDictFeignService.selectDictValueByKey(dictValueKey);
log.info("查询第操作票值: {}", dictValue);
if (StringUtils.isBlank(dictValue)) {
log.error("查询不到操作票值");
throw new ServiceException("服务器异常,请联系管理员");
}
// 7.启动流程
@ -337,7 +339,9 @@ public class OperationTicketServiceImpl implements OperationTicketService {
Map<String, Object> params = new HashMap<>(4);
params.put("standardTicketInfoVo", standardTicketInfoVo);
params.put("taskId", standardTicketInfoVo.getId());
if(ObjectUtil.isNotEmpty(standardTicketInfoVo.getGuardian())){
params.put("guardianUserIds", "taskUser_".concat(standardTicketInfoVo.getGuardian().toString()));
}
//已开启流程
R<BladeFlow> processInstanceContainNameByKey = flowClient.startProcessInstanceContainNameByKey(dictValue, String.valueOf(standardTicketInfoVo.getId()), standardTicketInfoVo.getTitle(), params);
if (!processInstanceContainNameByKey.isSuccess()) {
@ -434,6 +438,7 @@ public class OperationTicketServiceImpl implements OperationTicketService {
boolean save = standardTicketInfoService.save(standardTicketInfo);
if (!save) {
log.error("saveStandardTicketInfo failed");
throw new ServiceException("Save failed");
}
BeanUtils.copyProperties(standardTicketInfo, standardTicketInfoVo);

12
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/vo/operation/StandardTicketInfoVo.java

@ -5,6 +5,8 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springblade.core.mp.support.QueryField;
import org.springblade.core.mp.support.SqlCondition;
import org.springblade.core.tenant.mp.TenantEntity;
import org.springframework.format.annotation.DateTimeFormat;
@ -152,4 +154,14 @@ public class StandardTicketInfoVo extends TenantEntity {
@ApiModelProperty("安全措施")
private List<StandardTicketMeasureVo> standardTicketMeasureVos;
@ApiModelProperty("是否线下 : 1-线下,0-线上")
@QueryField(condition = SqlCondition.EQUAL)
private Boolean isOffline;
@ApiModelProperty("是否审核通过 : 1-通过,0-未通过")
private Boolean isApproved;
@ApiModelProperty("图片附件")
private String picture;
}

6
hzims-service/ticket/src/main/resources/db/2.0.3.sql

@ -0,0 +1,6 @@
alter table `hzims_standard_ticket_info` add column `is_offline` tinyint(2) default 0 comment '是否线下 : 1-线下,0-线上';
alter table `hzims_standard_ticket_info` add column `is_approved` tinyint(2) default NULL comment '是否审核通过 : 1-通过,0-未通过';
alter table `hzims_standard_ticket_info` ADD COLUMN `picture` varchar(600) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '图片附件' ;
ALTER TABLE `hzims_standard_ticket_info`
MODIFY COLUMN `issue_order_person` bigint(20) NULL COMMENT '发令人' AFTER `code`,
MODIFY COLUMN `access_order_person` bigint(20) NULL COMMENT '受令人' AFTER `issue_order_person`;
Loading…
Cancel
Save