diff --git a/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/standardTicket/entity/StandardTicketInfoEntity.java b/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/standardTicket/entity/StandardTicketInfoEntity.java index 0312ece..1a2fe67 100644 --- a/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/standardTicket/entity/StandardTicketInfoEntity.java +++ b/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; } diff --git a/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/mapper/PlanGenerationMapper.java b/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/mapper/PlanGenerationMapper.java index eb7f592..f6be400 100644 --- a/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/mapper/PlanGenerationMapper.java +++ b/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 { - Float selectPlanGenertionYearCount(String stationId, int year); + Float selectPlanGenertionYearCount(@Param("stationId") String stationId,@Param("year") int year); List selectListAll(@Param("date") String date); @@ -42,5 +42,5 @@ public interface PlanGenerationMapper extends UserDataScopeBaseMapper getPlanPowerByYear(String code, int year); + List getPlanPowerByYear(@Param("code") String code,@Param("year") int year); } diff --git a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/offline/filter/ContentTypeFilter.java b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/offline/filter/ContentTypeFilter.java new file mode 100644 index 0000000..94c64e1 --- /dev/null +++ b/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); + } +} diff --git a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/offline/filter/ContentTypeRequestWrapper.java b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/offline/filter/ContentTypeRequestWrapper.java new file mode 100644 index 0000000..47053a5 --- /dev/null +++ b/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 getHeaders(String name) { + if ("Content-Type".equalsIgnoreCase(name)) { + return Collections.enumeration(Collections.singleton(newContentType)); + } + return super.getHeaders(name); + } + + @Override + public Enumeration getHeaderNames() { + Map headers = new HashMap<>(); + HttpServletRequest originalRequest = (HttpServletRequest) getRequest(); + Enumeration 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()); + } +} \ No newline at end of file diff --git a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/offline/service/impl/InspectOfflineServiceImpl.java b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/offline/service/impl/InspectOfflineServiceImpl.java index e33d189..8accdf3 100644 --- a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/offline/service/impl/InspectOfflineServiceImpl.java +++ b/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 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 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 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 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"); } - } diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/config/controller/CentralMonitorController.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/config/controller/CentralMonitorController.java index 824c597..f490b1e 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/config/controller/CentralMonitorController.java +++ b/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 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> communications(String roleId,Date start,Date end){ + public R> communications(String roleId,String start,String end){ return R.data(monitorService.communications(roleId,start,end)); } } diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/config/service/CentralMonitorService.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/config/service/CentralMonitorService.java index cc3caf8..8e399cc 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/config/service/CentralMonitorService.java +++ b/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 selectOriginalDataByRealIds(Integer page, Integer size, String roleId, Date start, Date end); + IPage selectOriginalDataByRealIds(Integer page, Integer size, String roleId, String start, String end); - List communications(String roleId, Date start, Date end); + List communications(String roleId, String start, String end); } diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/config/service/impl/CentralMonitorServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/config/service/impl/CentralMonitorServiceImpl.java index e3f5b51..c901442 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/config/service/impl/CentralMonitorServiceImpl.java +++ b/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 selectOriginalDataByRealIds(Integer page, Integer size, String roleId,Date start,Date end) { + public IPage 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 iPage = new Page<>(page, size); Result> 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 data = originalDataByRealIds.getData(); List collect = data.getRecords().stream().map(item -> { @@ -130,8 +129,6 @@ public class CentralMonitorServiceImpl implements CentralMonitorService { } return pointDataVo; }).collect(Collectors.toList()); - - IPage 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 communications(String roleId, Date start, Date end) { + public List 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> 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 data = originalDataByRealIds.getData(); + StationEntity station = stationService.getOne(Wrappers.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.lambdaQuery() - .eq(StationEntity::getCode,code) - ); if(ObjectUtil.isNotEmpty(station)){ pointDataVo.setStationName(station.getName()); } diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyRecServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyRecServiceImpl.java index cffc22f..1acd9ef 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyRecServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyRecServiceImpl.java @@ -229,13 +229,18 @@ public class ImsDutyRecServiceImpl extends ServiceImpl dutyRecs = this.list(Wrappers.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 { // 在这里执行需要事务控制的代码 - 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 dutyRecs = this.list(Wrappers.lambdaQuery().eq(ImsDutyRecEntity::getDutyId, dutyId)); - Assert.isTrue(CollectionUtil.isEmpty(dutyRecs),() -> { - throw new ServiceException("您已交班,请勿重复交班!"); - }); + //根据上一班值班id查询值班信息 ImsDutyMainEntity carryDutyMain = imsDutyMainMapper.selectOne(Wrappers.lambdaQuery().eq(ImsDutyMainEntity::getPreDutyId, dutyId)); Assert.isTrue(ObjectUtil.isNotEmpty(carryDutyMain),() -> { diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/history/service/impl/AlarmServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/history/service/impl/AlarmServiceImpl.java index 296e515..ee37907 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/history/service/impl/AlarmServiceImpl.java +++ b/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(); diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/history/service/impl/PointServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/history/service/impl/PointServiceImpl.java index 5ea8453..6b488f3 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/history/service/impl/PointServiceImpl.java +++ b/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 projectFacDevice(String projectId,String attrName) { Result> 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 projectFacDeviceAttr(String facDeviceId, String attrName) { Result> 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 projectDeviceInstance(String projectId,String attrName) { R> 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 projectDeviceInstanceAttr(String deviceCode, String attrName) { Result> 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(); } diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/impl/OperMaintenanceLibraryServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/impl/OperMaintenanceLibraryServiceImpl.java index ad2d044..79c5ce5 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/impl/OperMaintenanceLibraryServiceImpl.java +++ b/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 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); } diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/OperationTicketServiceImpl.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/OperationTicketServiceImpl.java index 34c9db7..028eb9a 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/OperationTicketServiceImpl.java +++ b/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"); diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/TicketProcessServiceImpl.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/TicketProcessServiceImpl.java index a5fe953..c294360 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/TicketProcessServiceImpl.java +++ b/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); diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/vo/operation/StandardTicketInfoVo.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/vo/operation/StandardTicketInfoVo.java index 1c58a20..95a0f76 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/vo/operation/StandardTicketInfoVo.java +++ b/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; } diff --git a/hzims-service/ticket/src/main/resources/db/3.0.0.sql b/hzims-service/ticket/src/main/resources/db/3.0.0.sql index 101eda0..364b1fd 100644 --- a/hzims-service/ticket/src/main/resources/db/3.0.0.sql +++ b/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 '设备名称' ; \ No newline at end of file