-
懒羊羊
2024-03-29 0caf8761b4af8163a691ebb56723286926529ee4
jcdm-main/src/main/java/com/jcdm/main/bs/formulaChild/controller/BsFormulaChildInfoController.java
@@ -2,6 +2,8 @@
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
@@ -37,6 +39,31 @@
    /**
     * 查询配方配置子信息列表
     */
    @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()));
        for (BsFormulaChildInfo formulaChildInfo : list) {
//            formulaChildInfo.setSort(formulaChildInfo.getStepSort());
//            formulaChildInfo.setAddress(formulaChildInfo.getTechRequirement());
//            formulaChildInfo.setImg(formulaChildInfo.getOperationSteps());
            if(formulaChildInfo.getCollectData()!=null&& !"".equals(formulaChildInfo.getCollectData())){
                if(formulaChildInfo.getCollectData().contains("[")){
                    String data = formulaChildInfo.getCollectData();
                    data = data.replace("[", "").replace("]", "").replace(" ", "");
                    String[] tightenDataParts = data.split(",");
                    formulaChildInfo.setCollectData("扭矩"+tightenDataParts[0]+"角度"+tightenDataParts[1]+"扭矩结果"+tightenDataParts[2]+"角度结果"+tightenDataParts[3]);
                }
            }
        }
        return getDataTable(list);
    }
    /**
     * 查询配方配置子信息列表
     */
    @PreAuthorize("@ss.hasPermi('bs:formulaChild:list')")
    @GetMapping("/list")
    public TableDataInfo list(BsFormulaChildInfo bsFormulaChildInfo)
@@ -47,19 +74,27 @@
            formulaChildInfo.setSort(formulaChildInfo.getStepSort());
            formulaChildInfo.setAddress(formulaChildInfo.getTechRequirement());
            formulaChildInfo.setImg(formulaChildInfo.getOperationSteps());
            if(formulaChildInfo.getCollectData()!=null&& !"".equals(formulaChildInfo.getCollectData())){
                if(formulaChildInfo.getCollectData().contains("[")){
                    String data = formulaChildInfo.getCollectData();
                    data = data.replace("[", "").replace("]", "").replace(" ", "");
                    String[] tightenDataParts = data.split(",");
                    formulaChildInfo.setCollectData("扭矩"+tightenDataParts[0]+"角度"+tightenDataParts[1]+"扭矩结果"+tightenDataParts[2]+"角度结果"+tightenDataParts[3]);
                }
            }
        }
        return getDataTable(list);
    }
    /**
     * 检查是否可以放行
     */
    @GetMapping("/releaseCheck")
    public AjaxResult releaseCheck(BsFormulaChildInfo bsFormulaChildInfo)
    {
        List<BsFormulaChildInfo> i = bsFormulaChildInfoService.releaseCheck(bsFormulaChildInfo);
        return AjaxResult.success(i.size());
    }
//    /**
//     * 检查是否可以放行
//     */
//    @GetMapping("/releaseCheck")
//    public AjaxResult releaseCheck(BsFormulaChildInfo bsFormulaChildInfo)
//    {
//        List<BsFormulaChildInfo> i = bsFormulaChildInfoService.releaseCheck(bsFormulaChildInfo);
//        return AjaxResult.success(i.size());
//    }
    /**
     * 扫码确认
@@ -80,6 +115,15 @@
    }
    /**
     * 拧紧后更新对应数据
     */
    @GetMapping("/updateTighteningFormula")
    public AjaxResult updateTighteningFormula(BsFormulaChildInfo bsFormulaChildInfo)
    {
        return bsFormulaChildInfoService.updateTighteningFormula(bsFormulaChildInfo);
    }
    /**
     * 导出配方配置子信息列表
     */
    @PreAuthorize("@ss.hasPermi('bs:formulaChild:export')")