Browse Source

Merge remote-tracking branch 'origin/master'

zhongwei
yang_shj 9 months ago
parent
commit
b6dc980846
  1. 9
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/station/entity/StationEntity.java
  2. 2
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/HygieneRecordEntity.java
  3. 9
      hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/service/impl/FdpTaskServiceImpl.java
  4. 2
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/job/service/TaskJobService.java
  5. 3
      hzims-service/inspect/src/main/resources/db/2.0.0.sql.1
  6. 6
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/impl/OperPhenomenonServiceImpl.java
  7. 9
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyLogServiceImpl.java
  8. 7
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyRecServiceImpl.java
  9. 7
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/controller/StationController.java
  10. 9
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/mapper/StationMapper.java
  11. 9
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/mapper/StationMapper.xml
  12. 15
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/IStationService.java
  13. 230
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/StationServiceImpl.java
  14. 7
      hzims-service/operational/src/main/resources/db/4.0.0 .sql.1
  15. 18
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/EmergencyPlanController.java
  16. 12
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/CarCheckRecordServiceImpl.java
  17. 2
      hzims-service/safeproduct/src/main/resources/db/2.0.0.sql.1
  18. BIN
      hzims-service/ticket/src/main/resources/template/电气操作票.docx

9
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/station/entity/StationEntity.java

@ -177,4 +177,13 @@ public class StationEntity extends TenantEntity implements Serializable {
@QueryField(condition = SqlCondition.EQUAL)
@ApiModelProperty("所属国家")
private String refCountry;
@ApiModelProperty("是否推送数据平台")
private Boolean isPushProject;
@ApiModelProperty("是否推送FDP")
private Boolean isPushFdp;
@ApiModelProperty("删除记录ID")
private Long deletedId;
}

2
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/HygieneRecordEntity.java

@ -39,7 +39,7 @@ public class HygieneRecordEntity extends BaseEntity {
@ApiModelProperty("实际结束时间")
private Date actualEndTime;
@Size(max = 20, message = "检查人字段长度不能超过20")
@Size(max = 100, message = "检查人字段长度不能超过100")
@ApiModelProperty("检查人")
private String checkUser;

9
hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/service/impl/FdpTaskServiceImpl.java

@ -234,11 +234,12 @@ public class FdpTaskServiceImpl extends BaseServiceImpl<FdpTaskMapper, FdpTaskEn
//诊断成功
if (3 == req.getStatus()) {
fdpSubmitResultDTO.setSuccess(1);
} else if (Func.isNotEmpty(req.getReasonId())) {
fdpSubmitResultDTO.setRootCause(req.getReasonId());
} else {
return R.fail("诊断传送状态异常");
}
// else if (Func.isNotEmpty(req.getReasonId())) {
// fdpSubmitResultDTO.setRootCause(req.getReasonId());
// } else {
// return R.fail("诊断传送状态异常");
// }
if (Func.isNotEmpty(req.getReasonId())) {
fdpSubmitResultDTO.setRootCause(req.getReasonId());
}

2
hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/job/service/TaskJobService.java

@ -288,7 +288,7 @@ public class TaskJobService {
QueryWrapper<PlanOrgEntity> planOrgEntityQueryWrapper = new QueryWrapper<>();
planOrgEntityQueryWrapper.lambda().eq(PlanOrgEntity::getPlanId, plan.getId());
planOrgService.list(planOrgEntityQueryWrapper).stream().forEach(entity->{
List<User> users = userClient.userListByDeptId(entity.getOrgId()).getData();
List<User> users = userClient.userList(entity.getTenantId(),entity.getOrgId()).getData();
for(User u:users){
res.add(PlanUserEntity.builder().planId(plan.getId()).userId(u.getId()).build());
}

3
hzims-service/inspect/src/main/resources/db/2.0.0.sql.1

@ -10,4 +10,5 @@ alter table `hz_st_ex_task` add column `video_url` varchar(255) default null com
alter table `hz_st_camera_info` add column `em_code` varchar(50) default null comment '设备编号';
alter table `hz_st_robot` add column `code` varchar(50) default null comment '机器人编号';
alter table `hz_st_robot` add column `station_code` varchar(50) default null comment '站点编号';
alter table `hz_st_robot` add column `is_device_instance` tinyint(2) default 0 comment '是否绑定设备实例';
alter table `hz_st_robot` add column `is_device_instance` tinyint(2) default 0 comment '是否绑定设备实例';
alter table `hz_st_re_object` change COLUMN `EM_CODE` `EM_CODE` VARCHAR(50) COMMENT '设备编号';

6
hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/impl/OperPhenomenonServiceImpl.java

@ -609,9 +609,6 @@ public class OperPhenomenonServiceImpl extends BaseServiceImpl<OperPhenomenonMap
List<CheckVoteChartVo> res = new ArrayList<>();
if (CollectionUtil.isNotEmpty(operPhenomenonEntities)) {
CheckVoteChartVo all = getCheckVoteChartVo(operPhenomenonEntities);
all.setName("总计");
res.add(all);
Map<Long, List<OperPhenomenonEntity>> collect = Optional.ofNullable(operPhenomenonEntities).orElse(new ArrayList<>()).stream().collect(Collectors.groupingBy(OperPhenomenonEntity::getCreateDept));
for (Map.Entry<Long, List<OperPhenomenonEntity>> longListEntry : collect.entrySet()) {
CheckVoteChartVo chartVo= getCheckVoteChartVo(longListEntry.getValue());
@ -619,6 +616,9 @@ public class OperPhenomenonServiceImpl extends BaseServiceImpl<OperPhenomenonMap
chartVo.setName(deptName.isSuccess() ? deptName.getData() : "");
res.add(chartVo);
}
CheckVoteChartVo all = getCheckVoteChartVo(operPhenomenonEntities);
all.setName("总计");
res.add(all);
} else {
CheckVoteChartVo all = new CheckVoteChartVo();
all.setName("总计");

9
hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyLogServiceImpl.java

@ -14,6 +14,7 @@ import org.apache.commons.io.IOUtils;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.tool.utils.Func;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.io.*;
import java.net.HttpURLConnection;
@ -30,6 +31,8 @@ import java.util.*;
@Service
public class ImsDutyLogServiceImpl extends BaseServiceImpl<ImsDutyLogMapper, ImsDutyLogEntity> implements IImsDutyLogService {
@Value("${hzims.duty.file-path}")
private String savePath;
@Override
public void exportDutyLog(String dutyId, HashMap<String, Object> map) {
ImsDutyLogEntity res = this.baseMapper.selectOne(new LambdaQueryWrapper<ImsDutyLogEntity>() {{
@ -107,12 +110,14 @@ public class ImsDutyLogServiceImpl extends BaseServiceImpl<ImsDutyLogMapper, Ims
if (StringUtils.isNotBlank(res.getDutyPic())) {
String[] dutyPicSplit = res.getDutyPic().split(",");
for (String string : dutyPicSplit) {
ImageEntity imageEntity = new ImageEntity(imgToByte("/template/img" + downloadFileByUrl(string, "/template/img")), 225, 163);
ImageEntity imageEntity = new ImageEntity(imgToByte(savePath + downloadFileByUrl(string, savePath)), 225, 163);
imageEntity.setUrl(string);
imageEntityList.add(imageEntity);
}
map.put("dutyPic",imageEntityList);
}else {
imageEntityList.add(new ImageEntity());
}
map.put("dutyPic",imageEntityList);
}
}

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

@ -9,6 +9,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.google.common.collect.Lists;
import com.hnac.hzims.equipment.entity.EmInfoEntity;
import com.hnac.hzims.equipment.entity.PlanGenerationEntity;
import com.hnac.hzims.message.MessageConstants;
import com.hnac.hzims.message.dto.MessagePushRecordDto;
import com.hnac.hzims.message.fegin.IMessageClient;
@ -417,6 +418,12 @@ public class ImsDutyRecServiceImpl extends BaseServiceImpl<ImsDutyRecMapper, Ims
public ImsDutyRecVO getDdetail(ImsDutyRecVO vo) {
ImsSchedulingVo imsSchedulingVo1 = imsDutyMainService.getByIdOneV2(vo.getDutyId());
vo.setHeadDutyMainVo(imsSchedulingVo1);
ImsDutyLogEntity imsDutyLog = imsDutyLogService.getOne(new LambdaQueryWrapper<ImsDutyLogEntity>() {{
eq(ImsDutyLogEntity::getDutyId, vo.getDutyId()).last(" limit 1");
}});
if (ObjectUtil.isNotEmpty(imsDutyLog)) {
vo.setImsDutyLogEntity(imsDutyLog);
}
ImsDutyMainEntity imsDutyMainEntity = imsDutyMainMapper.selectOne(new QueryWrapper<ImsDutyMainEntity>() {{
eq("PRE_DUTY_ID", vo.getDutyId());
}});

7
hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/controller/StationController.java

@ -207,4 +207,11 @@ public class StationController extends BladeController {
public R<List<StationEntity>> accessHydropower() {
return R.data(stationService.accessHydropower());
}
@PostMapping("/instanceFdpStation")
@ApiOperationSupport(order = 100)
@ApiOperation(value = "实例化FDP站点", notes = "实例化FDP站点")
public R instanceFdpStation(@RequestBody StationEntity req) {
return R.status(stationService.instanceFdpStation(req));
}
}

9
hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/mapper/StationMapper.java

@ -1,6 +1,8 @@
package com.hnac.hzims.operational.station.mapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.hnac.hzims.operational.main.vo.StationCountVo;
import com.hnac.hzims.operational.station.entity.StationEntity;
import com.hnac.hzims.operational.station.vo.HzimsStationCountVo;
@ -276,6 +278,11 @@ public interface StationMapper extends UserDataScopeBaseMapper<StationEntity> {
List<HzimsStationCountVo> getStationCount();
/**
* 查询不带数据权限站点信息
* @param wrapper wrapper
* @return 站点列表
*/
List<StationEntity> listWithOutAuth(@Param(Constants.WRAPPER) Wrapper wrapper);
List<StationsVo> stationVoCount();
}

9
hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/mapper/StationMapper.xml

@ -455,4 +455,13 @@
select date_format(create_time,'%Y') year, count(1) count
from hzims_station group by year
</select>
<select id="listWithOutAuth" resultType="com.hnac.hzims.operational.station.entity.StationEntity">
select * from `hzims_station`
<where>
`is_deleted` = 0
<if test="ew!=null and ew.sqlSegment!=null and ew.sqlSegment != ''">
and ${ew.sqlSegment}
</if>
</where>
</select>
</mapper>

15
hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/IStationService.java

@ -1,5 +1,6 @@
package com.hnac.hzims.operational.station.service;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hnac.hzims.operational.main.vo.StationCountVo;
@ -38,6 +39,8 @@ public interface IStationService extends BaseService<StationEntity> {
*/
boolean instanceProject(StationEntity req);
boolean instanceFdpStation(StationEntity req);
/**
* 删除站点
* @param id 站点ID按逗号分隔
@ -129,4 +132,16 @@ public interface IStationService extends BaseService<StationEntity> {
boolean updateById(StationEntity req);
List<StationEntity> accessHydropower();
@Override
@Deprecated
boolean removeByMap(Map<String, Object> columnMap);
@Override
boolean save(StationEntity entity);
Boolean createStation(StationEntity station);
Boolean updateStation(StationEntity station);
}

230
hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/StationServiceImpl.java

@ -1,11 +1,16 @@
package com.hnac.hzims.operational.station.service.impl;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.toolkit.SqlHelper;
import com.hnac.hzims.fdp.feign.IQuestionClient;
import com.hnac.hzims.hzimsweather.response.air.Station;
import com.hnac.hzims.operational.OperationalConstants;
import com.hnac.hzims.operational.main.constant.HomePageConstant;
import com.hnac.hzims.operational.main.entity.UserDeptEntity;
@ -51,6 +56,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.Assert;
import java.io.Serializable;
import java.util.*;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.FutureTask;
@ -73,33 +79,28 @@ public class StationServiceImpl extends BaseServiceImpl<StationMapper, StationEn
private final IStationAttributeService stationAttributeService;
private final IStationPushConfigService stationPushConfigService;
@Override
@Transactional(rollbackFor = Exception.class)
public void buildStation(StationEntity req) {
LambdaQueryWrapper lwq;
if (Func.isEmpty(req.getId())) {
lwq = Wrappers.<StationEntity>lambdaQuery()
.eq(StationEntity::getCode, req.getCode()).or().eq(StationEntity::getName, req.getName());
} else {
lwq = Wrappers.<StationEntity>lambdaQuery().ne(StationEntity::getId, req.getId())
.and(wrapper -> wrapper.eq(StationEntity::getCode, req.getCode()).or().eq(StationEntity::getName, req.getName()));
if(Func.isEmpty(req.getId())) {
this.createStation(req);
}
List<StationEntity> list = super.list(lwq);
Assert.isTrue(CollectionUtil.isEmpty(list), () -> {
throw new ServiceException("该站点名/编码已有对应记录,请找到相应记录做修改处理");
});
// 新建站点的所属机构
Assert.isTrue(this.buildDept(req), () -> {
throw new ServiceException("创建/修改机构失败!");
});
Optional<Integer> sort = Optional.ofNullable(this.getStationMaxOrder());
req.setSort(sort.isPresent() ? sort.get() + 1 : 1);
this.pushStation(req);
boolean updateResult = this.saveOrUpdate(req);
Assert.isTrue(updateResult, () -> {
throw new ServiceException("创建/修改站点信息失败!");
});
else {
this.updateStation(req);
}
// // 新建站点的所属机构
// Assert.isTrue(this.buildDept(req), () -> {
// throw new ServiceException("创建/修改机构失败!");
// });
// Optional<Integer> sort = Optional.ofNullable(this.getStationMaxOrder());
// req.setSort(sort.isPresent() ? sort.get() + 1 : 1);
// this.pushStation(req);
// boolean updateResult = this.saveOrUpdate(req);
// Assert.isTrue(updateResult, () -> {
// throw new ServiceException("创建/修改站点信息失败!");
// });
}
/**
@ -144,19 +145,22 @@ public class StationServiceImpl extends BaseServiceImpl<StationMapper, StationEn
}
@Override
public boolean instanceProject(StationEntity req) {
if (Func.isEmpty(req.getSecretKey()) || Func.isEmpty(req.getDataSource())) {
return true;
public boolean removeById(Serializable id) {
LambdaUpdateWrapper<StationEntity> luw = Wrappers.<StationEntity>lambdaUpdate().set(StationEntity::getDeletedId, id).eq(StationEntity::getId, id);
this.update(luw);
return SqlHelper.retBool(getBaseMapper().deleteById(id));
}
@Override
public boolean removeByIds(Collection<? extends Serializable> idList) {
if (CollectionUtils.isEmpty(idList)) {
return false;
}
ProjectDTO projectDTO = new ProjectDTO();
projectDTO.setName(req.getName());
projectDTO.setSource(1);
projectDTO.setSecretKey(req.getSecretKey());
projectDTO.setListenKind(req.getDataSource());
projectDTO.setId(req.getCode());
Result result = projectClient.saveOrUpdate(projectDTO);
logger.info("operational:station:buildStation:" + req.getCode(), JSON.toJSONString(result));
return result.getCode() == ResultCode.SUCCESS.getCode() && result.isSuccess();
idList.forEach(id -> {
LambdaUpdateWrapper<StationEntity> luw = Wrappers.<StationEntity>lambdaUpdate().set(StationEntity::getDeletedId, id).eq(StationEntity::getId, id);
this.update(luw);
});
return SqlHelper.retBool(getBaseMapper().deleteBatchIds(idList));
}
@Override
@ -742,16 +746,154 @@ public class StationServiceImpl extends BaseServiceImpl<StationMapper, StationEn
return this.list(queryWrapper);
}
@Override
public boolean removeByMap(Map<String, Object> columnMap) {
throw new UnsupportedOperationException("该方法已被禁止使用");
}
@Override
public boolean instanceFdpStation(StationEntity req) {
StationPushConfigEntity config = StationPushConfigEntity.builder().stationType(req.getType()).build();
StationPushConfigVO configVO = stationPushConfigService.getOne(BeanUtil.copy(config, StationPushConfigDTO.class));
if (ObjectUtil.isNotEmpty(configVO) && configVO.getIsPush()) {
log.info("{}站点开始智能诊断站点推送", req.getCode());
R<Boolean> pushResult = questionClient.submitStationInfo(configVO.getFdpStationType(), req.getCode(), "运维平台推送");
if(pushResult.isSuccess()) {
LambdaUpdateWrapper<StationEntity> luq = Wrappers.<StationEntity>lambdaUpdate().set(StationEntity::getIsPushFdp, true).eq(StationEntity::getId, req.getId());
return this.update(luq);
}
else {
throw new ServiceException("站点推送智能诊断失败!");
}
}
else {
return true;
}
}
@Override
public boolean remove(Wrapper<StationEntity> queryWrapper) {
List<StationEntity> removeStations = this.list(queryWrapper);
removeStations.forEach(station -> {
LambdaUpdateWrapper<StationEntity> luw = Wrappers.<StationEntity>lambdaUpdate().set(StationEntity::getDeletedId, station.getId()).eq(StationEntity::getId, station.getId());
this.update(luw);
});
return SqlHelper.retBool(getBaseMapper().delete(queryWrapper));
}
@Override
public boolean instanceProject(StationEntity req) {
if (Func.isEmpty(req.getSecretKey()) || Func.isEmpty(req.getDataSource())) {
return true;
}
ProjectDTO projectDTO = new ProjectDTO();
projectDTO.setName(req.getName());
projectDTO.setSource(1);
projectDTO.setSecretKey(req.getSecretKey());
projectDTO.setListenKind(req.getDataSource());
projectDTO.setId(req.getCode());
Result result = projectClient.saveOrUpdate(projectDTO);
logger.info("operational:station:buildStation:" + req.getCode(), JSON.toJSONString(result));
if(result.getCode() == ResultCode.SUCCESS.getCode() && result.isSuccess()) {
LambdaUpdateWrapper<StationEntity> luq = Wrappers.<StationEntity>lambdaUpdate().set(StationEntity::getIsPushProject, true).eq(StationEntity::getId, req.getId());
return this.update(luq);
}
else {
throw new ServiceException("站点推送数据平台失败!");
}
}
@Override
public boolean updateById(StationEntity entity) {
if(Func.isNotEmpty(entity.getHigherDept())) {
StationEntity station = this.getById(entity.getId());
Assert.isTrue(entity.getHigherDept().equals(station.getHigherDept()),() -> {
throw new ServiceException("站点的上级机构不可更改!");
});
}
if(Func.isNotEmpty(entity.getSignage())) {
LambdaQueryWrapper<StationEntity> lqw = Wrappers.<StationEntity>lambdaQuery()
.eq(StationEntity::getSignage, entity.getSignage())
.ne(StationEntity::getId, entity.getId());
List<StationEntity> stations = this.getBaseMapper().listWithOutAuth(lqw);
Assert.isTrue(CollectionUtil.isEmpty(stations),() -> {
throw new ServiceException("站点两票标识平台已存在,请检查后重新填入!");
});
}
// 创建站点机构
this.createStationDept(entity);
return super.updateById(entity);
}
@Override
public boolean save(StationEntity entity) {
// 检查两票标识唯一性
if(StringUtil.isNotBlank(entity.getSignage())) {
LambdaQueryWrapper<StationEntity> wq = Wrappers.<StationEntity>lambdaQuery().eq(StationEntity::getSignage, entity.getSignage());
List<StationEntity> stations = this.getBaseMapper().listWithOutAuth(wq);
Assert.isTrue(CollectionUtil.isEmpty(stations),() -> {
throw new ServiceException("站点两票标识平台已存在,请检查后重新填入!");
});
}
// 创建站点机构
this.createStationDept(entity);
return super.save(entity);
}
/**
* 删除新建站点时绑定的数据项目智能诊断站点
*
* @param idList id集合
* 创建站点机构
* @param entity 站点信息
*/
private void deleteStation(List<Long> idList) {
LambdaQueryWrapper<StationEntity> lqw = Wrappers.<StationEntity>lambdaQuery().in(StationEntity::getId, idList);
List<StationEntity> stationEntityList = this.list(lqw);
// if(CollectionUtil.isNotEmpty(stationEntityList)) {
// stationEntityList.stream().map(StationEntity::getCode).forEach(code -> projectClient.delete());
// }
private void createStationDept(StationEntity entity) {
//若所属机构不为空 则说明机构已建 获取所属机构
Dept request = new Dept();
R<Dept> existDeptR = sysClient.getDeptByStation(entity.getCode(), AuthUtil.getTenantId());
if(existDeptR.isSuccess() && Func.isNotEmpty(existDeptR.getData())) {
if(!existDeptR.getData().getParentId().equals(entity.getHigherDept())) {
throw new ServiceException("该站点编号已被其他机构使用,保存失败!");
}
else {
entity.setRefDept(existDeptR.getData().getId());
}
}
else {
request.setStationId(entity.getCode());
request.setTenantId(AuthUtil.getTenantId());
request.setFullName(entity.getName());
request.setDeptName(entity.getName());
request.setParentId(entity.getHigherDept());
request.setDeptCategory(StationConstants.DeptCategoryEnum.STATION.getValue());
request.setSort(1);
R<Void> buildResult = deptClient.createOrUpdateDept(request);
if (buildResult.isSuccess()) {
// 所属机构回传
R<Dept> deptByStation = sysClient.getDeptByStation(request.getStationId(), AuthUtil.getTenantId());
Long deptId = Optional.ofNullable(deptByStation).map(R::getData).map(Dept::getId).orElse(null);
entity.setRefDept(deptId);
entity.setCreateDept(deptId);
}
}
}
@Override
public Boolean createStation(StationEntity station) {
if(this.save(station)) {
// 推送数据平台以及fdp
new Thread(() -> this.instanceProject(station),"数据平台推送").start();
new Thread(() -> this.instanceFdpStation(station),"fdp推送").start();
return true;
}
return false;
}
@Override
public Boolean updateStation(StationEntity station) {
if(this.updateById(station)) {
// 推送数据平台以及fdp
new Thread(() -> this.instanceProject(station),"数据平台推送").start();
new Thread(() -> this.instanceFdpStation(station),"fdp推送").start();
return true;
}
return false;
}
}

7
hzims-service/operational/src/main/resources/db/4.0.0 .sql.1

@ -32,4 +32,9 @@ CREATE TABLE `HZIMS_OPER_CONSTRUCTION` (
PRIMARY KEY (`ID`) USING BTREE
) ENGINE = INNODB CHARACTER SET = UTF8MB4 COLLATE = UTF8MB4_GENERAL_CI ROW_FORMAT = DYNAMIC;
alter table `hzims_oper_maintenance_library` add column `duty_class_tree` VARCHAR(100) NULL COMMENT '班次树,机构/班次类型/班次';
alter table `hzims_oper_maintenance_library` add column `duty_class_tree` VARCHAR(100) NULL COMMENT '班次树,机构/班次类型/班次';
alter table `hzims_station` add COLUMN `deleted_id` BIGINT(20) DEFAULT null COMMENT '删除记录ID';
update `hzims_station` set `deleted_id` = id where `IS_DELETED` = 1;
ALTER TABLE `hzims_station` ADD CONSTRAINT index_code_deleted UNIQUE (`code`, `deleted_id`);
alter table `hzims_station` add column `is_push_project` tinyint(2) default 0 comment '是否推送数据平台';
alter table `hzims_station` add column `is_push_fdp` tinyint(2) default 0 comment '是否推送FDP';

18
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/EmergencyPlanController.java

@ -53,15 +53,15 @@ public class EmergencyPlanController extends BladeController {
return R.status(emergencyPlanService.save(req));
}
// /**
// * 修改
// */
// @PostMapping("/update")
// @ApiOperationSupport(order = 30)
// @ApiOperation(value = "修改", notes = "传入emergencyPlan")
// public R update(@Validated(Update.class) @RequestBody EmergencyPlanDTO req) {
// return R.status(emergencyPlanService.updateById(req));
// }
/**
* 修改
*/
@PostMapping("/update")
@ApiOperationSupport(order = 30)
@ApiOperation(value = "修改", notes = "传入emergencyPlan")
public R update(@RequestBody EmergencyPlanDTO req) {
return R.status(emergencyPlanService.updateById(req));
}
/**
* 详情

12
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/CarCheckRecordServiceImpl.java

@ -162,11 +162,17 @@ public class CarCheckRecordServiceImpl extends ServiceImpl<CarCheckRecordMapper,
@Transactional(rollbackFor = Exception.class)
@Override
public boolean updateCarCheckRecord(CarCheckRecordDTO carCheckRecordDTO) {
boolean deleteFlag = carCheckItemService.removeRelativeCarCheckItem(carCheckRecordDTO.getId());
if (!deleteFlag){
return false;
}
// 更新检查项
List<CarCheckItemEntity> itemList = carCheckRecordDTO.getItemList();
boolean updateItem = carCheckItemService.updateBatchById(itemList);
// 若更新检查项成功,则更新车检记录
if (updateItem) {
itemList.forEach(x -> {x.setCarCheckRecordId(carCheckRecordDTO.getId());
x.setId(null);});
boolean b = carCheckItemService.saveBatch(itemList);
if (b) {
// 若更新检查项成功,则更新车检记录
CarCheckRecordEntity carCheckRecordEntity = new CarCheckRecordEntity();
BeanUtil.copyProperties(carCheckRecordDTO, carCheckRecordEntity);
return this.updateById(carCheckRecordEntity);

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

@ -222,7 +222,7 @@ CREATE TABLE `HZIMS_HYGIENE_RECORD` (
`ACTUAL_START_TIME` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '实际开始时间',
`ACTUAL_END_TIME` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '实际结束时间',
`CHECK_TIME` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '检查时间',
`CHECK_USER` VARCHAR(20) NOT NULL DEFAULT '' COMMENT '检查人',
`CHECK_USER` VARCHAR(100) NOT NULL DEFAULT '' COMMENT '检查人',
`HYGIENE_ZONE_IDS` VARCHAR(1000) NOT NULL COMMENT '卫生自查区域ID',
`CHECK_RESULT` MEDIUMTEXT NOT NULL COMMENT '检查结果',
`COMPREHENSIVE_SCORE` VARCHAR(500) NOT NULL COMMENT '综合评分',

BIN
hzims-service/ticket/src/main/resources/template/电气操作票.docx

Binary file not shown.
Loading…
Cancel
Save