| | |
| | | |
| | | // 查询数据 |
| | | const selectReportData = async () => { |
| | | console.log(timeRange.value[0]) |
| | | const response = await request.post("/cacheVerticalGlass/damage/selectDamage", { |
| | | startTime: timeRange.value[0], |
| | | endTime: timeRange.value[1], |
| | |
| | | } else { |
| | | ElMessage.error(response.message); |
| | | } |
| | | |
| | | const responses = await request.post("/cacheVerticalGlass/damage/insertDamage", { |
| | | glassId:"P24060403|3|6", |
| | | line:"2001", |
| | | workingProcedure:"冷加工", |
| | | remark:"", |
| | | status:"2" |
| | | }) |
| | | }; |
| | | |
| | | const socketUrl = `ws://${WebSocketHost}:${host}/api/temperingGlass/api/talk/screen`; |
| | |
| | | damageService.updateBatchById(damageList); |
| | | return Result.build(200,"修改成功",1); |
| | | } |
| | | |
| | | @ApiOperation("报工数据新增") |
| | | @PostMapping("/insertDamage") |
| | | public Result insertDamage(@RequestBody Damage damage) { |
| | | damageService.insertDamage(damage); |
| | | return Result.build(200,"新增成功",1); |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | @ApiModelProperty(value = "状态", position = 16) |
| | | private Integer state; |
| | | |
| | | /** |
| | | * 格子 |
| | | */ |
| | | @ApiModelProperty(value = "格子", position = 17) |
| | | private Integer slot; |
| | | |
| | | /** |
| | | * 钢化类型 |
| | | */ |
| | | @ApiModelProperty(value = "钢化类型", position = 17) |
| | | private Integer temperingType; |
| | | |
| | | /** |
| | | * 工程id |
| | | */ |
| | | @ApiModelProperty(value = "工程id", position = 17) |
| | | private Integer engineerId; |
| | | } |
| | |
| | | package com.mes.work_assignment.controller; |
| | | |
| | | |
| | | import cn.hutool.core.date.DateTime; |
| | | import com.mes.damage.service.DamageService; |
| | | import com.mes.utils.Result; |
| | | import com.mes.work_assignment.entity.WorkAssignment; |
| | | import com.mes.work_assignment.service.WorkAssignmentService; |
| | | 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.PostMapping; |
| | | 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> |
| | |
| | | return Result.build(200,"查询成功",workAssignmentService.selectWorkAssignment(line,workingProcedure)); |
| | | } |
| | | |
| | | @ApiOperation("值班数据修改") |
| | | @PostMapping("/updateWorkAssignment") |
| | | public Result updateWorkAssignment(@RequestBody List<WorkAssignment> workAssignmentList) { |
| | | workAssignmentService.saveOrUpdateBatch(workAssignmentList); |
| | | return Result.build(200,"修改成功",1); |
| | | } |
| | | } |
| | | |
| | |
| | | @EnableSwagger2 |
| | | @EnableDiscoveryClient |
| | | @MapperScan(basePackages = "com.mes.*.mapper") |
| | | @EnableScheduling |
| | | //@EnableScheduling |
| | | public class CacheVerticalClassModuleApplication { |
| | | public static void main(String[] args) { |
| | | try { |
| | |
| | | @ApiOperation("理片笼任务出片") |
| | | @PostMapping("/outBigStorageCageDetails") |
| | | public Result outBigStorageCageDetails(@RequestBody BigStorageCageDetails bigStorageCageDetails) { |
| | | |
| | | bigStorageCageDetailsService.outBigStorageCageDetails(bigStorageCageDetails); |
| | | return Result.build(200,"出片添加成功",1); |
| | | } |
| | | |
| | | @ApiOperation("指定钢化") |
| | | @PostMapping("/TemperingGlass") |
| | | public Result TemperingGlass(@RequestBody String temperingLayoutId,@RequestBody String engineerId) { |
| | | boolean result=bigStorageCageDetailsService.TemperingGlass(temperingLayoutId,engineerId); |
| | | if(result==true){ |
| | | return Result.build(200,"指定钢化成功",1); |
| | | }else { |
| | | return Result.build(200, "已存在钢化任务", 1); |
| | | } |
| | | } |
| | | |
| | | @ApiOperation("钢化查询") |
| | | @PostMapping("/selectTemperingGlass") |
| | | public Result selectTemperingGlass() { |
| | | return Result.build(200,"查询成功",bigStorageCageDetailsService.selectTemperingGlass()); |
| | | } |
| | | } |
| | | |
| | |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @return |
| | | */ |
| | | List<SlotSequenceDTO> queryGlassMaxAndMin(String engineerId, Integer temperingLayoutId); |
| | | |
| | | boolean TemperingGlass(String temperingLayoutId, String engineerId); |
| | | |
| | | List<Map<String, Object>> selectTemperingGlass(); |
| | | } |
| | |
| | | |
| | | import cn.hutool.core.lang.Assert; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.github.yulichang.base.MPJBaseServiceImpl; |
| | | import com.github.yulichang.wrapper.MPJLambdaWrapper; |
| | | import com.mes.bigstorage.entity.BigStorageCage; |
| | |
| | | temperingGlassInfoMapper.updateById(temperingGlassInfo); |
| | | } |
| | | if (status == 0) { |
| | | bigStorageCageDetails.setState(Const.GLASS_STATE_TAKE); |
| | | } else { |
| | | bigStorageCageDetails.setState(Const.GLASS_STATE_DAMAGE); |
| | | } else { |
| | | bigStorageCageDetails.setState(Const.GLASS_STATE_TAKE); |
| | | } |
| | | baseMapper.updateById(bigStorageCageDetails); |
| | | bigStorageCageService.updateRemainWidth(bigStorageCageDetails.getSlot()); |
| | |
| | | public List<SlotSequenceDTO> queryGlassMaxAndMin(String engineerId, Integer temperingLayoutId) { |
| | | return baseMapper.queryGlassMaxAndMin(engineerId, temperingLayoutId); |
| | | } |
| | | |
| | | @Override |
| | | public boolean TemperingGlass(String temperingLayoutId, String engineerId){ |
| | | LambdaQueryWrapper<TemperingGlassInfo> temperingGlassInfoLambdaQueryWrapper=new LambdaQueryWrapper<>(); |
| | | temperingGlassInfoLambdaQueryWrapper |
| | | .eq(TemperingGlassInfo::getTemperingLayoutId,temperingLayoutId) |
| | | .eq(TemperingGlassInfo::getEngineerId,engineerId); |
| | | List<TemperingGlassInfo> temperingGlassInfoList=temperingGlassInfoMapper.selectList(temperingGlassInfoLambdaQueryWrapper); |
| | | if(temperingGlassInfoList.size()==0){ |
| | | LambdaQueryWrapper<BigStorageCageDetails> wrapper =new LambdaQueryWrapper<>(); |
| | | wrapper.eq(BigStorageCageDetails::getTemperingLayoutId,temperingLayoutId) |
| | | .eq(BigStorageCageDetails::getEngineerId,engineerId) |
| | | .in(BigStorageCageDetails::getState,Const.GLASS_STATE_IN,Const.GLASS_STATE_ARTIFICIAL,Const.GLASS_STATE_OUT_ING); |
| | | List<BigStorageCageDetails> bigStorageCageDetailsList=baseMapper.selectList(wrapper); |
| | | |
| | | for (BigStorageCageDetails bigStorageCageDetails:bigStorageCageDetailsList |
| | | ) { |
| | | TemperingGlassInfo temperingGlassInfo=new TemperingGlassInfo(); |
| | | LambdaQueryWrapper<GlassInfo> glassInfoLambdaQueryWrapper=new LambdaQueryWrapper<>(); |
| | | glassInfoLambdaQueryWrapper.eq(GlassInfo::getGlassId,bigStorageCageDetails.getGlassId()); |
| | | GlassInfo glassInfo=glassInfoMapper.selectOne(glassInfoLambdaQueryWrapper); |
| | | |
| | | BeanUtils.copyProperties(glassInfo, temperingGlassInfo); |
| | | temperingGlassInfo.setState(Const.TEMPERING_NEW); |
| | | temperingGlassInfo.setSlot(bigStorageCageDetails.getSlot()); |
| | | temperingGlassInfoMapper.insert(temperingGlassInfo); |
| | | } |
| | | return true; |
| | | }else{ |
| | | return false; |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> selectTemperingGlass(){ |
| | | QueryWrapper<BigStorageCageDetails> wrapper = new QueryWrapper<>(); |
| | | wrapper.select("engineer_id,tempering_layout_id,count(*) as count") |
| | | .groupBy("engineer_id,tempering_layout_id"); |
| | | List<Map<String, Object>> TemperingGlass = baseMapper.selectMaps(wrapper); |
| | | return TemperingGlass; |
| | | } |
| | | } |
| | |
| | | MPJLambdaWrapper<BigStorageCage> wrapper = new MPJLambdaWrapper<>(); |
| | | wrapper.selectAll(BigStorageCage.class).selectCollection(BigStorageCageDetails.class, BigStorageCage::getBigStorageCageDetails) |
| | | .leftJoin(BigStorageCageDetails.class, on -> on.eq(BigStorageCageDetails::getSlot, BigStorageCage::getSlot) |
| | | .in(BigStorageCageDetails::getState, Const.GLASS_STATE_IN, Const.GLASS_STATE_ARTIFICIAL)) |
| | | .in(BigStorageCageDetails::getState, Const.GLASS_STATE_IN, Const.GLASS_STATE_ARTIFICIAL,Const.GLASS_STATE_OUT_ING)) |
| | | .orderByAsc(BigStorageCage::getDeviceId) |
| | | .orderByAsc(BigStorageCage::getSlot); |
| | | return bigStorageCageMapper.selectJoinList(BigStorageCage.class, wrapper); |
| | |
| | | MPJLambdaWrapper<BigStorageCage> wrapper = new MPJLambdaWrapper<>(); |
| | | wrapper.selectAll(BigStorageCage.class).selectCollection(BigStorageCageDetails.class, BigStorageCage::getBigStorageCageDetails) |
| | | .leftJoin(BigStorageCageDetails.class, on -> on.eq(BigStorageCageDetails::getSlot, BigStorageCage::getSlot) |
| | | .in(BigStorageCageDetails::getState, Const.GLASS_STATE_IN, Const.GLASS_STATE_ARTIFICIAL)); |
| | | .in(BigStorageCageDetails::getState, Const.GLASS_STATE_IN, Const.GLASS_STATE_ARTIFICIAL,Const.GLASS_STATE_OUT_ING)); |
| | | List<BigStorageCage> bigStorageCages = bigStorageCageMapper.selectJoinList(BigStorageCage.class, wrapper); |
| | | Map<Integer, List<BigStorageCage>> listMap = bigStorageCages.stream().collect(Collectors.groupingBy(item -> item.getDeviceId())); |
| | | return listMap; |
| | |
| | | Date startDate = new Date(); |
| | | log.info("大理片笼空车进片任务开始执行时间:{}", startDate); |
| | | PlcParameterObject plcParameterObject = S7object.getinstance().PlcMesObject; |
| | | String e01Status = plcParameterObject.getPlcParameter("E01State").getValue(); |
| | | String d03ToMES = plcParameterObject.getPlcParameter("D03ToMES").getValue(); |
| | | String d05ToMES = plcParameterObject.getPlcParameter("D05ToMES").getValue(); |
| | | // String e01Status = plcParameterObject.getPlcParameter("E01State").getValue(); |
| | | // String d03ToMES = plcParameterObject.getPlcParameter("D03ToMES").getValue(); |
| | | // String d05ToMES = plcParameterObject.getPlcParameter("D05ToMES").getValue(); |
| | | String e01Status="0"; |
| | | String d03ToMES="1"; |
| | | String d05ToMES="0"; |
| | | log.info("执行空车送片任务,获取到的大车状态为{},卧转立状态分别为d03:{},d05:{}", e01Status, d03ToMES, d05ToMES); |
| | | if (REQUEST_WORD.equals(e01Status)) { |
| | | Date endDate = new Date(); |
| | |
| | | @Autowired |
| | | DamageService damageService; |
| | | |
| | | @Autowired |
| | | BigStorageCageFeedTaskMapper bigStorageCageFeedTaskMapper; |
| | | // @Autowired |
| | | // BigStorageCageFeedTaskMapper bigStorageCageFeedTaskMapper; |
| | | |
| | | @Test |
| | | public void testInsertSlot() { |
| | |
| | | damage.setStatus(2); |
| | | damageService.insertDamage(damage); |
| | | } |
| | | |
| | | @Test |
| | | public void updateOutGlassStateTask() { |
| | | plcStorageCageTask.updateOutGlassStateTask(); |
| | | } |
| | | |
| | | } |