schangxiang@126.com
2025-05-21 fa365d77dfa1d6619774a790e424e98dac849457
修复bug
已修改5个文件
127 ■■■■ 文件已修改
PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Controllers/PipeAccessoryAssembly.ts 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Models/PipeAccessoryAssembly.ts 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Models/Service/PipeAccessoryAssembly.ts 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Views/Pages/PipeAccessoryAssembly/PipeAccessoryAssembly.tsx 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application/Implements/SharedService.cs 61 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Controllers/PipeAccessoryAssembly.ts
@@ -176,6 +176,38 @@
      }
    }) 
  } 
  //法兰冲码完工
  const onFinishSendFlangeCode = () => {
    const names = selection.value.map((item: { dataIdentifier: string }) => item.dataIdentifier)
    if(names.length==0){
      ElMessage.warning('请选择一条记录');
      return;
    }
    if(names.length>1){
      ElMessage.warning('请只能选择一条记录');
      return;
    }
    ConfirmBox(
      `是否要完工法兰冲码${names.length ? names.join(',') : ''}`
    ).then(async () => {
      // 获取选中的第一条记录
  const selectedItem = selection.value[0];
  // 构建参数对象
  const param = {
    processName: selectedItem.processName || '',        // 任务编号
    PipeSpecCode: selectedItem.pipeSpecCode || '',// 管段编码
  };
     var ret= await PipeAccessoryAssembly.finishSendFlangeCode(param)
      if(ret.code=="200"){
        ElMessage.success('完工法兰冲码成功')
        tableRef.value.getList()
      }else{
        ElMessage.error('完工法兰冲码失败:'+ret.message)
      }
    })
  }
  const onCheck = (records: any) => { 
    selection.value = records 
  } 
@@ -305,6 +337,7 @@
    onCheck, 
    onAddPipeAccessoryAssembly, 
    onAdvancedQuery,
    onSendFlangeCode
    onSendFlangeCode,
    onFinishSendFlangeCode
  } 
PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Models/PipeAccessoryAssembly.ts
@@ -3,6 +3,7 @@
  // deletePipeAccessoryAssemblys, 
  // addPipeAccessoryAssembly, 
  sendFlangeCode,
  finishSendFlangeCode,
  cloneData, 
} from './Service/PipeAccessoryAssembly' 
 
@@ -30,6 +31,14 @@
    return sendFlangeCode(data) 
   } 
  /** 
   * 完工法兰冲码
   * @param id
   * @returns
   */
  async finishSendFlangeCode(data: Record<string, any>) {
    return finishSendFlangeCode(data)
   }
  /**
   * 添加数据 
   * @param data 
   * @returns 
PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Models/Service/PipeAccessoryAssembly.ts
@@ -85,3 +85,10 @@
export const sendFlangeCode  = (data: any) => {
  return request.post('/api/v1/PipeLineLems/WorkPlanPublic/sendFlangeCode', data)
}
/**
 * 完工法兰冲码
 * @returns
 */
export const finishSendFlangeCode  = (data: any) => {
  return request.post('/api/v1/PipeLineLems/WorkPlanPublic/SendFlangeCode_FinishProduction', data)
}
PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Views/Pages/PipeAccessoryAssembly/PipeAccessoryAssembly.tsx
@@ -62,7 +62,8 @@
      openDetail,
      onSuccess,
      onBeforeUpload,
      onSendFlangeCode
      onSendFlangeCode,
      onFinishSendFlangeCode
    } = usePipeAccessoryAssembly(props, ctx)
    // 查询表单数据
@@ -206,6 +207,15 @@
        return
      }
       onSendFlangeCode();
    }
     // 完工法兰冲码
     const finishSendFlangeCode = () => {
      console.log('执行 完工法兰冲码')
      if (queryForm.value.pipeSpecCode == '') {
        ElMessage.error('请输入管段编码')
        return
      }
      onFinishSendFlangeCode();
    }
    // 开工事件处理
    const startWork = () => {
@@ -556,6 +566,9 @@
              <ElButton type="warning" onClick={sendFlangeCode}>
                下发法兰冲码
              </ElButton>
              <ElButton type="warning" onClick={finishSendFlangeCode}>
                完工法兰冲码
              </ElButton>
            </div>
            <RenderBaseTable
              url={routeUrl.value}
PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application/Implements/SharedService.cs
@@ -18,6 +18,7 @@
using CMS.Plugin.ProductManagement.Abstractions;
using CMS.Plugin.TraceManagement.Abstractions;
using CMS.Plugin.TraceManagement.Abstractions.Models.Traces;
using CMS.Unit.RuntimeValue.Models;
using CmsQueryExtensions;
using CmsQueryExtensions.Entitys;
using CmsQueryExtensions.Extension;
@@ -711,15 +712,16 @@
        var callMaterialOrderAppService = _serviceProvider.GetRequiredService<ICallMaterialOrderAppService>();
        // 查找数据
        var workTask = await workTaskRepository.GetSingleByFilterAsync(x => x.TaskCode == input.TaskCode);
        if (workTask == null)
        {
            throw new UserFriendlyException($"找不到作业计划");
        }
        var workPlan = await workPlanRepository.GetSingleByFilterAsync(x => x.TaskCode == input.TaskCode);
        if (workPlan == null)
        {
            throw new UserFriendlyException($"找不到作业计划");
        }
        var workTask = await workTaskRepository.GetSingleByFilterAsync(x => x.TaskCode == input.TaskCode && x.ProcessName == workPlan.ProcessName);
        if (workTask == null)
        {
            throw new UserFriendlyException($"找不到作业任务");
        }
        if (workPlan.ProcessName == "装配工序")
        {
@@ -997,21 +999,20 @@
                string _value = "";
                //采集参数
                ReadWriteResult<IVariableValue?>? _getValue = null;
                if (item.Name == $"{processName}压力")
                {
                    var _getValue = await _variableService.ReadValueAsync($"{processName}压力");
                    _value = _getValue.Content.Value.SafeString().ToString();
                     _getValue = await _variableService.ReadValueAsync($"{processName}压力");
                }
                if (item.Name == $"{processName}位置")
                {
                    var _getValue = await _variableService.ReadValueAsync($"{processName}位置");
                    _value = _getValue.Content.Value.SafeString().ToString();
                     _getValue = await _variableService.ReadValueAsync($"{processName}位置");
                }
                if (item.Name == $"{processName}速度")
                {
                    var _getValue = await _variableService.ReadValueAsync($"{processName}速度");
                    _value = _getValue.Content.Value.SafeString().ToString();
                     _getValue = await _variableService.ReadValueAsync($"{processName}速度");
                }
                _value = _getValue?.Content?.Value?.SafeString().ToString();
                if (item.Name == $"{processName}间隙")
                {
@@ -1034,22 +1035,19 @@
                string _value = "";
                //采集参数
                ReadWriteResult<IVariableValue?>? _getValue = null;
                if (item.Name == $"{processName}压力")
                {
                    var _getValue = await _variableService.ReadValueAsync($"{processName}压力");
                    _value = _getValue.Content.Value.SafeString().ToString();
                }
                     _getValue = await _variableService.ReadValueAsync($"{processName}压力");
                if (item.Name == $"{processName}位置")
                {
                    var _getValue = await _variableService.ReadValueAsync($"{processName}位置");
                    _value = _getValue.Content.Value.SafeString().ToString();
                     _getValue = await _variableService.ReadValueAsync($"{processName}位置");
                }
                if (item.Name == $"{processName}速度")
                {
                    var _getValue = await _variableService.ReadValueAsync($"{processName}速度");
                    _value = _getValue.Content.Value.SafeString().ToString();
                     _getValue = await _variableService.ReadValueAsync($"{processName}速度");
                }
                _value = _getValue?.Content?.Value?.SafeString().ToString();
                if (item.Name == $"{processName}间隙")
                {
                    _value = "15mm";
@@ -1413,21 +1411,20 @@
                string _value = "";
                //采集参数
                ReadWriteResult<IVariableValue?>? _getValue = null;
                if (item.Name == $"{processName}压力")
                {
                    var _getValue = await _variableService.ReadValueAsync($"{processName}压力");
                    _value = _getValue.Content.Value.SafeString().ToString();
                    _getValue = await _variableService.ReadValueAsync($"{processName}压力");
                }
                if (item.Name == $"{processName}位置")
                {
                    var _getValue = await _variableService.ReadValueAsync($"{processName}位置");
                    _value = _getValue.Content.Value.SafeString().ToString();
                    _getValue = await _variableService.ReadValueAsync($"{processName}位置");
                }
                if (item.Name == $"{processName}速度")
                {
                    var _getValue = await _variableService.ReadValueAsync($"{processName}速度");
                    _value = _getValue.Content.Value.SafeString().ToString();
                    _getValue = await _variableService.ReadValueAsync($"{processName}速度");
                }
                _value = _getValue?.Content?.Value?.SafeString().ToString();
                if (item.Name == $"{processName}间隙")
                {
@@ -1450,26 +1447,24 @@
                string _value = "";
                //采集参数
                ReadWriteResult<IVariableValue?>? _getValue = null;
                if (item.Name == $"{processName}压力")
                {
                    var _getValue = await _variableService.ReadValueAsync($"{processName}压力");
                    _value = _getValue.Content.Value.SafeString().ToString();
                    _getValue = await _variableService.ReadValueAsync($"{processName}压力");
                }
                if (item.Name == $"{processName}位置")
                {
                    var _getValue = await _variableService.ReadValueAsync($"{processName}位置");
                    _value = _getValue.Content.Value.SafeString().ToString();
                    _getValue = await _variableService.ReadValueAsync($"{processName}位置");
                }
                if (item.Name == $"{processName}速度")
                {
                    var _getValue = await _variableService.ReadValueAsync($"{processName}速度");
                    _value = _getValue.Content.Value.SafeString().ToString();
                    _getValue = await _variableService.ReadValueAsync($"{processName}速度");
                }
                if (item.Name == $"{processName}内容")
                {
                    var _getValue = await _variableService.ReadValueAsync($"{processName}内容");
                    _value = _getValue.Content.Value.SafeString().ToString();
                    _getValue = await _variableService.ReadValueAsync($"{processName}内容");
                }
                _value = _getValue?.Content?.Value?.SafeString().ToString();
                if (item.Name == $"{processName}间隙")
                {