更新:前端破损往报工破损表内添加数据(识别/卧式理片/磨边)
| | |
| | | @PostMapping("/edgStorageCageGlass") |
| | | @ResponseBody |
| | | public Result edgStorageCageGlass(@RequestBody EdgStorageCageDetails edgStorageCageDetails,int edgStorageCageId) { |
| | | |
| | | String isSucess=edgStorageCageService.updateEdgStorageCageDetails(edgStorageCageId,edgStorageCageDetails)?"成功":"失败"; |
| | | return Result.build(200,"【清除/更换/绑定】"+isSucess,1); |
| | | } |
| | | |
| | | |
| | | |
| | | @ApiOperation("磨边模块汇报玻璃状态 功能:对笼内栅格玻璃进行【破损/拿走】 ") |
| | | @PostMapping("/edgReportStatus") |
| | | @ResponseBody |
| | | public Result edgReportStatus(@RequestBody Map<String, String> arguments) { |
| | | String edgStorageCageDetailsId=arguments.get("glassId"); |
| | | int controlsId=Integer.valueOf(arguments.get("controlsId")); |
| | | String isSucess=edgStorageCageDetailsService.identWorn(edgStorageCageDetailsId,controlsId)?"成功":"失败"; |
| | | /*arguments.put("line","1002"); |
| | | arguments.put("machine","卧式理片");*/ |
| | | String isSucess=edgStorageCageDetailsService.identWorn(arguments)?"成功":"失败"; |
| | | return Result.build(200,"【破损/拿走】"+isSucess,1); |
| | | } |
| | | |
| | |
| | | |
| | | /** |
| | | * 识别 破损/拿走 |
| | | * @param glassId |
| | | * @param ControlsId |
| | | * @param arguments |
| | | * @return |
| | | */ |
| | | boolean identWorn(String glassId,int ControlsId); |
| | | boolean identWorn(Map<String, String> arguments); |
| | | |
| | | /** |
| | | * 获取 切割当前版图 |
| | |
| | | import com.github.yulichang.toolkit.JoinWrappers; |
| | | import com.github.yulichang.wrapper.MPJLambdaWrapper; |
| | | import com.mes.common.config.Const; |
| | | import com.mes.damage.entity.Damage; |
| | | import com.mes.damage.service.DamageService; |
| | | import com.mes.edgstoragecage.entity.EdgStorageCage; |
| | | import com.mes.edgstoragecage.entity.EdgStorageCageDetails; |
| | | import com.mes.edgstoragecage.mapper.EdgStorageCageDetailsMapper; |
| | |
| | | @Autowired |
| | | TaskCacheService taskCacheService; |
| | | |
| | | @Autowired |
| | | DamageService damageService; |
| | | |
| | | |
| | | /** |
| | | * 识别 拿走:200/破损:201 |
| | | * |
| | | * @param glassId |
| | | * @param ControlsId |
| | | * @param arguments |
| | | * @return |
| | | */ |
| | | @Override |
| | | public boolean identWorn(String glassId, int ControlsId) { |
| | | public boolean identWorn(Map<String, String> arguments) { |
| | | String glassId=arguments.get("glassId"); |
| | | int controlsId=arguments.get("controlsId").isEmpty()?0:Integer.parseInt(arguments.get("controlsId")); |
| | | int line=arguments.get("line").isEmpty()?0:Integer.parseInt(arguments.get("line")); |
| | | String machine=arguments.get("machine"); |
| | | if(controlsId==0||line==0||machine==null||glassId==null||glassId.isEmpty()){ |
| | | log.info("前端传递数据不全:{}",arguments); |
| | | return false; |
| | | } |
| | | int state=controlsId==200?3:2; |
| | | |
| | | List<EdgStorageCageDetails> edgStorageCageDetails = baseMapper.selectList(new MPJLambdaQueryWrapper<EdgStorageCageDetails>().selectAll(EdgStorageCageDetails.class).eq(EdgStorageCageDetails::getGlassId, glassId)); |
| | | if (edgStorageCageDetails.size() == 1) { |
| | | EdgStorageCageDetails item = edgStorageCageDetails.get(0); |
| | | item.setState(ControlsId); |
| | | item.setState(controlsId); |
| | | Damage damage =new Damage(); |
| | | damage.setGlassId(glassId); |
| | | damage.setLine(line); |
| | | damage.setWorkingProcedure(machine); |
| | | damage.setRemark(""); |
| | | damage.setStatus(state);//201破损,200拿走 =》破损表 2破损 3 拿走 |
| | | damageService.insertDamage(damage); |
| | | baseMapper.update(item, new MPJLambdaWrapper<EdgStorageCageDetails>().selectAll(EdgStorageCageDetails.class).eq(EdgStorageCageDetails::getGlassId, glassId)); |
| | | return true; |
| | | } |
| | |
| | | import com.github.yulichang.toolkit.JoinWrappers; |
| | | import com.github.yulichang.wrapper.MPJLambdaWrapper; |
| | | import com.mes.common.config.Const; |
| | | import com.mes.damage.entity.Damage; |
| | | import com.mes.damage.service.DamageService; |
| | | import com.mes.edgstoragecage.entity.EdgStorageCage; |
| | | import com.mes.edgstoragecage.entity.EdgStorageCageDetails; |
| | | import com.mes.edgstoragecage.mapper.EdgStorageCageDetailsMapper; |
| | | import com.mes.edgstoragecage.mapper.EdgStorageCageMapper; |
| | | import com.mes.edgstoragecage.service.EdgStorageCageDetailsService; |
| | | import com.mes.edgstoragecage.service.EdgStorageCageService; |
| | | import com.mes.uppattenusage.entity.UpPattenUsage; |
| | | import com.mes.uppattenusage.mapper.UpPattenUsageMapper; |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | |
| | | EdgStorageCageDetailsMapper edgStorageCageDetailsMapper; |
| | | @Autowired |
| | | UpPattenUsageMapper upPattenUsageMapper; |
| | | |
| | | @Autowired |
| | | DamageService damageService; |
| | | |
| | | @Override |
| | | public EdgStorageCage selectNearestEmpty(int currentSlot, boolean flag) { |
| | |
| | | if (result != null) { |
| | | result.setSlot(0); |
| | | result.setState(201); |
| | | Damage damage =new Damage(); |
| | | damage.setGlassId(edgStorageCageDetails.getGlassId()); |
| | | damage.setLine(1002); |
| | | damage.setWorkingProcedure("卧式理片"); |
| | | damage.setStatus(2); |
| | | damageService.insertDamage(damage); |
| | | edgStorageCageDetailsMapper.updateById(result); |
| | | } |
| | | //添加 |
| | |
| | | @Value("${mes.min.secondLength}") |
| | | private String minSecondLength; |
| | | |
| | | @Scheduled(fixedDelay = 1000) |
| | | // @Scheduled(fixedDelay = 1000) |
| | | public void plcHomeEdgTask() { |
| | | Date startDate = new Date(); |
| | | log.info("本次任务开始执行时间:{}", startDate); |
| | |
| | | @ApiOperation("识别操作: 破损/拿走 参数(ID,功能[200:拿走,201:破损])") |
| | | @PostMapping("/identControls") |
| | | @ResponseBody |
| | | public Result identControls(@RequestParam(name = "identId", required = false) String identId,@RequestParam(name = "controlsId", required = false) int controlsId) { |
| | | boolean issucess = edgStorageCageDetailsService.identWorn(identId,controlsId); |
| | | public Result identControls(@RequestBody Map<String, String> arguments) { |
| | | /* arguments.put("glassId","玻璃ID"); |
| | | arguments.put("controlsId","功能号[200拿走/201破损]");*/ |
| | | /*arguments.put("line","1001"); |
| | | arguments.put("machine","识别");*/ |
| | | boolean issucess = edgStorageCageDetailsService.identWorn(arguments); |
| | | return Result.build(200,"成功",issucess); |
| | | } |
| | | |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.github.yulichang.wrapper.MPJLambdaWrapper; |
| | | import com.mes.damage.entity.Damage; |
| | | import com.mes.damage.service.DamageService; |
| | | import com.mes.edgstoragecage.entity.EdgStorageCageDetails; |
| | | import com.mes.edgstoragecage.mapper.EdgStorageCageDetailsMapper; |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | |
| | | |
| | | @Autowired |
| | | GlassInfoMapper glassInfoMapper; |
| | | |
| | | |
| | | /** |
| | | * 添加理片笼任务 |
| | | * @param taskCache |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Arrays; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | |
| | | } |
| | | |
| | | @Test |
| | | public void testidentWorn() { |
| | | Map<String, String> arguments=new HashMap<>(); |
| | | arguments.put("glassId","P24060405|30|1");//玻璃ID |
| | | arguments.put("controlsId","200"); //拿走:200/破损:201 |
| | | arguments.put("line","1001"); //线路: |
| | | arguments.put("machine","识别"); //设备名称: |
| | | edgStorageCageDetailsService.identWorn(arguments); |
| | | log.info("识别台【破损/拿走】:{}", 1); |
| | | } |
| | | |
| | | @Test |
| | | public void testPpOptimizeDetail() { |
| | | List<OptimizeDetail> optimizeDetail = optimizeDetailMapper.selectList(new QueryWrapper<OptimizeDetail>() |
| | | .eq("project_no", "P24032204") |