| | |
| | | <artifactId>dynamic-datasource-spring-boot-starter</artifactId> |
| | | <version>3.5.2</version> |
| | | </dependency> |
| | | |
| | | |
| | | |
| | | |
| | | <dependency> |
| | | <groupId>com.github.yulichang</groupId> |
| | | <artifactId>mybatis-plus-join</artifactId> |
| | | <version>1.2.4</version> |
| | | </dependency> |
| | | |
| | | </dependencies> |
| | | |
| | | <properties> |
| | |
| | | package com.mes.downglassinfo.controller; |
| | | |
| | | |
| | | import com.mes.downglassinfo.entity.DownGlassInfo; |
| | | import com.mes.downglassinfo.service.DownGlassInfoService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author zhoush |
| | | * @since 2024-03-27 |
| | | */ |
| | | @Api(tags = "下料信息") |
| | | @RestController |
| | | @RequestMapping("/downGlassInfo") |
| | | public class DownGlassInfoController { |
| | | |
| | | @Autowired |
| | | private DownGlassInfoService downGlassInfoService; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | // Other endpoints can be added for CRUD operations |
| | | } |
| | | |
| | |
| | | private Double thickness; |
| | | |
| | | |
| | | private int Filmsid; |
| | | private String Filmsid; |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.mes.downglassinfo.entity.DownGlassInfo; |
| | | import org.apache.ibatis.annotations.Delete; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.Select; |
| | | import org.apache.ibatis.annotations.Update; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import java.util.List; |
| | |
| | | @Repository |
| | | public interface DownGlassInfoMapper extends BaseMapper<DownGlassInfo> { |
| | | |
| | | // 查询下片任务表中状态为1的下片信息 |
| | | List<DownGlassInfo> selectunloadingtaskstate(); |
| | | // @Select("SELECT MAX(sequence) FROM down_glass_info WHERE flow_card_id = #{flowCardId} LIMIT 1") |
| | | // Integer getMaxSequenceByFlowCardId(@Param("flowCardId") String flowCardId); |
| | | //// |
| | | // @Delete("delete from down_glass_task where flow_card_id = #{flowCardId}") |
| | | // void deletetask(@Param("flowCardId") String flowCardId); |
| | | |
| | | void updateTaskStateToZero(@Param("flowCardId") String flowCardId); |
| | | |
| | | Integer getMaxSequenceByFlowCardId(@Param("flowCardId") String flowCardId); |
| | | |
| | | void deletetask(@Param("flowCardId") String flowCardId); |
| | | } |
| | |
| | | package com.mes.downglassinfo.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.mes.downglassinfo.entity.DownGlassInfo; |
| | | import com.mes.downglassinfo.entity.DownGlassTask; |
| | | import org.apache.ibatis.annotations.Select; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface DownGlassTaskMapper extends BaseMapper<DownGlassTask> { |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.mes.downglassinfo.entity.DownGlassInfo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务类 |
| | | * </p> |
| | | * |
| | | * @author zhoush |
| | | * @since 2024-03-27 |
| | | */ |
| | | public interface DownGlassInfoService extends IService<DownGlassInfo> { |
| | | |
| | | |
| | | |
| | | |
| | | Integer getMaxSequenceByFlowCardId(String flowCardId); |
| | | void insertDownGlassInfo(DownGlassInfo downGlassInfo); |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.mes.downglassinfo.entity.DownGlassTask; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务类 |
| | |
| | | */ |
| | | public interface DownGlassTaskService extends IService<DownGlassTask> { |
| | | |
| | | List<DownGlassTask> getUnloadingTaskState(); |
| | | |
| | | void updateTaskStateToZero(String flowCardId); |
| | | void deleteTask(String flowCardId); |
| | | |
| | | DownGlassTask selectLastOutCacheInfo(String endCell); |
| | | Integer insertCacheTask(int id, String start, String end, String type, double width, double height, String filmsId, double thickness, String flowCardId); |
| | | } |
| | |
| | | package com.mes.downglassinfo.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.mes.downglassinfo.entity.DownGlassInfo; |
| | | import com.mes.downglassinfo.mapper.DownGlassInfoMapper; |
| | | import com.mes.downglassinfo.service.DownGlassInfoService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author zhoush |
| | | * @since 2024-03-27 |
| | | */ |
| | | @Service |
| | | public class DownGlassInfoServiceImpl extends ServiceImpl<DownGlassInfoMapper, DownGlassInfo> implements DownGlassInfoService { |
| | | |
| | | // 根据流程卡号查询最大序号 |
| | | @Override |
| | | public Integer getMaxSequenceByFlowCardId(String flowCardId) { |
| | | QueryWrapper<DownGlassInfo> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("flow_card_id", flowCardId); |
| | | queryWrapper.select("MAX(sequence)"); // 选择最大序号 |
| | | DownGlassInfo downGlassInfo = baseMapper.selectOne(queryWrapper); |
| | | if (downGlassInfo != null) { |
| | | return downGlassInfo.getSequence(); // 返回最大序号 |
| | | } |
| | | return 0; // 如果没有找到记录,返回0或者其他适当的值 |
| | | } |
| | | @Override |
| | | public void insertDownGlassInfo(DownGlassInfo downGlassInfo) { |
| | | baseMapper.insert(downGlassInfo); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | package com.mes.downglassinfo.service.impl; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | 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.downglassinfo.entity.DownGlassInfo; |
| | | import com.mes.downglassinfo.entity.DownGlassTask; |
| | | import com.mes.downglassinfo.mapper.DownGlassTaskMapper; |
| | | import com.mes.downglassinfo.service.DownGlassTaskService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @Service |
| | | public class DownGlassTaskServiceImpl extends ServiceImpl<DownGlassTaskMapper, DownGlassTask> implements DownGlassTaskService { |
| | | |
| | | |
| | | |
| | | @Override |
| | | public List<DownGlassTask> getUnloadingTaskState() { |
| | | QueryWrapper<DownGlassTask> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("task_stauts", 1); |
| | | return baseMapper.selectList(queryWrapper); |
| | | } |
| | | |
| | | @Override |
| | | public void updateTaskStateToZero(String flowCardId) { |
| | | UpdateWrapper<DownGlassTask> updateWrapper = new UpdateWrapper<>(); |
| | | updateWrapper.set("task_stauts", 0).eq("flow_card_id", flowCardId); |
| | | baseMapper.update(null, updateWrapper); |
| | | } |
| | | @Override |
| | | public void deleteTask(String flowCardId) { |
| | | LambdaQueryWrapper<DownGlassTask> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.eq(DownGlassTask::getFlowCardId, flowCardId); |
| | | |
| | | baseMapper.delete(queryWrapper); |
| | | } |
| | | @Override |
| | | public DownGlassTask selectLastOutCacheInfo(String endCell) { |
| | | QueryWrapper<DownGlassTask> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("task_type", "2") |
| | | .eq("task_status", "2") |
| | | .eq("end_cell", endCell) |
| | | .last("LIMIT 1"); |
| | | |
| | | return baseMapper.selectOne(queryWrapper); |
| | | } |
| | | @Override |
| | | public Integer insertCacheTask(int id, String start, String end, String type, double width, double height, String filmsId, double thickness, String flowCardId) { |
| | | DownGlassTask glassInfo = new DownGlassTask(); |
| | | glassInfo.setId(id); |
| | | glassInfo.setStartCell(start); |
| | | glassInfo.setEndCell(end); |
| | | glassInfo.setTaskType(type); |
| | | glassInfo.setWidth(width); |
| | | glassInfo.setHeight(height); |
| | | glassInfo.setFilmsid(filmsId); |
| | | glassInfo.setThickness(thickness); |
| | | glassInfo.setFlowCardId(flowCardId); |
| | | glassInfo.setTaskStauts(0); // 默认任务状态为0 |
| | | |
| | | int rows = baseMapper.insert(glassInfo); |
| | | return rows > 0 ? rows : null; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | package com.mes.downstorage.controller; |
| | | |
| | | import com.mes.downstorage.entity.DownStorageCageDetails; |
| | | import com.mes.downstorage.service.DownStorageCageDetailsService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * <p> |
| | | * 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author zhoush |
| | | * @since 2024-03-27 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/downStorageCageDetails") |
| | | @RequestMapping("/down-storage-cage-details") |
| | | public class DownStorageCageDetailsController { |
| | | |
| | | } |
| | | @Autowired |
| | | private DownStorageCageDetailsService downStorageCageDetailsService; |
| | | |
| | | @PostMapping("/add") |
| | | public String addDownStorageCageDetails(@RequestBody DownStorageCageDetails details) { |
| | | downStorageCageDetailsService.addDownStorageCageDetails(details); |
| | | return "Details added successfully"; |
| | | } |
| | | |
| | | // Other CRUD operations can be defined here |
| | | } |
| | |
| | | package com.mes.downstorage.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.mes.downglassinfo.entity.DownGlassTask; |
| | | import com.mes.downstorage.entity.DownStorageCageDetails; |
| | | import com.mes.uppattenusage.entity.GlassInfo; |
| | | import org.apache.ibatis.annotations.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @author zhoush |
| | | * @since 2024-03-27 |
| | | */ |
| | | @Mapper |
| | | public interface DownStorageCageDetailsMapper extends BaseMapper<DownStorageCageDetails> { |
| | | // |
| | | // @Select("select * from `glass_info` where id=#{id}") |
| | | // GlassInfo SelectGlassId(String id); |
| | | // 查询笼子内空闲 |
| | | @Select("select escd.* from down_storage_cage as esc LEFT JOIN down_storage_cage_details as escd on esc.slot=escd.slot where escd.slot is null order by escd.slot") |
| | | List<DownStorageCageDetails> SelectCacheLeisure(); |
| | | |
| | | // 查询笼子内出片任务 |
| | | @Select("select escd.* from down_storage_cage as esc LEFT JOIN down_storage_cage_details as escd on esc.slot=escd.slot WHERE escd.slot IS NOT NULL order by escd.tempering_layout_id,escd.tempering_feed_sequence") |
| | | List<DownStorageCageDetails> SelectCacheOut(); |
| | | |
| | | // 查询笼子内信息 |
| | | @Select("select escd.* from down_storage_cage as esc LEFT JOIN down_storage_cage_details as escd on esc.slot=escd.slot order by esc.slot") |
| | | List<DownStorageCageDetails> SelectCachInfo(); |
| | | |
| | | // 查询可进此片玻璃的栅格号 |
| | | @Select("select escd.* from down_storage_cage as esc LEFT JOIN down_storage_cage_details as escd on esc.slot=escd.slot where escd.slot is not null escd.tempering_layout_id=#{tempering_layout_id} and escd.tempering_feed_sequence<#{tempering_feed_sequence} and esc.remain_width-#{width}>0 order by escd.tempering_feed_sequence") |
| | | List<DownStorageCageDetails> SelectIsExistIntoCache(Integer tempering_layout_id, Integer tempering_feed_sequence, |
| | | double width); |
| | | |
| | | // 查询可进此片玻璃的栅格号 |
| | | @Select("select escd.* from down_storage_cage as esc LEFT JOIN down_storage_cage_details as escd on esc.slot=escd.slot where escd.slot is not null escd.tempering_layout_id<#{tempering_layout_id} and esc.remain_width-#{width}>0 order by escd.tempering_layout_id desc,escd.tempering_feed_sequence") |
| | | List<DownStorageCageDetails> SelectIsExistIntoCache(Integer tempering_layout_id, double width); |
| | | |
| | | // // 查询全部任务 |
| | | // @Select("select * from down_glass_task") |
| | | // List<DownGlassTask> SelectCacheInfoAll(); |
| | | // |
| | | // // 查询进片任务 |
| | | // @Select("select * from down_glass_task where task_type='1' and task_stauts='0'") |
| | | // List<DownGlassTask> SelectInputCacheInfo(); |
| | | // |
| | | // // 查询出片任务 |
| | | // @Select("select * from down_glass_task where task_type='2' and task_stauts='0'") |
| | | // List<DownGlassTask> SelectOutCacheInfo(); |
| | | |
| | | // 查询 A06 或 A11 最新的一片 出片任务 |
| | | @Select("select * from down_glass_task where task_type='2' and task_stauts='2' and end_cell=#{EndCell} limit 1") |
| | | GlassInfo SelectLastOutCacheInfo(String EndCell); |
| | | |
| | | // 修改笼子内信息 |
| | | // @Update("update") |
| | | // Integer UpdateCache(@Param("id") Integer id, @Param("order_id") String order_id); |
| | | |
| | | // 添加下片任务 |
| | | @Insert("INSERT into down_glass_task VALUES(#{id},#{start},#{end},#{type},0,)") |
| | | Integer insertCacheTask(String id, String start, String end, String type,double width,double height,Integer filmsId,double thickness,String flowCardId); |
| | | |
| | | |
| | | } |
| | |
| | | import com.mes.common.PLCAutoMes; |
| | | import com.mes.common.S7control; |
| | | import com.mes.device.PlcParameterObject; |
| | | |
| | | import com.mes.downstorage.entity.DownStorageCageDetails; |
| | | import com.mes.downstorage.mapper.SelectInfo; |
| | | import com.mes.downstorage.mapper.DownStorageCageDetailsMapper; |
| | | import com.mes.downworkstation.mapper.DownWorkstationMapper; |
| | | import com.mes.tools.WebSocketServer; |
| | | import com.mes.uppattenusage.entity.GlassInfo; |
| | | import com.mes.uppattenusage.service.GlassInfoService; |
| | | import lombok.Data; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | @Service |
| | | public class DownGlassCacheLogic { |
| | | @Autowired |
| | | private SelectInfo selectInfo; |
| | | private DownStorageCageDetailsMapper selectInfo; |
| | | private GlassInfoService GlassInfoService; |
| | | private DownStorageCageDetailsService downStorageCageDetailsService; |
| | | |
| | | /** |
| | | * @param Number |
| | |
| | | */ |
| | | |
| | | public boolean processInto(String Number){ |
| | | GlassInfoService = WebSocketServer.applicationContext.getBean(GlassInfoService.class); |
| | | //按id查询玻璃信息表里的玻璃 |
| | | GlassInfo GlassInfo=selectInfo.SelectGlassId(Number); |
| | | GlassInfo GlassInfo=GlassInfoService.selectGlassId(Number); |
| | | PlcParameterObject plcmes=PLCAutoMes.PlcMesObject; |
| | | //存在此玻璃编号 |
| | | if(GlassInfo!=null){ |
| | |
| | | GlassInfo glassInfo06= selectInfo.SelectLastOutCacheInfo("06"); |
| | | GlassInfo glassInfo11= selectInfo.SelectLastOutCacheInfo("11"); |
| | | GlassInfo glassInfo13= selectInfo.SelectLastOutCacheInfo("13"); |
| | | if(glassInfo06!=null&&glassInfo11.getWidth()==item.getWidth()&&glassInfo06.getHeight()==item.getHeight()){ |
| | | if(glassInfo06!=null&& glassInfo11.getWidth().equals(item.getWidth()) && glassInfo06.getHeight().equals(item.getHeight())){ |
| | | endcell="11"; |
| | | SendEndcell="2"; |
| | | }else if(item.getHeight()>=3440&&item.getWidth()>=1440){ |
| | |
| | | //返回结果 |
| | | return false; |
| | | } |
| | | //查询是否绑定架子 |
| | | // public boolean selectFlowCardId(String FlowCardId){ |
| | | // |
| | | // } |
| | | |
| | | /** |
| | | * @param Number |
| | |
| | | |
| | | public void processMb(String Number){ |
| | | //按id查询玻璃信息表里的玻璃 |
| | | GlassInfo GlassInfo=selectInfo.SelectGlassId(Number); |
| | | GlassInfo GlassInfo=GlassInfoService.selectGlassId(Number); |
| | | PlcParameterObject plcmes=PLCAutoMes.PlcMesObject; |
| | | if(GlassInfo!=null){ |
| | | //发送任务 ID 长 宽 厚 倒角 工艺功能等 |
| | |
| | | public boolean selectMessageId(String Number){ |
| | | //查询是否存在 |
| | | |
| | | GlassInfo GlassInfo=selectInfo.SelectGlassId(Number); |
| | | GlassInfo GlassInfo=GlassInfoService.selectGlassId(Number); |
| | | if(GlassInfo==null){ |
| | | //返回 不存在 |
| | | return false; |
| | |
| | | |
| | | public boolean deleteMessageId(String Number){ |
| | | //查询是否存在 |
| | | GlassInfo GlassInfo=selectInfo.SelectGlassId(Number); |
| | | GlassInfo GlassInfo=GlassInfoService.selectGlassId(Number); |
| | | if(GlassInfo==null){ |
| | | //返回 不存在 |
| | | return false; |
| | |
| | | */ |
| | | public boolean isExist(String Number){ |
| | | //查询是否存在 |
| | | GlassInfo GlassInfo=selectInfo.SelectGlassId(Number); |
| | | GlassInfo GlassInfo=GlassInfoService.selectGlassId(Number); |
| | | if(GlassInfo==null){ |
| | | //返回 不存在 |
| | | return false; |
| | |
| | | package com.mes.downstorage.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.mes.downstorage.entity.DownStorageCageDetails; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务类 |
| | | * </p> |
| | | * |
| | | * @author zhoush |
| | | * @since 2024-03-27 |
| | | */ |
| | | public interface DownStorageCageDetailsService extends IService<DownStorageCageDetails> { |
| | | public interface DownStorageCageDetailsService { |
| | | |
| | | void addDownStorageCageDetails(DownStorageCageDetails details); |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.mes.downstorage.entity.DownStorageCage; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务类 |
| | |
| | | * @since 2024-03-27 |
| | | */ |
| | | public interface DownStorageCageService extends IService<DownStorageCage> { |
| | | |
| | | public List<Map> gettask(); |
| | | } |
| | |
| | | package com.mes.downstorage.service.impl; |
| | | |
| | | import com.mes.downstorage.entity.DownStorageCageDetails; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.mes.downstorage.entity.DownStorageCageDetails; |
| | | import com.mes.downstorage.mapper.DownStorageCageDetailsMapper; |
| | | import com.mes.downstorage.service.DownStorageCageDetailsService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author zhoush |
| | | * @since 2024-03-27 |
| | | */ |
| | | @Service |
| | | public class DownStorageCageDetailsServiceImpl extends ServiceImpl<DownStorageCageDetailsMapper, DownStorageCageDetails> implements DownStorageCageDetailsService { |
| | | |
| | | @Override |
| | | public void addDownStorageCageDetails(DownStorageCageDetails details) { |
| | | this.save(details); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | // Other business methods can be implemented here |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.mes.downstorage.mapper.DownStorageCageMapper; |
| | | import com.mes.downstorage.service.DownStorageCageService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | @Service |
| | | public class DownStorageCageServiceImpl extends ServiceImpl<DownStorageCageMapper, DownStorageCage> implements DownStorageCageService { |
| | | |
| | | @Autowired |
| | | private DownStorageCageMapper downStorageCageMapper; |
| | | @Override |
| | | public List<Map> gettask(){ |
| | | downStorageCageMapper.selectList(null); |
| | | // downStorageCageMapper.selectJoin(); |
| | | return null; |
| | | }; |
| | | } |
| | |
| | | @GetMapping("/getone") |
| | | public ResponseEntity<?> getOneDownWorkstations() { |
| | | try { |
| | | List<DownWorkstation> data = downWorkstationService.getoneDownWorkstations(); |
| | | List<DownWorkstation> data = downWorkstationService.getoneDownWorkstations(1,5); |
| | | // 构建符合预期格式的响应数据 |
| | | Map<String, Object> responseData = new HashMap<>(); |
| | | responseData.put("code", 200); |
| | |
| | | |
| | | @GetMapping("/gettwo") |
| | | public List<DownWorkstation> gettwoDownWorkstations() { |
| | | return downWorkstationService.gettwoDownWorkstations(); |
| | | return downWorkstationService.getoneDownWorkstations(6,10); |
| | | } |
| | | @GetMapping("/getflowCardId") |
| | | public ResponseEntity<Map<String, Object>> getflowCardId() { |
| | | Map<String, Object> responseData = new HashMap<>(); |
| | | try { |
| | | List<Map<String, Object>> data = downWorkstationService.getflowCardId(); |
| | | List<Map<String, Object>> data = glassInfoService.getFlowCardId(); |
| | | responseData.put("code", 200); |
| | | responseData.put("msg", "成功"); |
| | | responseData.put("data", data); |
| | |
| | | |
| | | |
| | | |
| | | |
| | | //绑定架子 |
| | | @PostMapping("/updateFlowCardId") |
| | | public ResponseEntity<Map<String, Object>> updateFlowCardId(@RequestBody Map<String, Object> requestData) { |
| | | // 从 requestData 中获取传入的 flowCardId |
| | |
| | | int glassInfoCount = glassInfoService.getGlassInfoCountByFlowCardId(flowCardId); |
| | | |
| | | // 更新 down_workstation 表中的总数量 |
| | | glassInfoService.updateFlowCardIdAndCount(flowCardId, glassInfoCount, workstationId); |
| | | downWorkstationService.updateFlowCardIdAndCount(flowCardId, glassInfoCount, workstationId); |
| | | |
| | | // 构建响应数据 |
| | | Map<String, Object> responseData = new HashMap<>(); |
| | |
| | | package com.mes.downworkstation.controller; |
| | | |
| | | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | |
| | | private Integer workState; |
| | | |
| | | |
| | | private Integer total_quantity; |
| | | |
| | | private Integer Racksnumber; |
| | | |
| | | |
| | |
| | | @Select("SELECT dwt.flow_card_id,dw.id,dw.racks_number FROM down_workstation_task dwt JOIN down_workstation dw ON dwt.flow_card_id = dw.flow_card_id WHERE dwt.state = 1 LIMIT 1") |
| | | List<DownWorkstation> selectdownWorkstationstate(); |
| | | //更新落架数量 |
| | | @Update("UPDATE down_workstation SET racks_number = #{racksNumber} " + |
| | | "WHERE flow_card_id = #{flowCardId}") |
| | | void update_racks_number(@Param("flowCardId") String flowCardId, |
| | | @Param("racksNumber") Integer racksNumber); |
| | | // @Update("UPDATE down_workstation SET racks_number = #{racksNumber} " + |
| | | // "WHERE flow_card_id = #{flowCardId}") |
| | | // void update_racks_number(@Param("flowCardId") String flowCardId, |
| | | // @Param("racksNumber") Integer racksNumber); |
| | | |
| | | //插入机械任务表 |
| | | @Insert("INSERT INTO down_workstation_task (flow_card_id, width, height, thickness, filmsid,state) " + |
| | | "VALUES (#{flowCardId}, #{width}, #{height}, #{thickness}, #{filmsid},1)") |
| | | void insertdownWorkstationtask(DownGlassInfo downGlassInfo); |
| | | // @Insert("INSERT INTO down_workstation_task (flow_card_id, width, height, thickness, filmsid,state) " + |
| | | // "VALUES (#{flowCardId}, #{width}, #{height}, #{thickness}, #{filmsid},1)") |
| | | // void insertdownWorkstationtask(DownGlassInfo downGlassInfo); |
| | | |
| | | //根据工位id更新实体类接收的数据 |
| | | @Update("UPDATE down_workstation SET width = #{width}, height = #{height}, flow_card_id = #{flowCardId} WHERE workstation_id = #{workstationId}") |
| | | void updateFlowCardId(DownWorkstation downWorkstation); |
| | | // @Update("UPDATE down_workstation SET width = #{width}, height = #{height}, flow_card_id = #{flowCardId} WHERE workstation_id = #{workstationId}") |
| | | // void updateFlowCardId(DownWorkstation downWorkstation); |
| | | |
| | | |
| | | |
| | | //满架拉走,清空信息 |
| | | @Update("UPDATE down_workstation SET width = null, height = null, flow_card_id = null WHERE workstation_id = #{workstationId}") |
| | | void clearFlowCardId(DownWorkstation downWorkstation); |
| | | |
| | | |
| | | |
| | | @Update("UPDATE down_workstation_task SET state = 0 WHERE flow_card_id = #{flowCardId}") |
| | | void update_task_state_to_zero(@Param("flowCardId") String flowCardId); |
| | | // @Update("UPDATE down_workstation_task SET state = 0 WHERE flow_card_id = #{flowCardId}") |
| | | // void update_task_state_to_zero(@Param("flowCardId") String flowCardId); |
| | | |
| | | |
| | | @Select(" SELECT * FROM down_workstation WHERE workstation_id >= 1 AND workstation_id <= 5") |
| | | List<DownWorkstation> getoneDownWorkstations(); |
| | | |
| | | |
| | | @Select(" SELECT * FROM down_workstation WHERE workstation_id >= 6 AND workstation_id <= 10") |
| | | List<DownWorkstation> gettwoDownWorkstations(); |
| | | // @Select("SELECT * FROM down_workstation WHERE workstation_id BETWEEN #{startId} AND #{endId}") |
| | | // List<DownWorkstation> getDownWorkstationsInRange(@Param("startId") int startId, @Param("endId") int endId); |
| | | |
| | | |
| | | |
| | | @Select("SELECT DISTINCT flowcard_id from glass_info") |
| | | @ResultType(Map.class) |
| | | List<Map<String, Object>> getflowCardId(); |
| | | // @Select("SELECT DISTINCT flowcard_id from glass_info") |
| | | // @ResultType(Map.class) |
| | | // List<Map<String, Object>> getflowCardId(); |
| | | |
| | | @Update("UPDATE down_workstation SET flow_card_id = NULL, total_quantity = 0, racks_number = 0 WHERE workstation_id = #{workstationId}") |
| | | void clearFlowCardInfoByWorkstationId(@Param("workstationId") int workstationId); |
| | | // @Update("UPDATE down_workstation SET flow_card_id = NULL, total_quantity = 0, racks_number = 0 WHERE workstation_id = #{workstationId}") |
| | | // void clearFlowCardInfoByWorkstationId(@Param("workstationId") int workstationId); |
| | | |
| | | // 获取总数量 |
| | | @Select("SELECT total_quantity FROM down_workstation WHERE workstation_id = #{workstationId}") |
| | | int getTotalQuantity(@Param("workstationId") int workstationId); |
| | | // @Select("SELECT total_quantity FROM down_workstation WHERE workstation_id = #{workstationId}") |
| | | // int getTotalQuantity(@Param("workstationId") int workstationId); |
| | | |
| | | // 获取落架数量 |
| | | @Select("SELECT racks_number FROM down_workstation WHERE workstation_id = #{workstationId}") |
| | | int getRacksNumber(@Param("workstationId") int workstationId); |
| | | // @Select("SELECT racks_number FROM down_workstation WHERE workstation_id = #{workstationId}") |
| | | // int getRacksNumber(@Param("workstationId") int workstationId); |
| | | |
| | | } |
| | |
| | | package com.mes.downworkstation.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.mes.downworkstation.entity.DownWorkstation; |
| | | import com.mes.downworkstation.entity.DownWorkstationTask; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface DownWorkstationTaskMapper extends BaseMapper<DownWorkstationTask> { |
| | | |
| | | List<DownWorkstationTask> selectList(); |
| | | |
| | | DownWorkstation selectdownWorkstationstate(); |
| | | } |
| | |
| | |
|
| | | import com.mes.common.PLCAutoMes;
|
| | | import com.mes.downglassinfo.entity.DownGlassInfo;
|
| | | import com.mes.downglassinfo.entity.DownGlassTask;
|
| | | import com.mes.downglassinfo.service.DownGlassInfoService;
|
| | | import com.mes.downglassinfo.service.DownGlassTaskService;
|
| | | import com.mes.downstorage.entity.DownStorageCageDetails;
|
| | | import com.mes.downworkstation.entity.DownWorkstation;
|
| | | import com.mes.device.PlcParameterObject;
|
| | |
| | | @Autowired
|
| | | private DownGlassInfo downGlassInfo;
|
| | | private DownWorkstation downWorkstation;
|
| | | private DownGlassInfoMapper downGlassInfoMapper;
|
| | | // private DownGlassInfoMapper downGlassInfoMapper;
|
| | | private DownGlassInfoService downGlassInfoService;
|
| | | private DownGlassTaskService downGlassTaskService;
|
| | | private DownWorkstationMapper downWorkstationMapper;
|
| | | private DownWorkstationService downWorkstationService;
|
| | | private DownWorkstationTaskService downWorkstationTaskService;
|
| | | PlcParameterObject plcread = PLCAutoMes.PlcReadObject;
|
| | | /**
|
| | | * // 机械手1PLC请求字
|
| | |
| | | public void insertdownglassinfo() {
|
| | |
|
| | |
|
| | | downWorkstationMapper = WebSocketServer.applicationContext.getBean(DownWorkstationMapper.class);
|
| | | downWorkstationMapper = WebSocketServer.applicationContext.getBean(DownWorkstationMapper.class);
|
| | | downWorkstationService = WebSocketServer.applicationContext.getBean(DownWorkstationService.class);
|
| | | downWorkstationTaskService = WebSocketServer.applicationContext.getBean(DownWorkstationTaskService.class);
|
| | | downGlassInfoService = WebSocketServer.applicationContext.getBean(DownGlassInfoService.class);
|
| | | downGlassInfoMapper = WebSocketServer.applicationContext.getBean(DownGlassInfoMapper.class);
|
| | | List<DownGlassInfo> taskdownGlassInf = downGlassInfoMapper.selectunloadingtaskstate();
|
| | | // downGlassInfoMapper = WebSocketServer.applicationContext.getBean(DownGlassInfoMapper.class);
|
| | | downGlassTaskService = WebSocketServer.applicationContext.getBean(DownGlassTaskService.class);
|
| | | List<DownGlassTask> taskdownGlassInf = downGlassTaskService.getUnloadingTaskState();
|
| | | //
|
| | |
|
| | |
|
| | |
| | |
|
| | | //
|
| | |
|
| | | for (DownGlassInfo downGlassInfo : taskdownGlassInf) {
|
| | | for (DownGlassTask downGlassInfo : taskdownGlassInf) {
|
| | | // 创建新的 DownGlassInfo 对象并设置相关属性
|
| | | DownGlassInfo newdownGlassInfo = new DownGlassInfo();
|
| | |
|
| | | newdownGlassInfo.setFlowCardId(downGlassInfo.getFlowCardId());
|
| | | Integer maxSequence = downGlassInfoMapper.getMaxSequenceByFlowCardId(downGlassInfo.getFlowCardId());
|
| | | Integer maxSequence = downGlassInfoService.getMaxSequenceByFlowCardId(downGlassInfo.getFlowCardId());
|
| | | // 初始化顺序字段值
|
| | | int sequence = maxSequence != null ? maxSequence + 1 : 1;
|
| | |
|
| | |
| | | newdownGlassInfo.setSequence(sequence);
|
| | |
|
| | | // 插入数据到下片玻璃信息表
|
| | | downGlassInfoMapper.insert(newdownGlassInfo);
|
| | | downGlassInfoService.insertDownGlassInfo(newdownGlassInfo);
|
| | | //插入数据到机械手任务表
|
| | |
|
| | | downWorkstationMapper.insertdownWorkstationtask(newdownGlassInfo);
|
| | | downWorkstationTaskService.insertdownWorkstationtask(newdownGlassInfo);
|
| | | //更新下片任务表状态为0
|
| | | downGlassInfoMapper.updateTaskStateToZero(downGlassInfo.getFlowCardId());
|
| | | downGlassTaskService.updateTaskStateToZero(downGlassInfo.getFlowCardId());
|
| | |
|
| | | sequence++; // 递增顺序字段值
|
| | |
|
| | |
| | | for (DownWorkstation downWorkstation : taskdownWorkstation) {
|
| | |
|
| | | //更新下片工位表中已落架数量
|
| | | downWorkstationMapper.update_racks_number(downWorkstation.getFlowCardId(), downWorkstation.getRacksnumber() + 1);
|
| | | downWorkstationService.updateracksnumber(downWorkstation.getFlowCardId(), downWorkstation.getRacksnumber() + 1);
|
| | |
|
| | | //更新机械任务表中状态为0
|
| | | downWorkstationMapper.update_task_state_to_zero(downWorkstation.getFlowCardId());
|
| | | downWorkstationTaskService.updateTaskStateToZero(downWorkstation.getFlowCardId());
|
| | | //删除下片任务表中的记录
|
| | | downGlassInfoMapper.deletetask(downWorkstation.getFlowCardId());
|
| | | downGlassTaskService.deleteTask(downWorkstation.getFlowCardId());
|
| | |
|
| | | }
|
| | | }
|
| | |
| | | }
|
| | |
|
| | |
|
| | | /**
|
| | | * @param downWorkstation // 绑定流程卡号架子
|
| | | */
|
| | |
|
| | | public void bindingshelf(DownWorkstation downWorkstation) {
|
| | | downWorkstationMapper.updateFlowCardId(downWorkstation);
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | |
|
| | | /**
|
| | | * @param downWorkstation // 满架拉走 清除流程卡信息
|
| | | */
|
| | |
|
| | | public void clearFlowCardId(DownWorkstation downWorkstation) {
|
| | |
|
| | | downWorkstationMapper.clearFlowCardId(downWorkstation);
|
| | | }
|
| | | // public void clearFlowCardId(DownWorkstation downWorkstation) {
|
| | | //
|
| | | // downWorkstationMapper.clearFlowCardId(downWorkstation);
|
| | | // }
|
| | |
|
| | |
|
| | | }
|
| | |
| | | */ |
| | | public interface DownWorkstationService extends IService<DownWorkstation> { |
| | | |
| | | List<DownWorkstation> getoneDownWorkstations(); |
| | | |
| | | List<DownWorkstation> gettwoDownWorkstations(); |
| | | |
| | | List<Map<String, Object>> getflowCardId(); |
| | | List<DownWorkstation> getoneDownWorkstations(int startId, int endId); |
| | | |
| | | int getTotalQuantity(int workstationId); |
| | | |
| | | int getRacksNumber(int workstationId); |
| | | |
| | | void clearFlowCardId(int workstationId); |
| | | |
| | | void updateracksnumber( String flowCardId, int racksnumber); |
| | | |
| | | |
| | | int updateFlowCardIdAndCount(String flowCardId, int glassInfoCount, int workstationId); |
| | | |
| | | |
| | | } |
| | |
| | | package com.mes.downworkstation.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.mes.downglassinfo.entity.DownGlassInfo; |
| | | import com.mes.downworkstation.entity.DownWorkstationTask; |
| | | |
| | | /** |
| | |
| | | * @since 2024-04-07 |
| | | */ |
| | | public interface DownWorkstationTaskService extends IService<DownWorkstationTask> { |
| | | |
| | | void insertdownWorkstationtask(DownGlassInfo downGlassInfo); |
| | | void updateTaskStateToZero(String flowCardId); |
| | | } |
| | |
| | | package com.mes.downworkstation.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.downglassinfo.entity.DownGlassTask; |
| | | import com.mes.downworkstation.entity.DownWorkstation; |
| | | import com.mes.downworkstation.entity.DownWorkstationTask; |
| | | import com.mes.downworkstation.mapper.DownWorkstationMapper; |
| | | import com.mes.downworkstation.mapper.DownWorkstationTaskMapper; |
| | | import com.mes.downworkstation.service.DownWorkstationService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | |
| | | @Autowired |
| | | private DownWorkstationMapper downWorkstationMapper; |
| | | private DownWorkstationTaskMapper downWorkstationTaskMapper; |
| | | |
| | | @Override |
| | | public List<DownWorkstation> getoneDownWorkstations() { |
| | | return downWorkstationMapper.getoneDownWorkstations(); |
| | | } |
| | | |
| | | @Override |
| | | public List<DownWorkstation> gettwoDownWorkstations() { |
| | | return downWorkstationMapper.gettwoDownWorkstations(); |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> getflowCardId() { |
| | | return downWorkstationMapper.getflowCardId(); |
| | | } |
| | | |
| | | // @Override |
| | | // public List<DownWorkstation> gettwoDownWorkstations() { |
| | | // return downWorkstationMapper.getDownWorkstationsInRange(6,10); |
| | | // } |
| | | //获取总数量 |
| | | @Override |
| | | public int getTotalQuantity(int workstationId) { |
| | | Integer totalQuantity = downWorkstationMapper.getTotalQuantity(workstationId); |
| | | return totalQuantity != null ? totalQuantity : 0; |
| | | QueryWrapper<DownWorkstation> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.select("total_quantity") |
| | | .eq("workstation_id", workstationId); |
| | | |
| | | DownWorkstation result = baseMapper.selectOne(queryWrapper); |
| | | return result != null ? result.getTotal_quantity() : 0; |
| | | } |
| | | |
| | | // @Override |
| | | // public int getTotalQuantity(int workstationId) { |
| | | // Integer totalQuantity = downWorkstationMapper.getTotalQuantity(workstationId); |
| | | // return totalQuantity != null ? totalQuantity : 0; |
| | | // } |
| | | |
| | | // @Override |
| | | // public int getRacksNumber(int workstationId) { |
| | | // Integer racksNumber = downWorkstationMapper.getRacksNumber(workstationId); |
| | | // return racksNumber != null ? racksNumber : 0; |
| | | // } |
| | | //根据条件获取落架数量 |
| | | @Override |
| | | public int getRacksNumber(int workstationId) { |
| | | Integer racksNumber = downWorkstationMapper.getRacksNumber(workstationId); |
| | | return racksNumber != null ? racksNumber : 0; |
| | | QueryWrapper<DownWorkstation> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.select("racks_number") |
| | | .eq("workstation_id", workstationId); |
| | | |
| | | DownWorkstation result = baseMapper.selectOne(queryWrapper); |
| | | return result != null ? result.getRacksnumber() : 0; |
| | | } |
| | | //根据条件获取工位玻璃信息 |
| | | @Override |
| | | public List<DownWorkstation> getoneDownWorkstations(int startId, int endId) { |
| | | QueryWrapper<DownWorkstation> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.between("workstation_id", startId, endId); |
| | | |
| | | return baseMapper.selectList(queryWrapper); |
| | | } |
| | | |
| | | |
| | | // |
| | | |
| | | |
| | | @Override |
| | | public void updateracksnumber(String flowCardId, int racksNumber) { |
| | | UpdateWrapper<DownWorkstation> updateWrapper = new UpdateWrapper<>(); |
| | | updateWrapper.set("racks_number",racksNumber).eq("flow_card_id", flowCardId); |
| | | baseMapper.update(null, updateWrapper); |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | public int updateFlowCardIdAndCount(String flowCardId, int glassInfoCount, int workstationId) { |
| | | UpdateWrapper<DownWorkstation> updateWrapper = new UpdateWrapper<>(); |
| | | updateWrapper.set("total_quantity", glassInfoCount) |
| | | .set("flow_card_id", flowCardId) |
| | | .eq("workstation_id", workstationId); |
| | | |
| | | return baseMapper.update(null, updateWrapper); |
| | | } |
| | | |
| | | @Override |
| | | public void clearFlowCardId(int workstationId) { |
| | | downWorkstationMapper.clearFlowCardInfoByWorkstationId(workstationId); |
| | | UpdateWrapper<DownWorkstation> updateWrapper = new UpdateWrapper<>(); |
| | | updateWrapper.set("flow_card_id", null) |
| | | .set("total_quantity", 0) |
| | | .set("racks_number", 0) |
| | | .eq("workstation_id", workstationId); |
| | | |
| | | baseMapper.update(null, updateWrapper); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @Transactional |
| | | public void crossDatabaseQuery() { |
| | | // 从 MySQL 数据库中查询数据,只返回一条符合条件的数据 |
| | | DownWorkstation downWorkstation = downWorkstationTaskMapper.selectdownWorkstationstate(); |
| | | |
| | | // 从 SQL Server 数据库中查询数据 |
| | | List<DownWorkstationTask> downWorkstationTasks = downWorkstationTaskMapper.selectList(); |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | } |
| | |
| | | package com.mes.downworkstation.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.mes.downglassinfo.entity.DownGlassInfo; |
| | | import com.mes.downworkstation.entity.DownWorkstationTask; |
| | | import com.mes.downworkstation.mapper.DownWorkstationTaskMapper; |
| | | import com.mes.downworkstation.service.DownWorkstationTaskService; |
| | |
| | | @Service |
| | | public class DownWorkstationTaskServiceImpl extends ServiceImpl<DownWorkstationTaskMapper, DownWorkstationTask> implements DownWorkstationTaskService { |
| | | |
| | | |
| | | |
| | | public void insertdownWorkstationtask(DownGlassInfo downGlassInfo) { |
| | | DownWorkstationTask entity = new DownWorkstationTask(); |
| | | entity.setFlowCardId(downGlassInfo.getFlowCardId()); |
| | | entity.setWidth(downGlassInfo.getWidth()); |
| | | entity.setHeight(downGlassInfo.getHeight()); |
| | | entity.setThickness(downGlassInfo.getThickness()); |
| | | entity.setFilmsid(downGlassInfo.getFilmsid()); |
| | | entity.setState(1); |
| | | |
| | | baseMapper.insert(entity); |
| | | } |
| | | |
| | | @Override |
| | | public void updateTaskStateToZero(String flowCardId) { |
| | | UpdateWrapper<DownWorkstationTask> updateWrapper = new UpdateWrapper<>(); |
| | | updateWrapper.set("state", 0).eq("flow_card_id", flowCardId); |
| | | |
| | | baseMapper.update(null, updateWrapper); |
| | | } |
| | | } |
| | |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.Select; |
| | | import org.apache.ibatis.annotations.Update; |
| | | import org.mapstruct.Mapper; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | * @author zhoush |
| | | * @since 2024-03-27 |
| | | */ |
| | | @Mapper |
| | | public interface GlassInfoMapper extends BaseMapper<GlassInfo> { |
| | | |
| | | |
| | | @Select("SELECT COUNT(*) FROM glass_info WHERE flowcard_id = #{flowCardId}") |
| | | int getGlassInfoCountByFlowCardId(@Param("flowCardId") String flowCardId); |
| | | // @Select("SELECT COUNT(*) FROM glass_info WHERE flowcard_id = #{flowCardId}") |
| | | // int getGlassInfoCountByFlowCardId(@Param("flowCardId") String flowCardId); |
| | | |
| | | @Update("UPDATE down_workstation SET total_quantity = #{glassInfoCount},flow_card_id=#{flowCardId} WHERE workstation_id = #{workstationId}") |
| | | int updateFlowCardIdAndCount(@Param("flowCardId") String flowCardId, @Param("glassInfoCount") int glassInfoCount,@Param("workstationId")int workstationId); |
| | | // @Update("UPDATE down_workstation SET total_quantity = #{glassInfoCount},flow_card_id=#{flowCardId} WHERE workstation_id = #{workstationId}") |
| | | // int updateFlowCardIdAndCount(@Param("flowCardId") String flowCardId, @Param("glassInfoCount") int glassInfoCount,@Param("workstationId")int workstationId); |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.mes.uppattenusage.entity.GlassInfo; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务类 |
| | |
| | | |
| | | int getGlassInfoCountByFlowCardId(String flowCardId); |
| | | |
| | | void updateFlowCardIdAndCount(String flowCardId, int glassInfoCount, int workstationId); |
| | | List<Map<String, Object>> getFlowCardId(); |
| | | GlassInfo selectGlassId(String id); |
| | | } |
| | |
| | | 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> |
| | |
| | | |
| | | @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 和数量失败"); |
| | | // } |
| | | // } |
| | | } |
| | |
| | | username: root |
| | | password: beibo.123/ |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | | |
| | | sqlserver: |
| | | url: jdbc:sqlserver://localhost:1433;databaseName=hangzhoumes |
| | | username: sa |
| | | password: beibo.123/ |
| | | driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver |
| | | cloud: |
| | | nacos: |
| | | discovery: |
| | |
| | | port: 6379 |
| | | password: 123456 |
| | | mybatis-plus: |
| | | mapper-locations: classpath*:mapper/*.xml |
| | | |
| | | mapper-locations: classpath*:mapper/sqlserver/*.xml |
| | | |
| | | # log-impl: org.apache.ibatis.logging.stdout.StdOutImpl |
| | | # 设置 MyBatis 日志级别为 ERROR |