|
@@ -14,6 +14,7 @@ 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.bo.ZEngineeringInfoBo;
|
|
|
import com.ruoyi.zdsz.domain.bo.ZEngineeringMaterialBo;
|
|
|
import com.ruoyi.zdsz.domain.bo.ZEngineeringNodeBo;
|
|
@@ -21,17 +22,16 @@ import com.ruoyi.zdsz.domain.bo.ZEngineeringReviewBo;
|
|
|
import com.ruoyi.zdsz.domain.vo.ZEngineeringInfoVo;
|
|
|
import com.ruoyi.zdsz.enums.photoType;
|
|
|
import com.ruoyi.zdsz.mapper.ZEngineeringInfoMapper;
|
|
|
-import com.ruoyi.zdsz.service.IZEngiineeringPhotoService;
|
|
|
-import com.ruoyi.zdsz.service.IZEngineeringInfoService;
|
|
|
-import com.ruoyi.zdsz.service.IZEngineeringMaterialService;
|
|
|
-import com.ruoyi.zdsz.service.IZEngineeringReviewService;
|
|
|
+import com.ruoyi.zdsz.service.*;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
+import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.scheduling.annotation.Async;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.util.ObjectUtils;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
+import java.math.BigDecimal;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.util.*;
|
|
|
|
|
@@ -47,6 +47,8 @@ public class ZEngineeringInfoServiceImpl implements IZEngineeringInfoService {
|
|
|
|
|
|
private final ZEngineeringInfoMapper baseMapper;
|
|
|
@Resource
|
|
|
+ private IZEngineeringCivilService izEngineeringCivilService;
|
|
|
+ @Resource
|
|
|
private IZEngineeringMaterialService izEngineeringMaterialService;
|
|
|
@Resource
|
|
|
private IZEngiineeringPhotoService izEngiineeringPhotoService;
|
|
@@ -581,18 +583,53 @@ public class ZEngineeringInfoServiceImpl implements IZEngineeringInfoService {
|
|
|
@DynamicName(spel = "#bo.createTime")
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public Boolean deleteById(ZEngineeringInfoBo bo) {
|
|
|
+
|
|
|
+ izEngineeringCivilService.queryById(zEngineeringInfo.getEngInfoId());
|
|
|
+
|
|
|
+ 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(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);
|
|
|
+ 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);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
LambdaQueryWrapper<ZEngineeringInfo> lqw = Wrappers.lambdaQuery();
|
|
|
lqw.eq(StringUtils.isNotBlank(bo.getId()), ZEngineeringInfo::getId, bo.getId());
|
|
|
ZEngineeringInfo zEngineeringInfo = baseMapper.selectOne(lqw);
|
|
|
SimpleDateFormat simpleDateFormat=new SimpleDateFormat("yyyy_MM");
|
|
|
- ZEngineeringInfoBo zEngineeringInfobo =new ZEngineeringInfoBo();
|
|
|
- zEngineeringInfobo= BeanUtil.toBean(zEngineeringInfo, ZEngineeringInfoBo.class);
|
|
|
- //zEngineeringInfobo.setCreateTime(bo.getCreateTime());
|
|
|
- izEngiineeringPhotoService.delete(zEngineeringInfobo);
|
|
|
- izEngineeringMaterialService.delete(zEngineeringInfobo);
|
|
|
+ ZEngineeringInfoBo zEngineeringInfobo = new ZEngineeringInfoBo();
|
|
|
+ zEngineeringInfobo = BeanUtil.toBean(zEngineeringInfo, ZEngineeringInfoBo.class);
|
|
|
+ izEngiineeringPhotoService.delete(zEngineeringInfobo);
|
|
|
+ izEngineeringMaterialService.delete(zEngineeringInfobo);
|
|
|
+
|
|
|
+ MonthTableNameHandler.setData(simpleDateFormat.format(bo.getCreateTime()));
|
|
|
+ baseMapper.deleteById(bo.getId());
|
|
|
|
|
|
- MonthTableNameHandler.setData(simpleDateFormat.format(bo.getCreateTime()));
|
|
|
- baseMapper.deleteById(bo.getId());
|
|
|
LambdaQueryWrapper<ZEngineeringInfo> lqw2 = Wrappers.lambdaQuery();
|
|
|
lqw2.eq(StringUtils.isNotBlank(bo.getEngInfoId()), ZEngineeringInfo::getEngInfoId, bo.getEngInfoId());
|
|
|
List<ZEngineeringInfo> zEngineeringInfoList = baseMapper.selectList(lqw2);
|