Fancy
2024-07-22 72219adeceb06a060978e876880750f804df5772
login bug
3个文件已修改
79 ■■■■■ 已修改文件
pms-parent/pms-web-station/src/main/java/com/dy/pmsStation/assemblyStep/AssemblyStepSv.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pms-parent/pms-web-station/src/main/java/com/dy/pmsStation/workOrder/QueryVo.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pms-parent/pms-web-station/src/main/java/com/dy/pmsStation/workOrder/WorkOrderSv.java 66 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pms-parent/pms-web-station/src/main/java/com/dy/pmsStation/assemblyStep/AssemblyStepSv.java
@@ -211,8 +211,8 @@
    private StaDeviceLast buildDeviceLast(QueryVo params, StaAssemblyWorkLast workLast, String deviceNo) {
        //组装数据
        StaDeviceLast record = new StaDeviceLast();
        //pr_assembly_plan input_number +1  投入数加1
        PrAssemblyPlan assemblyPlan = assemblyPlanDao.selectByPrimaryKey(workLast.planId);
        //pr_assembly_plan input_number +1  投入数加1   根据deviceNo 找到对应任务
        PrAssemblyPlan assemblyPlan = queryPlanByDeviceNo(deviceNo); //PrAssemblyPlan assemblyPlan = assemblyPlanDao.selectByPrimaryKey(workLast.planId);
        StaDeviceLast preRecord = deviceLastDao.selectByDeviceNo(deviceNo);
        if (preRecord != null) {
            record.id = preRecord.id;
pms-parent/pms-web-station/src/main/java/com/dy/pmsStation/workOrder/QueryVo.java
@@ -34,23 +34,24 @@
    /**
     * 组装生产任务实体编号
     */
    @NotNull(message="[组装生产任务实体编号]不能为空")
    //@NotNull(message="[组装生产任务实体编号]不能为空")
    @JSONField(serializeUsing= ObjectWriterImplToString.class)
    public Long planId;
    /**
     * 生产流程实体编号
     */
    @NotNull(message="[生产流程实体编号]不能为空")
    //@NotNull(message="[生产流程实体编号]不能为空")
    @JSONField(serializeUsing= ObjectWriterImplToString.class)
    public Long processId;
    /**
     * 生产流程节点实体编号
     */
    @NotNull(message="[生产流程节点实体编号]不能为空")
    //@NotNull(message="[生产流程节点实体编号]不能为空")
    @JSONField(serializeUsing= ObjectWriterImplToString.class)
    public Long nodeId;
    @NotNull(message="[生产流程节点类型]不能为空")
    //@NotNull(message="[生产流程节点类型]不能为空")
    @NotNull(message="[工作职责]不能为空")
    public Integer workType;
    /**
     * 任务认领时间
pms-parent/pms-web-station/src/main/java/com/dy/pmsStation/workOrder/WorkOrderSv.java
@@ -191,8 +191,8 @@
        }
        BaUser userInfo = getUserInfo(result.getUserId().toString());
        PltStation stationInfo = getStationInfo(result.getStationId().toString());
        //如果是维修work_type 没有 planId processId nodeId
        if (WORK_TYPE_REPAIR.equals(result.getWorkType())) {
        //如果是无任务计划 如维修work_type 没有 planId processId nodeId
        if (result.getPlanId() != null) {
            //校验planId processId nodeId
            PrAssemblyPlan assyPlan = assemblyDao.selectByPrimaryKey(result.getPlanId());
            boolean hasNodeId = assyPlan.getProcess().getNodes().stream()
@@ -266,23 +266,26 @@
    public StaAssemblyWorkLast save(QueryVo vo) {
        //先check
        StaAssemblyWorkLast checkResult = checkUserAndStationUsed(vo);
        //校验planId processId nodeId
        PrAssemblyPlan assyPlan = assemblyDao.selectByPrimaryKey(vo.getPlanId());
        if (assyPlan == null) {
            throw new RuntimeException("组装任务已经在系统中删除请检查,刷新并重新选择任务");
        }
        boolean hasNodeId = assyPlan.getProcess().getNodes().stream()
                .anyMatch(node -> node.id.equals(vo.getNodeId()));
        if (!hasNodeId) {
            throw new RuntimeException("节点信息有误或被其他人员修改,请重新选择节点信息");
        }
        //数据逐个封装返回
        vo.setLineId(checkResult.getLineId());
        StaAssemblyWorkLast staLast = new StaAssemblyWorkLast();
        BeanUtils.copyProperties(vo, staLast);
        staLast.setUserId(checkResult.getUserId());
        staLast.setStationId(checkResult.getStationId());
        //校验planId processId nodeId
        PrAssemblyPlan assyPlan = new PrAssemblyPlan();
        if (vo.getPlanId() != null) {
            assyPlan = assemblyDao.selectByPrimaryKey(vo.getPlanId());
            if (assyPlan == null) {
                throw new RuntimeException("组装任务已经在系统中删除请检查,刷新并重新选择任务");
            }
            boolean hasNodeId = assyPlan.getProcess().getNodes().stream()
                    .anyMatch(node -> node.id.equals(vo.getNodeId()));
            if (!hasNodeId) {
                throw new RuntimeException("节点信息有误或被其他人员修改,请重新选择节点信息");
            }
        }
        int count = 0;
        if (checkResult.getId() == null) {
            BeanUtils.copyProperties(vo, staLast);//vo拷贝到staLast
@@ -294,9 +297,12 @@
        } else {
            //保存一条history?
            BeanUtils.copyProperties(checkResult, staLast);
            staLast.setPlanId(assyPlan.getId());
            staLast.setProcessId(assyPlan.getProcess().getId());
            staLast.setNodeId(vo.getNodeId());
            if (vo.getPlanId() != null) {
                staLast.setPlanId(assyPlan.getId());
                staLast.setProcessId(assyPlan.getProcess().getId());
                staLast.setNodeId(vo.getNodeId());
            }
            staLast.setWorkType(vo.getWorkType());
            staLast.setStatus(STATUS_NORMAL);
            staLast.setStartTime(new Date());
            count = assemblyWorkLastDao.updateByPrimaryKeySelective(staLast);
@@ -305,20 +311,22 @@
            throw new RuntimeException("数据库存储失败");
        }
        StaAssemblyWorkLast result = assemblyWorkLastDao.selectByPrimaryKey(staLast.getId());
        List<PrProductionNode> nodeInfo = assyPlan.getProcess().getNodes().stream()
                .filter(node -> node.id.equals(vo.getNodeId())).collect(Collectors.toList());
        result.setPlanName(assyPlan.getName());
        result.setProcessName(assyPlan.getProcessName());
        result.setNodeName(assyPlan.getProcess().getNodes().get(0).getContent());
        //找到对应的产品信息
        PltProduct product = productDao.selectByPrimaryKey(assyPlan.getProId());
        if (product == null) {
            throw new RuntimeException("产品信息有误或被其他人员修改,请登录管理系统查看任务关联产品ID为:" + assyPlan.getProId());
        if (assyPlan != null) {
            List<PrProductionNode> nodeInfo = assyPlan.getProcess().getNodes().stream()
                    .filter(node -> node.id.equals(vo.getNodeId())).collect(Collectors.toList());
            result.setPlanName(assyPlan.getName());
            result.setProcessName(assyPlan.getProcessName());
            result.setNodeName(assyPlan.getProcess().getNodes().get(0).getContent());
            //找到对应的产品信息
            PltProduct product = productDao.selectByPrimaryKey(assyPlan.getProId());
            if (product == null) {
                throw new RuntimeException("产品信息有误或被其他人员修改,请登录管理系统查看任务关联产品ID为:" + assyPlan.getProId());
            }
            result.setProId(product.getId());
            result.setProName(product.getName());
            String devicePrefix = QrCodeConstant.TypeProduct + product.getCode() + assyPlan.getBatchNo();
            result.setDevicePrefix(devicePrefix);
        }
        result.setProId(product.getId());
        result.setProName(product.getName());
        String devicePrefix = QrCodeConstant.TypeProduct + product.getCode() + assyPlan.getBatchNo();
        result.setDevicePrefix(devicePrefix);
        return result;
    }