yangys
2025-11-21 e8ed1a91c77ab62a924f12acd55777f227bacd7e
smart-man-boot/src/main/java/com/qianwen/smartman/modules/smis/service/impl/WorkstationServiceImpl.java
@@ -152,6 +152,8 @@
    private WorkstationDatapointsService wsDpService;
    @Autowired
    private LicenseWrapper licenseWrapper;
    @Autowired
    private WorkstationDatapointsService dataPointService;
    
    private final String NAME = "默认工作台";
    private final Integer SORT = 1;
@@ -237,9 +239,12 @@
        }
        return workstationVO;
    }
    /**
     * 验证许可中配置的设备数量
     */
    void checkLicenseCount() {
       
       Wrapper<Workstation> wrapper = Wrappers.lambdaQuery(Workstation.class).eq(Workstation::getIsDeleted, 0);
       Long count = workstationMapper.selectCount(wrapper);
       
@@ -376,6 +381,9 @@
            this.workstationWcsService.deleteByWorkstationIdList(workstationIds);
            this.workstationOfMachineService.remove(Wrappers.<WorkstationOfMachine>lambdaQuery().in(WorkstationOfMachine::getWorkstationId, workstationIds));
            this.commonGroupOfItemService.remove(Wrappers.<CommonGroupOfItem>lambdaQuery().in(CommonGroupOfItem::getItemId, workstationIds));
            //20250324新增,删除工位对应的数据点位配置。
            dataPointService.removeByWorkstation(workstationIds);
            /*
            this.workstationOfMachineService.remove((Wrapper) Wrappers.lambdaQuery().in((v0) -> {
                return v0.getWorkstationId();
@@ -407,7 +415,7 @@
                return String.valueOf(item.getId());
            }).collect(Collectors.toList()));
        }
        List<WorkstationVO> workstationVOS = this.workstationMapper.listPage(workStationGroupIdList, workstationVOIPage, keyWord, groupId, CommonGroupConstant.ALL_WORKSTATION_ID, status == null ? CommonConstant.ENABLE : status, type, Integer.valueOf(LocalDate.now().getYear()));
        List<WorkstationVO> workstationVOS = this.workstationMapper.listPage(workStationGroupIdList, workstationVOIPage, keyWord, groupId, CommonGroupConstant.ALL_WORKSTATION_ID, status, type, LocalDate.now().getYear());
        workstationVOS.forEach(workstationVO -> {
            String calendarName = workstationVO.getCalendarName();
            if (Func.isBlank(calendarName)) {
@@ -524,6 +532,9 @@
    @Override 
    @Transactional(rollbackFor = {Exception.class})
    public Boolean deleteGroup(Long groupId) {
        commonGroupOfItemService.lambdaUpdate().set(CommonGroupOfItem::getGroupId,CommonGroupConstant.DEFAULT_GROUP_ID)
                .eq(CommonGroupOfItem::getGroupId, groupId).update();
        if (this.commonGroupOfItemService.count(Lambda.eq(CommonGroupOfItem::getGroupId, groupId)) > 0) {
            throw new ServiceException(MessageUtils.message("cps.common.group.production.line.delete.fail", new Object[0]));
        }
@@ -597,7 +608,7 @@
    @Override 
    public IPage<WorkstationRealTimeStatusVO> getRealTimeStatus(WorkstationRealTimeStatusDTO dto, Query query) {
        List<String> workStationGroupIdList = dto.getWorkStationGroupIdList();
        if (workStationGroupIdList.size() == 1) {
        if (workStationGroupIdList !=null && workStationGroupIdList.size() == 1) {
            List<String> workStationGroupIdByParentList = getCommonGroupIds(workStationGroupIdList, new ArrayList<>()).stream().map(item -> {
                return String.valueOf(item.getId());
            }).collect(Collectors.toList());
@@ -665,7 +676,7 @@
    @Override 
    public IPage<Workstation> listWorkStationOnShiftIndex(List<String> ids, LocalDate localDate, Query query, Integer shift, Integer type) {
        return ((WorkstationMapper) this.baseMapper).listWorkStationOnShiftIndex(Condition.getPage(query), Integer.valueOf(localDate.getYear()), DateUtil.formatDate(localDate), shift, type, ids);
        return this.baseMapper.listWorkStationOnShiftIndex(Condition.getPage(query), localDate.getYear(), DateUtil.formatDate(localDate), shift, type, ids);
    }
    @Override 
@@ -1190,6 +1201,7 @@
        
        return list.stream().filter(i -> {
            boolean filter = true;
            if (Func.isEmpty(i.getMachineId())) {
                filter = false;
            }