|
@@ -10,8 +10,12 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
import com.ruoyi.zdsz.domain.ZEnginSpecifications;
|
|
import com.ruoyi.zdsz.domain.ZEnginSpecifications;
|
|
import com.ruoyi.zdsz.domain.ZEngineeringMaterialsResets;
|
|
import com.ruoyi.zdsz.domain.ZEngineeringMaterialsResets;
|
|
|
|
+import com.ruoyi.zdsz.domain.bo.ZEnginSpecificationsBo;
|
|
|
|
+import com.ruoyi.zdsz.domain.vo.ZEnginSpecificationsVo;
|
|
import com.ruoyi.zdsz.mapper.ZEnginSpecificationsMapper;
|
|
import com.ruoyi.zdsz.mapper.ZEnginSpecificationsMapper;
|
|
|
|
+import com.ruoyi.zdsz.service.IZEnginSpecificationsService;
|
|
import lombok.RequiredArgsConstructor;
|
|
import lombok.RequiredArgsConstructor;
|
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
import com.ruoyi.zdsz.domain.bo.ZEnginMaterialQualityBo;
|
|
import com.ruoyi.zdsz.domain.bo.ZEnginMaterialQualityBo;
|
|
import com.ruoyi.zdsz.domain.vo.ZEnginMaterialQualityVo;
|
|
import com.ruoyi.zdsz.domain.vo.ZEnginMaterialQualityVo;
|
|
@@ -41,7 +45,7 @@ public class ZEnginMaterialQualityServiceImpl implements IZEnginMaterialQualityS
|
|
* 查询工程材质
|
|
* 查询工程材质
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
- public ZEnginMaterialQualityVo queryById(String id){
|
|
|
|
|
|
+ public ZEnginMaterialQualityVo queryById(String id) {
|
|
return baseMapper.selectVoById(id);
|
|
return baseMapper.selectVoById(id);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -55,13 +59,30 @@ public class ZEnginMaterialQualityServiceImpl implements IZEnginMaterialQualityS
|
|
return TableDataInfo.build(result);
|
|
return TableDataInfo.build(result);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private IZEnginSpecificationsService service;
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 查询工程材质列表
|
|
* 查询工程材质列表
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
public List<ZEnginMaterialQualityVo> queryList(ZEnginMaterialQualityBo bo) {
|
|
public List<ZEnginMaterialQualityVo> queryList(ZEnginMaterialQualityBo bo) {
|
|
LambdaQueryWrapper<ZEnginMaterialQuality> lqw = buildQueryWrapper(bo);
|
|
LambdaQueryWrapper<ZEnginMaterialQuality> lqw = buildQueryWrapper(bo);
|
|
- return baseMapper.selectVoList(lqw);
|
|
|
|
|
|
+ List<ZEnginMaterialQualityVo> vos = baseMapper.selectVoList(lqw);
|
|
|
|
+ vos.forEach(item -> {
|
|
|
|
+ ZEnginSpecificationsBo zEnginSpecificationsBo = new ZEnginSpecificationsBo();
|
|
|
|
+ zEnginSpecificationsBo.setMaterId(item.getId());
|
|
|
|
+ List<ZEnginSpecificationsVo> zEnginSpecificationsVos = service.queryList(zEnginSpecificationsBo);
|
|
|
|
+ StringBuilder it = new StringBuilder();
|
|
|
|
+ for (int i = 0; i < zEnginSpecificationsVos.size(); i++) {
|
|
|
|
+ if (i == 0)
|
|
|
|
+ it = new StringBuilder(zEnginSpecificationsVos.get(i).getName());
|
|
|
|
+ else
|
|
|
|
+ it.append(",").append(zEnginSpecificationsVos.get(i).getName());
|
|
|
|
+ }
|
|
|
|
+ item.setSpecificationsName(it.toString());
|
|
|
|
+ });
|
|
|
|
+ return vos;
|
|
}
|
|
}
|
|
|
|
|
|
private LambdaQueryWrapper<ZEnginMaterialQuality> buildQueryWrapper(ZEnginMaterialQualityBo bo) {
|
|
private LambdaQueryWrapper<ZEnginMaterialQuality> buildQueryWrapper(ZEnginMaterialQualityBo bo) {
|
|
@@ -100,7 +121,7 @@ public class ZEnginMaterialQualityServiceImpl implements IZEnginMaterialQualityS
|
|
/**
|
|
/**
|
|
* 保存前的数据校验
|
|
* 保存前的数据校验
|
|
*/
|
|
*/
|
|
- private void validEntityBeforeSave(ZEnginMaterialQuality entity){
|
|
|
|
|
|
+ private void validEntityBeforeSave(ZEnginMaterialQuality entity) {
|
|
//TODO 做一些数据校验,如唯一约束
|
|
//TODO 做一些数据校验,如唯一约束
|
|
}
|
|
}
|
|
|
|
|
|
@@ -109,11 +130,11 @@ public class ZEnginMaterialQualityServiceImpl implements IZEnginMaterialQualityS
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
public Boolean deleteWithValidByIds(Collection<String> ids, Boolean isValid) {
|
|
public Boolean deleteWithValidByIds(Collection<String> ids, Boolean isValid) {
|
|
- if(isValid){
|
|
|
|
|
|
+ if (isValid) {
|
|
if (!ObjectUtil.isEmpty(ids)) {
|
|
if (!ObjectUtil.isEmpty(ids)) {
|
|
LambdaQueryWrapper<ZEnginSpecifications> lqw = Wrappers.lambdaQuery();
|
|
LambdaQueryWrapper<ZEnginSpecifications> lqw = Wrappers.lambdaQuery();
|
|
Long count = specificationsMapper.selectCount(lqw.in(ZEnginSpecifications::getMaterId, ids));
|
|
Long count = specificationsMapper.selectCount(lqw.in(ZEnginSpecifications::getMaterId, ids));
|
|
- if (count>0){
|
|
|
|
|
|
+ if (count > 0) {
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
}
|
|
}
|