Browse Source

Merge remote-tracking branch 'origin/prod-5.1.3' into prod-5.1.3

zhongwei
haungxing 4 months ago
parent
commit
adc5bb4bcc
  1. 8
      hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/standardTicket/entity/StandardTicketInfoEntity.java
  2. 4
      hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/mapper/PlanGenerationMapper.java
  3. 22
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/offline/filter/ContentTypeFilter.java
  4. 53
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/offline/filter/ContentTypeRequestWrapper.java
  5. 59
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/offline/service/impl/InspectOfflineServiceImpl.java
  6. 6
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/config/controller/CentralMonitorController.java
  7. 4
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/config/service/CentralMonitorService.java
  8. 39
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/config/service/impl/CentralMonitorServiceImpl.java
  9. 15
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyRecServiceImpl.java
  10. 6
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/history/service/impl/AlarmServiceImpl.java
  11. 26
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/history/service/impl/PointServiceImpl.java
  12. 2
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/impl/OperMaintenanceLibraryServiceImpl.java
  13. 4
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/OperationTicketServiceImpl.java
  14. 1
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/TicketProcessServiceImpl.java
  15. 7
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/vo/operation/StandardTicketInfoVo.java
  16. 4
      hzims-service/ticket/src/main/resources/db/3.0.0.sql

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

@ -178,4 +178,12 @@ public class StandardTicketInfoEntity extends TenantEntity implements Serializab
@ApiModelProperty("图片附件")
private String picture;
@ApiModelProperty("设备编号")
@QueryField(condition = SqlCondition.EQUAL)
private String emCode ;
@ApiModelProperty("设备名称")
@QueryField(condition = SqlCondition.LIKE)
private String emName;
}

4
hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/mapper/PlanGenerationMapper.java

@ -10,7 +10,7 @@ import java.util.Map;
public interface PlanGenerationMapper extends UserDataScopeBaseMapper<PlanGenerationEntity> {
Float selectPlanGenertionYearCount(String stationId, int year);
Float selectPlanGenertionYearCount(@Param("stationId") String stationId,@Param("year") int year);
List<PlanGenerationEntity> selectListAll(@Param("date") String date);
@ -42,5 +42,5 @@ public interface PlanGenerationMapper extends UserDataScopeBaseMapper<PlanGenera
* @param year
* @return
*/
List<PlanGenerationEntity> getPlanPowerByYear(String code, int year);
List<PlanGenerationEntity> getPlanPowerByYear(@Param("code") String code,@Param("year") int year);
}

22
hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/offline/filter/ContentTypeFilter.java

@ -0,0 +1,22 @@
package com.hnac.hzinfo.inspect.offline.filter;
import javax.servlet.*;
import javax.servlet.annotation.WebFilter;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
/**
* @author ysj
* @version 4.0.0
* @create 2024-07-24-19:07
*/
@WebFilter(filterName = "ContentTypeFilter", urlPatterns = "/offline/syncOfflineDataToOnline")
public class ContentTypeFilter implements Filter {
@Override
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
HttpServletRequest httpRequest = (HttpServletRequest) request;
ContentTypeRequestWrapper wrappedRequest = new ContentTypeRequestWrapper(httpRequest);
chain.doFilter(wrappedRequest, response);
}
}

53
hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/offline/filter/ContentTypeRequestWrapper.java

@ -0,0 +1,53 @@
package com.hnac.hzinfo.inspect.offline.filter;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletRequestWrapper;
import java.util.Collections;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Map;
/**
* @author ysj
* @version 4.0.0
* @create 2024-07-24-19:08
*/
public class ContentTypeRequestWrapper extends HttpServletRequestWrapper {
private final String newContentType;
public ContentTypeRequestWrapper(HttpServletRequest request) {
super(request);
// 你想要设置的新Content-Type
this.newContentType = "form-data";
}
@Override
public String getHeader(String name) {
if ("Content-Type".equalsIgnoreCase(name)) {
return newContentType;
}
return super.getHeader(name);
}
@Override
public Enumeration<String> getHeaders(String name) {
if ("Content-Type".equalsIgnoreCase(name)) {
return Collections.enumeration(Collections.singleton(newContentType));
}
return super.getHeaders(name);
}
@Override
public Enumeration<String> getHeaderNames() {
Map<String, String> headers = new HashMap<>();
HttpServletRequest originalRequest = (HttpServletRequest) getRequest();
Enumeration<String> headerNames = originalRequest.getHeaderNames();
while (headerNames.hasMoreElements()) {
String headerName = headerNames.nextElement();
headers.put(headerName, headerName);
}
headers.put("Content-Type", "Content-Type");
return Collections.enumeration(headers.keySet());
}
}

59
hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/offline/service/impl/InspectOfflineServiceImpl.java

@ -37,6 +37,7 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.MapUtils;
import org.apache.commons.fileupload.FileItem;
import org.apache.commons.fileupload.FileItemFactory;
import org.apache.commons.fileupload.disk.DiskFileItem;
import org.apache.commons.fileupload.disk.DiskFileItemFactory;
import org.apache.commons.io.IOUtils;
import org.springblade.core.log.exception.ServiceException;
@ -53,6 +54,7 @@ import org.springblade.core.tool.utils.StringUtil;
import org.springblade.offline.service.IOfflineDataService;
import org.springblade.resource.feign.IOssClient;
import org.springblade.system.vo.CreateTableVO;
import org.springblade.system.vo.TemplateVO;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Primary;
import org.springframework.jdbc.core.JdbcTemplate;
@ -69,6 +71,7 @@ import java.lang.reflect.Method;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import java.nio.file.Files;
import java.util.*;
import java.util.stream.Collectors;
@ -905,8 +908,7 @@ public class InspectOfflineServiceImpl implements IOfflineDataService {
}
R<BladeFile> r = null;
try {
MultipartFile multipartFile = this.getMultipartFile(file);
r = ossClient.putFile(multipartFile);
r = putFile(file);
if (!r.isSuccess()) {
throw new RuntimeException("上传文件["+fileName+"]失败,bladex-resource报错:" + r);
}
@ -948,8 +950,8 @@ public class InspectOfflineServiceImpl implements IOfflineDataService {
}
R<BladeFile> r = null;
try {
MultipartFile multipartFile = this.getMultipartFile(file);
r = ossClient.putFile(multipartFile);
r = putFile(file);
if (!r.isSuccess()) {
throw new RuntimeException("上传文件["+fileName+"]失败,bladex-resource报错:" + r);
}
@ -963,46 +965,21 @@ public class InspectOfflineServiceImpl implements IOfflineDataService {
});
}
private MultipartFile getMultipartFile(File file) {
FileItem fileItem = this.createFileItem(file);
return new CommonsMultipartFile(fileItem);
}
public R<BladeFile> putFile(File file) throws IOException {
FileItem fileItem = new DiskFileItem("file", Files.probeContentType(file.toPath()),false,file.getName(),(int)file.length(),file.getParentFile());
try (InputStream inputStream = new FileInputStream(file); OutputStream os = fileItem.getOutputStream()){
IOUtils.copy(inputStream,os);
public FileItem createFileItem(File file) {
FileItemFactory factory = new DiskFileItemFactory(16, null);
String textFieldName = "file";
FileItem item = factory.createItem(textFieldName, "text/plain", false,
file.getName());
int bytesRead = 0;
byte[] buffer = new byte[1024];
FileInputStream fis = null;
OutputStream os = null;
try {
fis = new FileInputStream(file);
os = item.getOutputStream();
while ((bytesRead = fis.read(buffer, 0, buffer.length)) != -1) {
os.write(buffer, 0, bytesRead);
}
os.close();
fis.close();
} catch (IOException e) {
/*
把用户上传的zip包中的视频文件照片文件上传到miniio服务器并且返回映射关系的map
*/
MultipartFile multipartFile = new CommonsMultipartFile(fileItem);
R<BladeFile> r = ossClient.putFile(multipartFile);
return r;
}catch (IOException e){
e.printStackTrace();
} finally {
try {
if (null != os) {
os.close();
}
if (null != fis) {
fis.close();
}
} catch (IOException e) {
e.printStackTrace();
}
}
return item;
return R.fail("shangc");
}
}

6
hzims-service/operational/src/main/java/com/hnac/hzims/operational/config/controller/CentralMonitorController.java

@ -53,8 +53,8 @@ public class CentralMonitorController extends BladeController {
public R selectCommunication(@PathVariable Integer page,
@PathVariable Integer size,
String roleId,
Date start,
Date end){
String start,
String end){
IPage<PointDataVo> result = monitorService.selectOriginalDataByRealIds(page, size, roleId,start,end);
return R.data(result);
}
@ -62,7 +62,7 @@ public class CentralMonitorController extends BladeController {
@GetMapping("/communications")
@ApiOperation("查询通讯告警图表数据")
@ApiOperationSupport(order = 4)
public R<List<PointDataVo>> communications(String roleId,Date start,Date end){
public R<List<PointDataVo>> communications(String roleId,String start,String end){
return R.data(monitorService.communications(roleId,start,end));
}
}

4
hzims-service/operational/src/main/java/com/hnac/hzims/operational/config/service/CentralMonitorService.java

@ -29,7 +29,7 @@ public interface CentralMonitorService{
* @param roleId
* @return
*/
IPage<PointDataVo> selectOriginalDataByRealIds(Integer page, Integer size, String roleId, Date start, Date end);
IPage<PointDataVo> selectOriginalDataByRealIds(Integer page, Integer size, String roleId, String start, String end);
List<PointDataVo> communications(String roleId, Date start, Date end);
List<PointDataVo> communications(String roleId, String start, String end);
}

39
hzims-service/operational/src/main/java/com/hnac/hzims/operational/config/service/impl/CentralMonitorServiceImpl.java

@ -22,6 +22,7 @@ import lombok.RequiredArgsConstructor;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.CollectionUtil;
import org.springblade.core.tool.utils.DateUtil;
import org.springblade.core.tool.utils.ObjectUtil;
import org.springblade.core.tool.utils.StringUtil;
import org.springblade.system.entity.Dept;
@ -37,10 +38,7 @@ import java.time.Instant;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.format.DateTimeFormatter;
import java.util.Calendar;
import java.util.Collections;
import java.util.Date;
import java.util.List;
import java.util.*;
import java.util.stream.Collectors;
@ -94,7 +92,7 @@ public class CentralMonitorServiceImpl implements CentralMonitorService {
* @return
*/
@Override
public IPage<PointDataVo> selectOriginalDataByRealIds(Integer page, Integer size, String roleId,Date start,Date end) {
public IPage<PointDataVo> selectOriginalDataByRealIds(Integer page, Integer size, String roleId,String start,String end) {
OriginalDataQuery originalDataQuery = new OriginalDataQuery();
originalDataQuery.setRealId(roleId);
originalDataQuery.setLimit(size);
@ -109,12 +107,13 @@ public class CentralMonitorServiceImpl implements CentralMonitorService {
calendar.add(Calendar.MILLISECOND,-calendar.get(Calendar.MILLISECOND));
originalDataQuery.setBeginTime(calendar.getTime());
}else{
originalDataQuery.setBeginTime(start);
originalDataQuery.setEndTime(end);
originalDataQuery.setBeginTime(DateUtil.parse(start,DateUtil.PATTERN_DATETIME));
originalDataQuery.setEndTime(DateUtil.parse(end,DateUtil.PATTERN_DATETIME));
}
IPage<PointDataVo> iPage = new Page<>(page, size);
Result<HzPage<PointData>> originalDataByRealIds = historyDataSearchClient.getOriginalDataByRealIds(originalDataQuery);
if (!originalDataByRealIds.isSuccess()) {
throw new ServiceException("数据不存在");
if (!originalDataByRealIds.isSuccess() || ObjectUtil.isEmpty(originalDataByRealIds.getData()) || CollectionUtil.isEmpty(originalDataByRealIds.getData().getRecords())) {
return iPage;
}
HzPage<PointData> data = originalDataByRealIds.getData();
List<PointDataVo> collect = data.getRecords().stream().map(item -> {
@ -130,8 +129,6 @@ public class CentralMonitorServiceImpl implements CentralMonitorService {
}
return pointDataVo;
}).collect(Collectors.toList());
IPage<PointDataVo> iPage = new Page<>(data.getCurrent(), data.getSize());
iPage.setRecords(collect);
iPage.setTotal(originalDataByRealIds.getData().getTotal());
return iPage;
@ -145,11 +142,11 @@ public class CentralMonitorServiceImpl implements CentralMonitorService {
* @return
*/
@Override
public List<PointDataVo> communications(String roleId, Date start, Date end) {
public List<PointDataVo> communications(String roleId, String start, String end) {
OriginalDataQuery originalDataQuery = new OriginalDataQuery();
originalDataQuery.setRealId(roleId);
originalDataQuery.setLimit(1);
originalDataQuery.setPage(100000);
originalDataQuery.setLimit(10000);
originalDataQuery.setPage(1);
// 当日
if(ObjectUtil.isEmpty(start) && ObjectUtil.isEmpty(end)){
Calendar calendar = Calendar.getInstance();
@ -160,22 +157,22 @@ public class CentralMonitorServiceImpl implements CentralMonitorService {
calendar.add(Calendar.MILLISECOND,-calendar.get(Calendar.MILLISECOND));
originalDataQuery.setBeginTime(calendar.getTime());
}else{
originalDataQuery.setBeginTime(start);
originalDataQuery.setEndTime(end);
originalDataQuery.setBeginTime(DateUtil.parse(start,DateUtil.PATTERN_DATETIME));
originalDataQuery.setEndTime(DateUtil.parse(end,DateUtil.PATTERN_DATETIME));
}
Result<HzPage<PointData>> originalDataByRealIds = historyDataSearchClient.getOriginalDataByRealIds(originalDataQuery);
if (!originalDataByRealIds.isSuccess()) {
throw new ServiceException("数据不存在");
if (!originalDataByRealIds.isSuccess() || ObjectUtil.isEmpty(originalDataByRealIds.getData()) || CollectionUtil.isEmpty(originalDataByRealIds.getData().getRecords())) {
return new ArrayList<>();
}
HzPage<PointData> data = originalDataByRealIds.getData();
StationEntity station = stationService.getOne(Wrappers.<StationEntity>lambdaQuery()
.eq(StationEntity::getCode,originalDataByRealIds.getData().getRecords().get(0).getStation())
);
return data.getRecords().stream().map(item -> {
PointDataVo pointDataVo = new PointDataVo();
BeanUtils.copyProperties(item, pointDataVo);
//通过站点id获取站点名称
String code = pointDataVo.getStation();
StationEntity station = stationService.getOne(Wrappers.<StationEntity>lambdaQuery()
.eq(StationEntity::getCode,code)
);
if(ObjectUtil.isNotEmpty(station)){
pointDataVo.setStationName(station.getName());
}

15
hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyRecServiceImpl.java

@ -229,13 +229,18 @@ public class ImsDutyRecServiceImpl extends ServiceImpl<ImsDutyRecMapper, ImsDuty
//保存对应业务表单
String saved = saveEntity(JSONObject.toJSONString(recDTO));
//开启动作流
R r = this.startProcess(JSON.toJSONString(saved), DutyRecProcessConstant.DUTY_REC_FLOW_KEY,null);
R r = this.startProcess(saved, DutyRecProcessConstant.DUTY_REC_FLOW_KEY,null);
return r;
}
@Override
public String saveEntity(String entity) {
ImsDutyRecDTO recDTO= JSONObject.parseObject(entity, ImsDutyRecDTO.class);
// 判断是否已交班
List<ImsDutyRecEntity> dutyRecs = this.list(Wrappers.<ImsDutyRecEntity>lambdaQuery().eq(ImsDutyRecEntity::getDutyId, recDTO.getDutyId()));
Assert.isTrue(CollectionUtil.isEmpty(dutyRecs),() -> {
throw new ServiceException("您已交班,请勿重复交班!");
});
transactionTemplate.setTransactionManager(transactionManager);
// 获取班组组长
Long managerId = this.getHandleGroupManagerByDuty(recDTO.getDutyId());
@ -258,13 +263,13 @@ public class ImsDutyRecServiceImpl extends ServiceImpl<ImsDutyRecMapper, ImsDuty
transactionTemplate.setTransactionManager(transactionManager);
String res = transactionTemplate.execute(status -> {
// 在这里执行需要事务控制的代码
if(Func.isNotEmpty(duration) && duration > 0) {
recDTO.setDelayStatus(DutyContants.DutyRecDelayStatusEnum.HAND_DELAY_STATUS.getStatus());
}
ImsDutyRecEntity recEntity = BeanUtil.copy(recDTO,ImsDutyRecEntity.class);
if (Func.isEmpty(recEntity.getId())) {
save(recEntity);
recDTO.setId(recEntity.getId());
}
ImsDutyLogEntity imsDutyLogEntity = recDTO.getImsDutyLogEntity();
imsDutyLogEntity.setHandTime(DateUtil.format(new Date(),PATTERN_DATETIME));
@ -339,11 +344,7 @@ public class ImsDutyRecServiceImpl extends ServiceImpl<ImsDutyRecMapper, ImsDuty
*/
private Long getHandleGroupManagerByDuty(Long dutyId) {
ImsDutyMainEntity dutyMain = imsDutyMainMapper.selectById(dutyId);
// 判断是否已交班
List<ImsDutyRecEntity> dutyRecs = this.list(Wrappers.<ImsDutyRecEntity>lambdaQuery().eq(ImsDutyRecEntity::getDutyId, dutyId));
Assert.isTrue(CollectionUtil.isEmpty(dutyRecs),() -> {
throw new ServiceException("您已交班,请勿重复交班!");
});
//根据上一班值班id查询值班信息
ImsDutyMainEntity carryDutyMain = imsDutyMainMapper.selectOne(Wrappers.<ImsDutyMainEntity>lambdaQuery().eq(ImsDutyMainEntity::getPreDutyId, dutyId));
Assert.isTrue(ObjectUtil.isNotEmpty(carryDutyMain),() -> {

6
hzims-service/operational/src/main/java/com/hnac/hzims/operational/history/service/impl/AlarmServiceImpl.java

@ -3,6 +3,7 @@ package com.hnac.hzims.operational.history.service.impl;
import com.hnac.hzims.operational.history.service.AlarmService;
import com.hnac.hzims.operational.history.vo.HistoryProjectAlarmVo;
import com.hnac.hzinfo.sdk.core.response.Result;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.mp.support.Query;
import com.hnac.hzinfo.sdk.v5.soe.SoeDataClient;
import lombok.AllArgsConstructor;
@ -42,7 +43,10 @@ public class AlarmServiceImpl implements AlarmService {
query.getCurrent(),
query.getSize()
);
if(!result.isSuccess() || CollectionUtil.isEmpty(result.getData())){
if(!result.isSuccess()){
throw new ServiceException(result.getMsg());
}
if(CollectionUtil.isEmpty(result.getData())){
return new HashMap<>();
}
return result.getData();

26
hzims-service/operational/src/main/java/com/hnac/hzims/operational/history/service/impl/PointServiceImpl.java

@ -15,10 +15,14 @@ import com.hnac.hzinfo.sdk.v5.project.ProjectClient;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.tool.api.IResultCode;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.api.ResultCode;
import org.springblade.core.tool.utils.CollectionUtil;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@ -48,7 +52,7 @@ public class PointServiceImpl implements PointService {
public List<FacDeviceVO> projectFacDevice(String projectId,String attrName) {
Result<List<FacDeviceVO>> result = hzFacClient.facDeviceByProjectId(projectId,attrName);
if(!result.isSuccess() || CollectionUtil.isEmpty(result.getData())){
throw new ServiceException(DataResultCode.FAIL,result.getMsg());
return new ArrayList<>();
}
return result.getData();
}
@ -63,7 +67,7 @@ public class PointServiceImpl implements PointService {
public List<FacDeviceAttrVO> projectFacDeviceAttr(String facDeviceId, String attrName) {
Result<List<FacDeviceAttrVO>> result = hzFacClient.facDeviceAttrList(facDeviceId,attrName);
if(!result.isSuccess() || CollectionUtil.isEmpty(result.getData())){
throw new ServiceException(DataResultCode.FAIL,result.getMsg());
return new ArrayList<>();
}
return result.getData();
}
@ -77,7 +81,7 @@ public class PointServiceImpl implements PointService {
public List<DeviceInstanceVO> projectDeviceInstance(String projectId,String attrName) {
R<List<DeviceInstanceVO>> result = deviceClient.getOnlineDeviceInstanceSearchName(projectId,attrName);
if(!result.isSuccess() || CollectionUtil.isEmpty(result.getData())){
throw new ServiceException(DataResultCode.FAIL,result.getMsg());
return new ArrayList<>();
}
return result.getData();
}
@ -92,7 +96,7 @@ public class PointServiceImpl implements PointService {
public List<DeviceInstanceAttrVO> projectDeviceInstanceAttr(String deviceCode, String attrName) {
Result<List<DeviceInstanceAttrVO>> result = deviceClient.getDeviceAttrByName(deviceCode,attrName);
if(!result.isSuccess() || CollectionUtil.isEmpty(result.getData())){
throw new ServiceException(DataResultCode.FAIL,result.getMsg());
return new ArrayList<>();
}
return result.getData();
}
@ -117,8 +121,11 @@ public class PointServiceImpl implements PointService {
curve.getCurrent(),
curve.getPageSize()
);
if(!result.isSuccess() || CollectionUtil.isEmpty(result.getData())){
throw new ServiceException(DataResultCode.FAIL,result.getMsg());
if(!result.isSuccess()){
throw new ServiceException(result.getMsg());
}
if(CollectionUtil.isEmpty(result.getData())){
return new HashMap<>();
}
return result.getData();
}
@ -140,8 +147,11 @@ public class PointServiceImpl implements PointService {
curve.getEndTime(),
curve.getDimension(),
curve.getIntervalType());
if(!result.isSuccess() || CollectionUtil.isEmpty(result.getData())){
throw new ServiceException(DataResultCode.FAIL,result.getMsg());
if(!result.isSuccess()){
throw new ServiceException(result.getMsg());
}
if(CollectionUtil.isEmpty(result.getData())){
return new HashMap<>();
}
return result.getData();
}

2
hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/impl/OperMaintenanceLibraryServiceImpl.java

@ -20,6 +20,7 @@ import org.apache.commons.lang3.RandomUtils;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.*;
import org.springframework.beans.factory.annotation.Autowired;
@ -50,6 +51,7 @@ public class OperMaintenanceLibraryServiceImpl extends ServiceImpl<OperMaintenan
req.setLibraryCode(DateUtil.format(DateUtil.now(), DateUtil.PATTERN_DATETIME_MINI) + RandomUtils.nextInt(0, 999));
List<String> disposers = Arrays.stream(StringUtil.splitTrim(req.getDisposers(), ",")).filter(o -> StringUtil.isNotBlank(o)).collect(Collectors.toList());
req.setCreatePlanStartDisposer(disposers.size()>0 ? Long.valueOf(disposers.get(0)) : null);
req.setCreateDept(Long.valueOf(AuthUtil.getDeptId()));
super.save(req);
return R.data(req);
}

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

@ -156,6 +156,7 @@ public class OperationTicketServiceImpl implements OperationTicketService , Star
standardTicketInfoVo.setCode(code);
//3. 保存操作对象
StandardTicketInfoEntity standardTicketInfo = getStandardTicketInfoEntity(standardTicketInfoVo);
standardTicketInfo.setStatus(1);
boolean save = standardTicketInfoService.save(standardTicketInfo);
if (!save) {
throw new ServiceException("Save failed");
@ -382,6 +383,9 @@ public class OperationTicketServiceImpl implements OperationTicketService , Star
log.error("安全措施为空哦");
return new ArrayList<>();
}
measureEntityList= measureEntityList.stream().map(s->{
s.setStatus(1);
return s;}).collect(Collectors.toList());
boolean save = standardTicketMeasureService.saveBatch(measureEntityList);
if (!save) {
throw new ServiceException("Save failed");

1
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/TicketProcessServiceImpl.java

@ -790,6 +790,7 @@ public class TicketProcessServiceImpl implements TicketProcessService, StartProc
measure.setCreateDept(workTicketInfoEntity.getCreateDept());
measure.setCreateUser(workTicketInfoEntity.getCreateUser());
measure.setExecutor(AuthUtil.getUserId());
measure.setStatus(1);
return measure;
}).collect(Collectors.toList());
boolean savedBatch = workTicketSafetyMeasureService.saveBatch(measureEntityList);

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

@ -36,6 +36,7 @@ public class StandardTicketInfoVo extends TenantEntity {
@ApiModelProperty("编号")
private String code;
@ApiModelProperty("发令人")
private Long issueOrderPerson;
@ -167,4 +168,10 @@ public class StandardTicketInfoVo extends TenantEntity {
@ApiModelProperty("图片附件")
private String picture;
@ApiModelProperty("设备编号")
private String emCode ;
@ApiModelProperty("设备名称")
private String emName;
}

4
hzims-service/ticket/src/main/resources/db/3.0.0.sql

@ -7,3 +7,7 @@ ALTER TABLE `hzims_standard_ticket_info`
ADD COLUMN `is_normal` tinyint(2) NULL DEFAULT 1 ;
ALTER TABLE `hzims_work_ticket_info`
ADD COLUMN `is_normal` tinyint(2) NULL DEFAULT 1 ;
ALTER TABLE `hzims_standard_ticket_info`
ADD COLUMN `em_code` varchar(255) NULL COMMENT '设备编号' ,
ADD COLUMN `em_name` varchar(255) NULL COMMENT '设备名称' ;
Loading…
Cancel
Save