yangys
2024-11-02 27eb2df01ab873bc7f1451ff5865ed66b2876159
smart-man-boot/src/main/java/com/qianwen/smartman/modules/smis/service/impl/WorkstationWcsServiceImpl.java
@@ -30,7 +30,6 @@
import com.qianwen.smartman.modules.smis.entity.WorkstationWcs;
import com.qianwen.smartman.modules.smis.entity.WorkstationWcsUsage;
import com.qianwen.smartman.modules.smis.mapper.WorkstationWcsMapper;
import com.qianwen.smartman.modules.smis.service.IDmpVariablesService;
import com.qianwen.smartman.modules.smis.service.IWorkstationOfMachineService;
import com.qianwen.smartman.modules.smis.service.IWorkstationService;
import com.qianwen.smartman.modules.smis.service.IWorkstationWcsService;
@@ -52,16 +51,16 @@
    @Autowired
    @Lazy
    private IWorkstationService workstationService;
    @Autowired
    @Lazy
    private IDmpVariablesService dmpVariablesService;
    //@Autowired
    //@Lazy
    //private IDmpVariablesService dmpVariablesService;
    @Autowired
    private IWorkstationDynamicCollectService dynamicCollectService;
    @Autowired
    @Lazy
    private IWorkstationWcsUsageService workstationWcsUsageService;
    private static final String SUFFIX = "_____0";
    /*
    @Transactional(rollbackFor = {Exception.class})
    public List<WorkstationWcsVO> updateBatch(List<WorkstationWcsSaveVO> workstationWcsSaveVOList) {
        List<WorkstationWcs> workstationWcsList = WorkstationWcsConvert.INSTANCE.convertVOToEntity(workstationWcsSaveVOList);
@@ -74,18 +73,7 @@
                 .eq(WorkstationWcs::getDataType, workstationWcs.getDataType())
                 .eq(WorkstationWcs::getDataItem, workstationWcs.getDataItem()))
                 .stream().map(WorkstationWcs::getId).collect(Collectors.toList());
           /*
            List<Long> ids = (List) list((Wrapper) ((LambdaQueryWrapper) ((LambdaQueryWrapper) Wrappers.lambdaQuery().eq(Func.isNotEmpty(workstationWcs.getWorkstationId()), (v0) -> {
                return v0.getWorkstationId();
            }, workstationWcs.getWorkstationId()).eq((v0) -> {
                return v0.getCollectSettingItem();
            }, workstationWcs.getCollectSettingItem())).eq((v0) -> {
                return v0.getDataType();
            }, workstationWcs.getDataType())).eq((v0) -> {
                return v0.getDataItem();
            }, workstationWcs.getDataItem())).stream().map((v0) -> {
                return v0.getId();
            }).collect(Collectors.toList());*/
            if (Func.isNotEmpty(ids)) {
                workstationWcsIdList.addAll(ids);
            } else {
@@ -122,7 +110,9 @@
        wrapperVO(convert);
        return convert;
    }
    */
    /*
    @Override 
    @Transactional(rollbackFor = {Exception.class})
    public List<WorkstationWcsVO> insert(List<WorkstationWcsSaveVO> workstationWcsSaveVOList) {
@@ -177,6 +167,7 @@
        //返回所有数据的VO列表
        return WorkstationWcsConvert.INSTANCE.convert(saveWorkstationWcsList);
    }
    */
    private void validWorkstationExistsWcs(final List<WorkstationWcsSaveVO> workstationWcsSaveVOList) {
        boolean exist = (workstationWcsSaveVOList.stream().filter(it -> {
@@ -190,7 +181,7 @@
        });
        Assert.isTrue(!exist, MessageUtils.message("workstation.wcs.usage.id.already.exists", new Object[0]), new Object[0]);
    }
    /*
    private List<DmpVariables> validDmpName(Long workstationId, List<WorkstationWcsSaveVO> workstationWcsSaveVOList) {
        WorkstationOfMachine one = this.workstationOfMachineService.getWorkstationOfMachineByWorkstationId(workstationId);
        
@@ -207,7 +198,7 @@
        List<String> collectItemDistinctList = collectItemList.stream().distinct().collect(Collectors.toList());
        Assert.isTrue(collectItemList.size() == collectItemDistinctList.size(), MessageUtils.message("workstationWcs.collectItem.already.exists", new Object[0]), new Object[0]);
        return dmpVariablesList;
    }
    }*/
    public void setCrc(WorkstationWcs workstationWcs) {
        byte[] bytes = workstationWcs.getDataItem().concat(SUFFIX).getBytes();