wuyouming666
2024-04-15 65058e7227fcfc53e81d9bb87e0e2667879edd05
hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/uppattenusage/service/impl/GlassInfoServiceImpl.java
@@ -1,11 +1,17 @@
package com.mes.uppattenusage.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.mes.downworkstation.entity.DownWorkstation;
import com.mes.uppattenusage.entity.GlassInfo;
import com.mes.uppattenusage.mapper.GlassInfoMapper;
import com.mes.uppattenusage.service.GlassInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
/**
 * <p>
@@ -27,16 +33,31 @@
    @Override
    public int getGlassInfoCountByFlowCardId(String flowCardId) {
        return glassInfoMapper.getGlassInfoCountByFlowCardId(flowCardId);
        QueryWrapper<GlassInfo> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("flowcard_id", flowCardId);
        return baseMapper.selectCount(queryWrapper);
    }
    @Override
    public List<Map<String, Object>> getFlowCardId() {
        return baseMapper.selectMaps(new QueryWrapper<GlassInfo>().select("DISTINCT flowcard_id"));
    }
    @Override
    public GlassInfo selectGlassId(String id) {
        QueryWrapper<GlassInfo> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("id", id);
        return baseMapper.selectOne(queryWrapper);
    }
    @Override
    public void updateFlowCardIdAndCount(String flowCardId, int glassInfoCount, int workstationId) {
        int rowsAffected = glassInfoMapper.updateFlowCardIdAndCount(flowCardId, glassInfoCount, workstationId);
        if (rowsAffected > 0) {
            System.out.println("更新架子上流程卡 ID 和数量成功");
        } else {
            System.out.println("更新架子上流程卡 ID 和数量失败");
        }
    }
//    public void updateFlowCardIdAndCount(String flowCardId, int glassInfoCount, int workstationId) {
//        int rowsAffected = glassInfoMapper.updateFlowCardIdAndCount(flowCardId, glassInfoCount, workstationId);
//        if (rowsAffected > 0) {
//            System.out.println("更新架子上流程卡 ID 和数量成功");
//        } else {
//            System.out.println("更新架子上流程卡 ID 和数量失败");
//        }
//    }
}