Browse Source

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

zhongwei
yang_shj 3 months ago
parent
commit
24c58ef486
  1. 2
      hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/service/impl/VectorParamServiceImpl.java
  2. 19
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/service/impl/HazardWorkServiceImpl.java

2
hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/service/impl/VectorParamServiceImpl.java

@ -4,10 +4,12 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hnac.hzims.bigmodel.maintenance.entity.VectorParamEntity; import com.hnac.hzims.bigmodel.maintenance.entity.VectorParamEntity;
import com.hnac.hzims.bigmodel.maintenance.mapper.VectorParamMapper; import com.hnac.hzims.bigmodel.maintenance.mapper.VectorParamMapper;
import com.hnac.hzims.bigmodel.maintenance.service.VectorParamService; import com.hnac.hzims.bigmodel.maintenance.service.VectorParamService;
import org.springframework.stereotype.Service;
/** /**
* @Author: ypj * @Author: ypj
* @Date: 2024/9/2 16:14 * @Date: 2024/9/2 16:14
*/ */
@Service
public class VectorParamServiceImpl extends ServiceImpl<VectorParamMapper, VectorParamEntity> implements VectorParamService { public class VectorParamServiceImpl extends ServiceImpl<VectorParamMapper, VectorParamEntity> implements VectorParamService {
} }

19
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/service/impl/HazardWorkServiceImpl.java

@ -1,5 +1,6 @@
package com.hnac.hzims.safeproduct.risk.service.impl; package com.hnac.hzims.safeproduct.risk.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
@ -16,18 +17,21 @@ import com.hnac.hzims.safeproduct.risk.service.HazardSourceService;
import com.hnac.hzims.safeproduct.risk.service.HazardWorkService; import com.hnac.hzims.safeproduct.risk.service.HazardWorkService;
import com.hnac.hzims.safeproduct.risk.vo.HazardWorkVO; import com.hnac.hzims.safeproduct.risk.vo.HazardWorkVO;
import com.hnac.hzims.safeproduct.risk.vo.PersonalCheckItemVO; import com.hnac.hzims.safeproduct.risk.vo.PersonalCheckItemVO;
import com.hnac.hzinfo.exception.HzServiceException;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springblade.core.log.exception.ServiceException; import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.mp.support.Condition; import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query; import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
import org.springblade.core.tool.api.ResultCode;
import org.springblade.core.tool.utils.BeanUtil; import org.springblade.core.tool.utils.BeanUtil;
import org.springblade.core.tool.utils.CollectionUtil; import org.springblade.core.tool.utils.CollectionUtil;
import org.springblade.system.user.cache.UserCache; import org.springblade.system.user.cache.UserCache;
import org.springblade.system.user.entity.User; import org.springblade.system.user.entity.User;
import org.springblade.system.user.feign.IUserClient; import org.springblade.system.user.feign.IUserClient;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@ -54,13 +58,22 @@ public class HazardWorkServiceImpl extends ServiceImpl<HazardWorkMapper, HazardW
* @return * @return
*/ */
@Override @Override
@Transactional(rollbackFor = Exception.class)
public boolean deleteBacth(List<Long> workIds) { public boolean deleteBacth(List<Long> workIds) {
if(CollectionUtil.isEmpty(workIds)){ if(CollectionUtil.isEmpty(workIds)){
throw new ServiceException("请勾选作业区域,再进行删除!"); throw new HzServiceException(ResultCode.FAILURE, "请勾选作业区域,再进行删除!");
} }
// 删除作业区域记录 && 关联危险源记录 // 删除作业区域记录 && 关联危险源记录
return super.removeByIds(workIds) && boolean remove = super.removeByIds(workIds);
correlationService.remove(Wrappers.<Correlation>lambdaQuery().in(Correlation::getWorkId,workIds)); if (!remove) {
throw new HzServiceException(ResultCode.FAILURE, "作业区域记录删除失败");
}
List<Correlation> correlationList = correlationService.list(Wrappers.<Correlation>lambdaQuery().in(Correlation::getWorkId, workIds));
if (CollectionUtil.isNotEmpty(correlationList)) {
List<Long> collectIds = correlationList.stream().map(Correlation::getId).collect(Collectors.toList());
return correlationService.removeByIds(collectIds);
}
return true;
} }
/** /**

Loading…
Cancel
Save