|
@@ -12,16 +12,18 @@ import com.ruoyi.common.helper.LoginHelper;
|
|
|
import com.ruoyi.common.utils.StringUtils;
|
|
|
import com.ruoyi.framework.handler.MonthTableNameHandler;
|
|
|
import com.ruoyi.system.service.ISysUserService;
|
|
|
-import com.ruoyi.zdsz.domain.ZEngiineeringPhoto;
|
|
|
-import com.ruoyi.zdsz.domain.ZEngineeringInfo;
|
|
|
-import com.ruoyi.zdsz.domain.ZMaterialStatistics;
|
|
|
+import com.ruoyi.zdsz.domain.*;
|
|
|
import com.ruoyi.zdsz.domain.bo.ZEngineeringInfoBo;
|
|
|
import com.ruoyi.zdsz.domain.bo.ZEngineeringMaterialBo;
|
|
|
import com.ruoyi.zdsz.domain.bo.ZEngineeringNodeBo;
|
|
|
import com.ruoyi.zdsz.domain.bo.ZEngineeringReviewBo;
|
|
|
+import com.ruoyi.zdsz.domain.vo.ZEngineeringCivilVo;
|
|
|
import com.ruoyi.zdsz.domain.vo.ZEngineeringInfoVo;
|
|
|
import com.ruoyi.zdsz.enums.photoType;
|
|
|
import com.ruoyi.zdsz.mapper.ZEngineeringInfoMapper;
|
|
|
+import com.ruoyi.zdsz.mapper.ZEngineeringMaterialMapper;
|
|
|
+import com.ruoyi.zdsz.mapper.ZEngineeringNodeMapper;
|
|
|
+import com.ruoyi.zdsz.mapper.ZMaterialStatisticsMapper;
|
|
|
import com.ruoyi.zdsz.service.*;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
@@ -56,7 +58,12 @@ public class ZEngineeringInfoServiceImpl implements IZEngineeringInfoService {
|
|
|
private ISysUserService sysUserService;
|
|
|
@Resource
|
|
|
private IZEngineeringReviewService izEngineeringReviewService;
|
|
|
-
|
|
|
+ @Resource
|
|
|
+ private ZEngineeringNodeMapper zEngineeringNodeMapper;
|
|
|
+@Resource
|
|
|
+private ZEngineeringMaterialMapper zEngineeringMaterialMapper;
|
|
|
+ @Resource
|
|
|
+ private final ZMaterialStatisticsMapper zMaterialStatisticsMapper;
|
|
|
|
|
|
/**
|
|
|
* 查询工程详情
|
|
@@ -583,41 +590,30 @@ public class ZEngineeringInfoServiceImpl implements IZEngineeringInfoService {
|
|
|
@DynamicName(spel = "#bo.createTime")
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public Boolean deleteById(ZEngineeringInfoBo bo) {
|
|
|
-
|
|
|
- izEngineeringCivilService.queryById(zEngineeringInfo.getEngInfoId());
|
|
|
-
|
|
|
+ ZEngineeringInfo zEngineeringInfo2= baseMapper.selectById(bo.getId());
|
|
|
+ ZEngineeringNode zEngineeringNode=zEngineeringNodeMapper.selectById(zEngineeringInfo2.getEngInfoId());
|
|
|
+ ZEngineeringCivilVo zEngineeringCivil= izEngineeringCivilService.queryById(zEngineeringNode.getCivliId());
|
|
|
+ LambdaQueryWrapper<ZEngineeringMaterial> lqw3 = Wrappers.lambdaQuery();
|
|
|
+ lqw3.eq(ZEngineeringMaterial::getDetailsId,zEngineeringInfo2.getId());
|
|
|
+ List<ZEngineeringMaterial> zEngineeringMaterialList= zEngineeringMaterialMapper.selectList(lqw3);
|
|
|
+ zEngineeringMaterialList.stream().forEach(item->{
|
|
|
LambdaQueryWrapper<ZMaterialStatistics> lqwstatis = Wrappers.lambdaQuery();
|
|
|
- lqwstatis.eq(StringUtils.isNotBlank(bo.getAreaId()), ZMaterialStatistics::getAreaId, bo.getAreaId());
|
|
|
- lqwstatis.eq(StringUtils.isNotBlank(bo.getBuildingId()), ZMaterialStatistics::getBuildingId, bo.getBuildingId());
|
|
|
- lqwstatis.eq(StringUtils.isNotBlank(bo.getUnitId()), ZMaterialStatistics::getUnitId, bo.getUnitId());
|
|
|
- lqwstatis.eq(StringUtils.isNotBlank(bo.getHouseId()), ZMaterialStatistics::getHouseId, bo.getHouseId());
|
|
|
+ lqwstatis.eq(StringUtils.isNotBlank(zEngineeringCivil.getAreaId()), ZMaterialStatistics::getAreaId, zEngineeringCivil.getAreaId());
|
|
|
+ lqwstatis.eq(StringUtils.isNotBlank(zEngineeringCivil.getBuildingId()), ZMaterialStatistics::getBuildingId, zEngineeringCivil.getBuildingId());
|
|
|
+ lqwstatis.eq(StringUtils.isNotBlank(zEngineeringCivil.getUnitId()), ZMaterialStatistics::getUnitId, zEngineeringCivil.getUnitId());
|
|
|
+ lqwstatis.eq(StringUtils.isNotBlank(zEngineeringCivil.getHouseId()), ZMaterialStatistics::getHouseId, zEngineeringCivil.getHouseId());
|
|
|
lqwstatis.eq(StringUtils.isNotBlank(item.getMaterialQuality()), ZMaterialStatistics::getRealityQuality, item.getMaterialQuality());
|
|
|
lqwstatis.eq(StringUtils.isNotBlank(item.getSpecifications()), ZMaterialStatistics::getRealitySpecifications, item.getSpecifications());
|
|
|
- lqwstatis.eq(StringUtils.isNotBlank(bo.getEnginCycle()), ZMaterialStatistics::getEnginCycle, bo.getEnginCycle());
|
|
|
- lqwstatis.eq(StringUtils.isNotBlank(bo.getEnginClassification()), ZMaterialStatistics::getEnginClassification, bo.getEnginClassification());
|
|
|
- lqwstatis.eq(StringUtils.isNotBlank(bo.getEnginType()), ZMaterialStatistics::getEnginType, bo.getEnginType());
|
|
|
- lqwstatis.eq(StringUtils.isNotBlank(item2.getType()), ZMaterialStatistics::getNodeType, item2.getType());
|
|
|
- ZMaterialStatistics zMaterialStatistics = baseMapper.selectOne(lqwstatis);
|
|
|
+ lqwstatis.eq(StringUtils.isNotBlank(zEngineeringCivil.getEnginCycle()), ZMaterialStatistics::getEnginCycle, zEngineeringCivil.getEnginCycle());
|
|
|
+ lqwstatis.eq(StringUtils.isNotBlank(zEngineeringCivil.getEnginClassification()), ZMaterialStatistics::getEnginClassification, zEngineeringCivil.getEnginClassification());
|
|
|
+ lqwstatis.eq(StringUtils.isNotBlank(zEngineeringCivil.getEnginType()), ZMaterialStatistics::getEnginType, zEngineeringCivil.getEnginType());
|
|
|
+ //lqwstatis.eq(StringUtils.isNotBlank(zEngineeringNode.getType()), ZMaterialStatistics::getNodeType, zEngineeringNode.getType());
|
|
|
+ ZMaterialStatistics zMaterialStatistics = zMaterialStatisticsMapper.selectOne(lqwstatis);
|
|
|
if (!ObjectUtils.isEmpty(zMaterialStatistics)) {
|
|
|
- zMaterialStatistics.setRealitySize(BigDecimal.valueOf(zMaterialStatistics.getRealitySize()).add(BigDecimal.valueOf(item.getNumber())).doubleValue());
|
|
|
- baseMapper.updateById(zMaterialStatistics);
|
|
|
- } else {
|
|
|
- if (!ObjectUtils.isEmpty(item.getMaterialQuality()) && !ObjectUtils.isEmpty(item.getSpecifications())) {
|
|
|
- ZMaterialStatistics zMaterialStatistics1 = new ZMaterialStatistics();
|
|
|
- BeanUtils.copyProperties(bo, zMaterialStatistics1);
|
|
|
- zMaterialStatistics1.setRealityQuality(item.getMaterialQuality());
|
|
|
- zMaterialStatistics1.setRealitySpecifications(item.getSpecifications());
|
|
|
- zMaterialStatistics1.setRealitySize(item.getNumber());
|
|
|
- zMaterialStatistics1.setEnginCycle(bo.getEnginCycle());
|
|
|
- zMaterialStatistics1.setNodeType(item2.getType());
|
|
|
- baseMapper.insert(zMaterialStatistics1);
|
|
|
- }
|
|
|
+ zMaterialStatistics.setRealitySize(BigDecimal.valueOf(zMaterialStatistics.getRealitySize()).subtract(BigDecimal.valueOf(item.getNumber())).doubleValue());
|
|
|
+ zMaterialStatisticsMapper.updateById(zMaterialStatistics);
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+ });
|
|
|
LambdaQueryWrapper<ZEngineeringInfo> lqw = Wrappers.lambdaQuery();
|
|
|
lqw.eq(StringUtils.isNotBlank(bo.getId()), ZEngineeringInfo::getId, bo.getId());
|
|
|
ZEngineeringInfo zEngineeringInfo = baseMapper.selectOne(lqw);
|