bug修改

This commit is contained in:
2025-09-16 16:23:49 +08:00
parent e42e81ab06
commit c07e9f76a6
10 changed files with 78 additions and 40 deletions

View File

@ -7,6 +7,7 @@ import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import lombok.RequiredArgsConstructor;
import jakarta.servlet.http.HttpServletResponse;
@ -181,19 +182,19 @@ public class BusMrpBaseController extends BaseController {
@GetMapping("/coryEngineeringList")
public R<List<BusBillofquantities>> obtainTheList(CoryObtainTheListReq req) {
// public R<List<ObtainTheListRes>> obtainTheList(CoryObtainTheListReq req) {
BusBillofquantitiesVersions one = busBillofquantitiesVersionsService.getOne(Wrappers.<BusBillofquantitiesVersions>lambdaQuery()
.eq(BusBillofquantitiesVersions::getWorkOrderType, "3") //物资工程量清单
.eq(BusBillofquantitiesVersions::getProjectId, req.getProjectId())
.eq(BusBillofquantitiesVersions::getVersions, req.getVersions())
.eq(BusBillofquantitiesVersions::getStatus, BusinessStatusEnum.FINISH.getStatus())
.last("limit 1")
);
if (one == null){
throw new ServiceException("请先完成物资工程量清单");
}
List<BusBillofquantities> list = busBillofquantitiesService.list(Wrappers.<BusBillofquantities>lambdaQuery()
.eq(BusBillofquantities::getVersions, one.getVersions())
);
// BusBillofquantitiesVersions one = busBillofquantitiesVersionsService.getOne(Wrappers.<BusBillofquantitiesVersions>lambdaQuery()
// .eq(BusBillofquantitiesVersions::getWorkOrderType, "3") //物资工程量清单
// .eq(BusBillofquantitiesVersions::getProjectId, req.getProjectId())
// .eq(BusBillofquantitiesVersions::getVersions, req.getVersions())
// .eq(BusBillofquantitiesVersions::getStatus, BusinessStatusEnum.FINISH.getStatus())
// .last("limit 1")
// );
// if (one == null){
// throw new ServiceException("请先完成物资工程量清单");
// }
// List<BusBillofquantities> list = busBillofquantitiesService.list(Wrappers.<BusBillofquantities>lambdaQuery()
// .eq(BusBillofquantities::getVersions, one.getVersions())
// );
// List<ObtainTheListRes> obtainTheListRes = new ArrayList<>();
// list.forEach(billofquantities -> {
// ObtainTheListRes res = new ObtainTheListRes();
@ -207,7 +208,8 @@ public class BusMrpBaseController extends BaseController {
// // 3. 递归组装树形结构从顶级节点pid=0开始
// List<ObtainTheListRes> treeList = buildTree("0", parentMap);
// return R.ok(treeList);
return R.ok(list);
// return R.ok(list);
return R.ok(busBillofquantitiesService.getBaseMapper().selectList(new LambdaQueryWrapper<BusBillofquantities>().eq(BusBillofquantities::getPid, req.getSid())));
}
private List<ObtainTheListRes> buildTree(String parentId, Map<String, List<ObtainTheListRes>> parentMap) {

View File

@ -14,10 +14,7 @@ import org.dromara.design.domain.bo.ImportExcelFileReq;
import org.dromara.design.domain.bo.ObtainAllVersionNumbersReq;
import org.dromara.design.domain.bo.CoryObtainTheListReq;
import org.dromara.design.domain.bo.SheetListReq;
import org.dromara.design.domain.vo.BusBillofquantitiesMaterialTotalVo;
import org.dromara.design.domain.vo.BusBillofquantitiesVersionsVo;
import org.dromara.design.domain.vo.DetailsMaterialAndEquipmentApprovalRes;
import org.dromara.design.domain.vo.ObtainTheListRes;
import org.dromara.design.domain.vo.*;
import org.dromara.design.service.IBusBillofquantitiesVersionsService;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
@ -97,6 +94,16 @@ public class BusBillofquantitiesVersionsController extends BaseController {
}
/**
* 获取所有大类
*/
@SaCheckPermission("design:billofquantitiesVersions:obtainAllClassification")
@GetMapping("/obtainAllClassification")
public R<List<BusBillofquantitiesVo>> obtainAllClassification(ObtainAllVersionNumbersReq bo) {
return R.ok(busBillofquantitiesVersionsService.obtainAllClassification(bo));
}
// /**
// * 导入物资设备清单
// */

View File

@ -40,4 +40,6 @@ public class CoryObtainTheListReq implements Serializable {
@NotNull(message = "项目ID不能为空")
private Long projectId;
private String sid;
}

View File

@ -47,10 +47,14 @@ public class BusBillofquantitiesVo implements Serializable {
private String sheet;
/**
* 子ID
* 子ID
*/
@ExcelProperty(value = "父子ID")
private Long pid;
private String sid;
/**
* 父ID
*/
private String pid;
/**
* 编号

View File

@ -3,12 +3,10 @@ package org.dromara.design.service;
import com.baomidou.mybatisplus.extension.service.IService;
import org.dromara.common.mybatis.core.page.PageQuery;
import org.dromara.common.mybatis.core.page.TableDataInfo;
import org.dromara.design.domain.BusBillofquantities;
import org.dromara.design.domain.BusBillofquantitiesVersions;
import org.dromara.design.domain.bo.*;
import org.dromara.design.domain.vo.BusBillofquantitiesMaterialTotalVo;
import org.dromara.design.domain.vo.BusBillofquantitiesVersionsVo;
import org.dromara.design.domain.vo.DetailsMaterialAndEquipmentApprovalRes;
import org.dromara.design.domain.vo.ObtainTheListRes;
import org.dromara.design.domain.vo.*;
import org.springframework.web.multipart.MultipartFile;
import java.util.Collection;
@ -100,4 +98,6 @@ public interface IBusBillofquantitiesVersionsService extends IService<BusBillofq
* @param projectId 项目id
*/
List<BusBillofquantitiesMaterialTotalVo> queryMaterialTotalListByProject(Long projectId);
List<BusBillofquantitiesVo> obtainAllClassification(ObtainAllVersionNumbersReq bo);
}

View File

@ -2,6 +2,7 @@ package org.dromara.design.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import com.alibaba.fastjson2.util.BeanUtils;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@ -32,10 +33,7 @@ import org.dromara.design.domain.BusBillofquantities;
import org.dromara.design.domain.BusBillofquantitiesVersions;
import org.dromara.design.domain.bo.*;
import org.dromara.design.domain.dto.MaterialsAndEquipmentExcelDto;
import org.dromara.design.domain.vo.BusBillofquantitiesMaterialTotalVo;
import org.dromara.design.domain.vo.BusBillofquantitiesVersionsVo;
import org.dromara.design.domain.vo.DetailsMaterialAndEquipmentApprovalRes;
import org.dromara.design.domain.vo.ObtainTheListRes;
import org.dromara.design.domain.vo.*;
import org.dromara.design.mapper.BusBillofquantitiesVersionsMapper;
import org.dromara.design.service.IBusBillofquantitiesService;
import org.dromara.design.service.IBusBillofquantitiesVersionsService;
@ -192,17 +190,10 @@ public class BusBillofquantitiesVersionsServiceImpl extends ServiceImpl<BusBillo
}
String banBen = BatchNumberGenerator.generateBatchNumber("GCLBB-");
String[] split = StringUtils.split(wordEntity.getFileName(),".xlsx");
String vName = "";
switch (bo.getWorkOrderType()){
case "0":
vName = "投标工程量清单-"+split[0];
case "1":
vName = "限价工程量清单-"+split[0];
case "2":
vName = "招采工程量清单-"+split[0];
case "3":
vName = "物资设备清单-"+split[0];
String vName = split[0];
Long count = baseMapper.selectCount(new LambdaQueryWrapper<BusBillofquantitiesVersions>().eq(BusBillofquantitiesVersions::getVersionsName, vName));
if (count > 0){
throw new ServiceException("文件名已存在,请修改文件名后重新上传!!");
}
int insert = baseMapper.insert(new BusBillofquantitiesVersions().
setWorkOrderType(bo.getWorkOrderType()).
@ -342,6 +333,22 @@ public class BusBillofquantitiesVersionsServiceImpl extends ServiceImpl<BusBillo
return list;
}
@Override
public List<BusBillofquantitiesVo> obtainAllClassification(ObtainAllVersionNumbersReq bo) {
LambdaQueryWrapper<BusBillofquantitiesVersions> lqw = Wrappers.lambdaQuery();
lqw.eq(bo.getProjectId() != null, BusBillofquantitiesVersions::getProjectId, bo.getProjectId());
lqw.eq(StringUtils.isNotBlank(bo.getWorkOrderType()), BusBillofquantitiesVersions::getWorkOrderType, bo.getWorkOrderType());
List<BusBillofquantitiesVersionsVo> result = baseMapper.selectVoList(lqw);
List<String> versionss = new ArrayList<>();
result.forEach(v -> versionss.add(v.getVersions()));
List<BusBillofquantities> busBillofquantities = busBillofquantitiesService.getBaseMapper().selectList(new LambdaQueryWrapper<BusBillofquantities>()
.eq(BusBillofquantities::getProjectId, bo.getProjectId())
.eq(BusBillofquantities::getPid, "0")
.in(BusBillofquantities::getVersions, versionss)
.groupBy(BusBillofquantities::getName));
return BeanUtil.copyToList(busBillofquantities,BusBillofquantitiesVo.class);
}
/**
* 递归构建树形结构
*

View File

@ -136,5 +136,10 @@ public class BusMechanicalrewriting extends BaseEntity {
*/
private String remark;
/**
* 工区
*/
private String workArea;
}

View File

@ -145,5 +145,10 @@ public class BusMechanicalrewritingBo extends BaseEntity {
*/
private String remark;
/**
* 工区
*/
private String workArea;
}

View File

@ -161,5 +161,10 @@ public class BusMechanicalrewritingVo implements Serializable {
@ExcelProperty(value = "备注")
private String remark;
/**
* 工区
*/
private String workArea;
}

View File

@ -78,6 +78,7 @@ public class BusMechanicalrewritingServiceImpl extends ServiceImpl<BusMechanical
LambdaQueryWrapper<BusMechanicalrewriting> lqw = Wrappers.lambdaQuery();
lqw.orderByDesc(BusMechanicalrewriting::getId);
lqw.eq(bo.getProjectId() != null, BusMechanicalrewriting::getProjectId, bo.getProjectId());
lqw.like(StringUtils.isNotBlank(bo.getWorkArea()),BusMechanicalrewriting::getWorkArea, bo.getWorkArea());
lqw.like(StringUtils.isNotBlank(bo.getTeamName()), BusMechanicalrewriting::getTeamName, bo.getTeamName());
lqw.like(StringUtils.isNotBlank(bo.getDevicename()), BusMechanicalrewriting::getDevicename, bo.getDevicename());
lqw.eq(StringUtils.isNotBlank(bo.getDeviceType()), BusMechanicalrewriting::getDeviceType, bo.getDeviceType());