| | |
| | | package com.jcdm.main.bs.formulaChild.controller; |
| | | |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.jcdm.main.constant.Constants; |
| | | import com.kangaroohy.milo.model.ReadWriteEntity; |
| | | import com.kangaroohy.milo.service.MiloService; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | |
| | | @Autowired |
| | | private IBsFormulaChildInfoService bsFormulaChildInfoService; |
| | | |
| | | @Autowired |
| | | private MiloService miloService; |
| | | |
| | | /** |
| | | * 扫码确认 |
| | | */ |
| | | @GetMapping("/fistSetpNumber") |
| | | public void fistSetpNumber(BsFormulaChildInfo bsFormulaChildInfo) |
| | | { |
| | | try { |
| | | String str = "PACK."+bsFormulaChildInfo.getProcessesCode()+".MStepNumber"; |
| | | miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(str).value(1).build()); |
| | | } catch (Exception e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 查询配方配置子信息列表 |
| | | */ |
| | | @GetMapping("/noPageListFormulaChild") |
| | | public TableDataInfo noPageListFormulaChild(BsFormulaChildInfo bsFormulaChildInfo) |
| | | { |
| | | |
| | | List<BsFormulaChildInfo> list = bsFormulaChildInfoService.list(new LambdaQueryWrapper<BsFormulaChildInfo>() |
| | | .eq(BsFormulaChildInfo::getProductCode,bsFormulaChildInfo.getProductCode()) |
| | | .eq(BsFormulaChildInfo::getProcessesCode,bsFormulaChildInfo.getProcessesCode())); |
| | | if (CollUtil.isNotEmpty(list)){ |
| | | List<BsFormulaChildInfo> collect1 = list.stream().filter(x -> Constants.OK.equals(x.getResults())).collect(Collectors.toList()); |
| | | List<BsFormulaChildInfo> collect2 = list.stream().filter(x -> !Constants.OK.equals(x.getResults())).collect(Collectors.toList()); |
| | | list = collect1; |
| | | list.addAll(collect2); |
| | | } |
| | | for (BsFormulaChildInfo formulaChildInfo : list) { |
| | | // formulaChildInfo.setSort(formulaChildInfo.getStepSort()); |
| | | // formulaChildInfo.setAddress(formulaChildInfo.getTechRequirement()); |
| | |
| | | } |
| | | |
| | | /** |
| | | * 扫码确认 |
| | | */ |
| | | @GetMapping("/jrmUpdateResults") |
| | | public AjaxResult jrmUpdateResults(BsFormulaChildInfo bsFormulaChildInfo) |
| | | { |
| | | return bsFormulaChildInfoService.jrmUpdateResults(bsFormulaChildInfo); |
| | | } |
| | | |
| | | /** |
| | | * 扫码确认 |
| | | */ |
| | | @GetMapping("/yzUpdateResults") |
| | | public AjaxResult yzUpdateResults(BsFormulaChildInfo bsFormulaChildInfo) |
| | | { |
| | | return bsFormulaChildInfoService.yzUpdateResults(bsFormulaChildInfo); |
| | | } |
| | | |
| | | /** |
| | | * 放行请空状态 |
| | | */ |
| | | @GetMapping("/workpieceRelease") |
| | |
| | | } |
| | | |
| | | /** |
| | | * 拧紧后更新对应数据 |
| | | */ |
| | | @GetMapping("/yzUpdateTighteningFormula") |
| | | public AjaxResult yzUpdateTighteningFormula(BsFormulaChildInfo bsFormulaChildInfo) |
| | | { |
| | | return bsFormulaChildInfoService.yzUpdateTighteningFormula(bsFormulaChildInfo); |
| | | } |
| | | |
| | | /** |
| | | * 导出配方配置子信息列表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('bs:formulaChild:export')") |