skyouc
2025-08-07 05b8ccfc9eeadddd65e95ea82479c224d1516b4c
zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/service/impl/LocDetlServiceImpl.java
@@ -26,6 +26,7 @@
import org.springframework.transaction.annotation.Transactional;
import java.util.*;
import java.util.stream.Collectors;
@Service("locDetlService")
public class LocDetlServiceImpl extends ServiceImpl<LocDetlMapper, LocDetl> implements LocDetlService {
@@ -104,7 +105,7 @@
    public List<LocDetl> queryStock(String matnr, String batch, List<FieldParam> param, List<FieldSortParam> sortParam) {
        List<Map<String, Object>> list = viewLocDetlMapper.queryStock(matnr, batch, param, sortParam, LocAreaTypeSts.LOC_AREA_TYPE_UTC.id);
        List<LocDetl> locDetlsSort = resortDetls(list);
        return locDetlsSort;
        return locDetlsSort.stream().sorted(Comparator.comparing(LocDetl::getCreateTime)).collect(Collectors.toList());
    }
    private List<LocDetl> resortDetls(List<Map<String, Object>> list) {
@@ -155,6 +156,7 @@
            for (Integer row : direction) {
                Loc one = locService.getOne(new LambdaQueryWrapper<Loc>()
                                .select(Loc::getId)
                        .eq(Loc::getRow1, row)
                        .eq(Loc::getBay1, loc.getBay1())
                        .eq(Loc::getLev1, loc.getLev1()));
@@ -212,18 +214,18 @@
    }
    @Override
    @Transactional(rollbackFor = Exception.class)
    public void removeLocDetl(Long locId) {
        List<LocDetl> locDetls = this.list(new LambdaQueryWrapper<LocDetl>().eq(LocDetl::getLocId, locId));
        for (LocDetl locDetl : locDetls) {
            boolean remove = locDetlFieldService.remove(new LambdaQueryWrapper<LocDetlField>().eq(LocDetlField::getDetlId, locDetl.getId()));
            if (!remove) {
                throw new CoolException("扩展字段删除失败");
            }
//            if (!remove) {
//                throw new CoolException("扩展字段删除失败");
//            }
            boolean result = this.removeById(locDetl.getId());
            if (!result) {
                throw new CoolException("明细删除失败");
            }
//            if (!result) {
//                throw new CoolException("明细删除失败");
//            }
        }
    }