刘磊
2024-11-23 06cbf02daf958a1f4687691e5d9d741a21a2fe53
合并
已删除1个文件
已修改18个文件
已添加1个文件
6583 ■■■■ 文件已修改
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSClient/report_form_rollup-plugin-visualizer.html 4842 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSClient/src/extension/widesea_wms/stock/Dt_BillGroupStock.jsx 48 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSClient/src/extension/widesea_wms/stock/Dt_BillGroupStockDetail.js 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSClient/src/extension/widesea_wms/stock/demo_Product/Dt_BillGroupStockDetail.vue 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSClient/src/router/tables.js 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSClient/src/views/Login.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSClient/src/views/widesea_wms/stock/Dt_BillGroupStock.vue 33 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSClient/src/views/widesea_wms/taskinfo/Dt_Task.vue 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Common/HttpClient/HttpsClient.cs 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Core/Enums/ManageEnum.cs 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Core/Extensions/AutofacModuleRegister.cs 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_DTO/MOM/AgingOutputDto.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_DTO/MOM/CellState/TrayCellsStatusDto.cs 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_DTO/MOM/ResponeAgingInputDto.cs 50 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/BasicModel/DtStockInfo.cs 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/Stock/StockInfoService.cs 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService - 复制.cs 1192 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs 298 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs
@@ -571,9 +571,9 @@
                #region WMS同步任务完成
                var keys = new Dictionary<string, object>()
            {
                {"taskNum", taskNum}
            };
                {
                    {"taskNum", taskNum}
                };
                // èŽ·å–WMSip地址
                var config = _sys_ConfigService.GetConfigsByCategory(CateGoryConst.CONFIG_SYS_IPAddress);
                var wmsBase = config.FirstOrDefault(x => x.ConfigKey == SysConfigKeyConst.WMSIP_BASE)?.ConfigValue;
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs
@@ -156,7 +156,7 @@
                var task = _taskService.QueryBarCodeConveyorLineTask(command.Barcode, childDeviceCode);
                HandleTaskOut(conveyorLine, command, childDeviceCode, ProtocalDetailValue, task);
                if (task == null && command.Barcode != "NoRead")
                if (task == null && command.Barcode != "NoRead" && !command.Barcode.IsNotEmptyOrNull())
                {
                    HandleNewTask(conveyorLine, command, childDeviceCode, ProtocalDetailValue);
                }
Code Management/WMS/WIDESEA_WMSClient/report_form_rollup-plugin-visualizer.html
¶Ô±ÈÐÂÎļþ
ÎļþÌ«´ó
Code Management/WMS/WIDESEA_WMSClient/src/extension/widesea_wms/stock/Dt_BillGroupStock.jsx
@@ -7,12 +7,12 @@
 *****************************************************************************************/
//此js文件是用来自定义扩展业务代码,可以扩展一些自定义页面或者重新配置生成的代码
import gridHeader from "./demo_Product/Dt_BillGroupStockDetail.vue";
// import gridHeader from "./demo_Product/Dt_BillGroupStockDetail.vue";
let extension = {
  components: {
    //查询界面扩展组件
    gridHeader: gridHeader,
    gridHeader: "",
    gridBody: "",
    gridFooter: "",
    //新建、编辑弹出框扩展组件
@@ -39,28 +39,28 @@
      //示例:设置修改新建、编辑弹出框字段标签的长度
      this.boxOptions.labelWidth = 150;
      this.columns.push({
        title: "操作",
        field: "操作",
        width: 150,
        align: "left", // 'center',
        render: (h, { row, column, index }) => {
          return (
            <div>
              <el-button
                onClick={($e) => {
                  this.$refs.gridHeader.openModel1(row);
                }}
                type="primary"
                plain
                style="height:26px; padding: 10px !important;"
              >
                æŸ¥çœ‹åº“存明细
              </el-button>
            </div>
          );
        },
      });
      // this.columns.push({
      //   title: "操作",
      //   field: "操作",
      //   width: 150,
      //   align: "left", // 'center',
      //   render: (h, { row, column, index }) => {
      //     return (
      //       <div>
      //         <el-button
      //           onClick={($e) => {
      //             this.$refs.gridHeader.openModel1(row);
      //           }}
      //           type="primary"
      //           plain
      //           style="height:26px; padding: 10px !important;"
      //         >
      //           æŸ¥çœ‹åº“存明细
      //         </el-button>
      //       </div>
      //     );
      //   },
      // });
    },
    onInited() {
      //框架初始化配置后
Code Management/WMS/WIDESEA_WMSClient/src/extension/widesea_wms/stock/Dt_BillGroupStockDetail.js
@@ -35,6 +35,13 @@
        //示例:设置修改新建、编辑弹出框字段标签的长度
        this.boxOptions.labelWidth = 150;
        // openModel1 = function (row) {
        //   palletCode.value = row.palletCode;
        //   searchFormFields.value.stockId = row.id;
        //   model1.value = true;
        //   this.$refs.gridHeader.openModel1();
        // }
    },
    onInited() {
      //框架初始化配置后
Code Management/WMS/WIDESEA_WMSClient/src/extension/widesea_wms/stock/demo_Product/Dt_BillGroupStockDetail.vue
@@ -6,8 +6,8 @@
 -->
<template>
    <vol-box :lazy="true" v-model="model1" title="库存明细信息" :width="1820" :padding="5" :onModelClose="onModelClose">
        <view-grid ref="grid" :columns="columns" :searchFormFields="searchFormFields"
            :searchFormOptions="searchFormOptions" :table="table" :extend="extend">
        <view-grid ref="grid" :columns="columns" :searchFormFields="searchFormFields" :editFormFields="editFormFields"
            :editFormOptions="editFormOptions" :searchFormOptions="searchFormOptions" :table="table" :extend="extend">
        </view-grid>
        <template #footer>
            <div>
@@ -20,7 +20,7 @@
<script>
import extend from "@/extension/widesea_wms/stock/Dt_BillGroupStockDetail.js";
import VolBox from '@/components/basic/VolBox.vue';
import { ref, defineComponent } from "vue";
import { ref, defineComponent, getCurrentInstance } from "vue";
export default defineComponent({
    setup() {
        const table = ref({
@@ -33,7 +33,7 @@
        });
        const editFormFields = ref({
            "palletCode": "",
            "materialNo": ""
            "materialNo": "",
        });
        const editFormOptions = ref([
            [
@@ -43,7 +43,8 @@
        ]);
        const searchFormFields = ref({
            "palletCode": "",
            "materialNo": ""
            "materialNo": "",
            "stockId": 0
        });
        const searchFormOptions = ref([
            [
@@ -77,11 +78,11 @@
        const model1 = ref(false);
        const palletCode = ref("");
        const openModel1 = (row)=>{
        const openModel1 = (row) => {
            palletCode.value = row.palletCode;
            searchFormFields.value.stockId = row.id;
            model1.value = true;
        }
        return {
            table,
@@ -99,7 +100,7 @@
        };
    },
    components: {
        'vol-box': VolBox
        'vol-box': VolBox
    },
});
</script>
Code Management/WMS/WIDESEA_WMSClient/src/router/tables.js
@@ -12,13 +12,16 @@
    name: 'Dt_BillGroupStock',
    component: () => import('@/views/widesea_wms/stock/Dt_BillGroupStock.vue'),
    meta: {
      keepAlive: false
      keepAlive: true
    }
  },
  // {
  //   path: '/Dt_BillGroupStockDetail',
  //   name: 'Dt_BillGroupStockDetail',
  //   component: () => import('@/views/widesea_wms/stock/Dt_BillGroupStockDetail.vue')
  //   component: () => import('@/views/widesea_wms/stock/Dt_BillGroupStockDetail.vue'),
  //   meta: {
  //     keepAlive: true
  //   }
  // },
  {
    path: '/Dt_InboundOrder',
Code Management/WMS/WIDESEA_WMSClient/src/views/Login.vue
@@ -103,7 +103,7 @@
    const userInfo = reactive({
      userName: '',
      password: '',
      verificationCode: '',
      verificationCode: '1234',
      UUID: undefined
    });
Code Management/WMS/WIDESEA_WMSClient/src/views/widesea_wms/stock/Dt_BillGroupStock.vue
@@ -4,6 +4,7 @@
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/widesea_wms/stock/Dt_BillGroupStock.js此处编写
 -->
<template>
    <view-grid ref="grid" :columns="columns" :detail="detail" :editFormFields="editFormFields"
        :editFormOptions="editFormOptions" :searchFormFields="searchFormFields" :searchFormOptions="searchFormOptions"
@@ -46,21 +47,23 @@
                { "title": "组盘类型", "field": "groupType", type: "select", dataKey: "GroupType", data: [] },
            ]
        ]);
        const columns = ref([{ field: 'id', title: '库存ID', type: 'int', width: 110, hidden: true, readonly: true, require: true, align: 'left' },
        { field: 'locationCode', title: '库位', type: 'string', width: 110, align: 'left' },
        { field: 'palletCode', title: '托盘条码', type: 'string', width: 110, align: 'left', sort: true },
        { field: 'isFull', title: '是否满盘', type: 'bool', width: 110, align: 'left' },
        // { field: 'state', title: '库存状态', type: 'int', width: 110, align: 'left', bind: { key: "StockState", data: [] } },
        { field: 'LinedProcessFeedbackTime', title: '工艺开始时间', type: 'string', width: 110, align: 'left', sort: true },
        { field: 'SpecialParameterDuration', title: '工艺时长', type: 'string', width: 110, align: 'left', sort: true },
        { field: 'OutboundTime', title: '应出库时间', type: 'string', width: 110, align: 'left', sort: true },
        { field: 'remark', title: '备注', type: 'string', width: 120, hidden: true, align: 'left' },
        { field: 'createID', title: '创建ID', type: 'int', sort: true, width: 100, hidden: true, align: 'left' },
        { field: 'creater', title: '创建人', type: 'string', sort: true, width: 110, align: 'left' },
        { field: 'createDate', title: '创建时间', type: 'datetime', sort: true, width: 150, align: 'left', sort: true },
        { field: 'modifyID', title: '修改人ID', type: 'int', sort: true, width: 100, hidden: true, align: 'left' },
        { field: 'modifier', title: '最后修改人', type: 'string', sort: true, width: 100, align: 'left' },
        { field: 'modifyDate', title: '最后修改时间', type: 'datetime', sort: true, width: 150, align: 'left', sort: true },]);
        const columns = ref(
            [{ field: 'id', title: '库存ID', type: 'int', width: 110, hidden: true, readonly: true, require: true, align: 'left' },
            { field: 'locationCode', title: '库位', type: 'string', width: 110, align: 'left' },
            { field: 'palletCode', title: '托盘条码', type: 'string', width: 110, align: 'left', sort: true },
            { field: 'isFull', title: '是否实盘', type: 'bool', width: 110, align: 'left' },
            { field: 'linedProcessFeedbackTime', title: '工艺开始时间', type: 'string', width: 110, align: 'left', sort: true },
            { field: 'specialParameterDuration', title: '工艺时长', type: 'string', width: 110, align: 'left', sort: true },
            { field: 'outboundTime', title: '应出库时间', type: 'string', width: 110, align: 'left', sort: true },
            { field: 'productionLine', title: '生产产线', type: 'string', width: 110, align: 'left', sort: true },
            { field: 'areaCode', title: '库区', type: 'string', width: 110, align: 'left', sort: true },
            { field: 'remark', title: '电芯数量', type: 'string', width: 120, align: 'left' },
            { field: 'creater', title: '创建人', type: 'string', sort: true, width: 110, align: 'left', hidden: true },
            { field: 'createDate', title: '创建时间', type: 'datetime', sort: true, width: 150, align: 'left', sort: true },
            { field: 'modifier', title: '最后修改人', type: 'string', sort: true, width: 100, hidden: true, align: 'left' },
                // { field: 'modifyDate', title: '最后修改时间', type: 'datetime', sort: true, width: 150, align: 'left', sort: true },
            ]
        );
        const detail = ref({
            cnName: "#detailCnName",
            table: "#detailTable",
Code Management/WMS/WIDESEA_WMSClient/src/views/widesea_wms/taskinfo/Dt_Task.vue
@@ -42,13 +42,12 @@
            ],
        ]);
        const searchFormFields = ref({
            taskType: 200,
        });
        const searchFormOptions = ref([
            [
                { "title": "任务号", "field": "taskNum", "type": "text" },
                { "title": "托盘号", "field": "palletCode", "type": "text" },
                { "title": "任务类型", "field": "taskType", "type": "select", dataKey: "TaskType", data: [], hidden: true },
                { "title": "任务类型", "field": "taskType", "type": "select", dataKey: "TaskType", data: [] },
                { "title": "任务状态", "field": "taskState", "type": "select", dataKey: "TaskStatus", data: [] },
            ],
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Common/HttpClient/HttpsClient.cs
@@ -16,7 +16,7 @@
    public static async Task<string> GetAsync(string url, Dictionary<string, object> parameters)
    {
        // è®°å½•请求参数
        LogRequestParameters(parameters);
        LogRequestParameters(parameters, url);
        // å°†å‚数拼接到URL中
        string queryString = string.Join("&", parameters.Select(x => $"{x.Key}={x.Value}"));
@@ -35,7 +35,7 @@
            string responseBody = await response.Content.ReadAsStringAsync();
            // è®°å½•响应参数
            LogResponseParameters(responseBody);
            LogResponseParameters(responseBody, url);
            // è¿”回响应内容
            return responseBody;
@@ -46,7 +46,7 @@
    public static async Task<string> PostAsync(string url, Dictionary<string, object> parameters)
    {
        // è®°å½•请求参数
        LogRequestParameters(parameters);
        LogRequestParameters(parameters, url);
        // åˆ›å»ºHttpClient实例
        using (HttpClient client = new HttpClient())
@@ -69,21 +69,21 @@
            string responseBody = await response.Content.ReadAsStringAsync();
            // è®°å½•响应参数
            LogResponseParameters(responseBody);
            LogResponseParameters(responseBody, url);
            // è¿”回响应内容
            return responseBody;
        }
    }
    private static void LogRequestParameters(Dictionary<string, object> parameters)
    private static void LogRequestParameters(Dictionary<string, object> parameters,string url = "")
    {
        LogFactory.GetLog("API接口").Info(true, "请求参数: " + JsonConvert.SerializeObject(parameters));
        LogFactory.GetLog("API接口").Info(true, "url:" + url + "请求参数: " + JsonConvert.SerializeObject(parameters));
    }
    private static void LogResponseParameters(string responseBody)
    private static void LogResponseParameters(string responseBody, string url = "")
    {
        LogFactory.GetLog("API接口").Info(true, "响应参数: " + responseBody);
        LogFactory.GetLog("API接口").Info(true, "url:" + url + "响应参数: " + responseBody);
    }
    private static IEnumerable<KeyValuePair<string, string>> ConvertToKeyValuePairs(Dictionary<string, object> parameters)
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Core/Enums/ManageEnum.cs
@@ -125,6 +125,12 @@
        /// </summary>
        [Description("空托盘入库")]
        InTray = 204,
        /// <summary>
        /// NG入库
        /// </summary>
        [Description("NG入库")]
        InNG = 105,
    }
    public enum TaskOutboundTypeEnum
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Core/Extensions/AutofacModuleRegister.cs
@@ -58,16 +58,16 @@
                        .InterceptedBy(cacheType.ToArray());
            foreach (var assembly in assemblyList)
            {
                foreach (var type in assembly.GetTypes())
                {
                    if (!type.IsInterface && !type.IsAbstract && baseType.IsAssignableFrom(type))
                    {
                        Console.WriteLine($"注册类型: {type.FullName}");
                    }
                }
            }
            //foreach (var assembly in assemblyList)
            //{
            //    foreach (var type in assembly.GetTypes())
            //    {
            //        if (!type.IsInterface && !type.IsAbstract && baseType.IsAssignableFrom(type))
            //        {
            //            Console.WriteLine($"注册类型: {type.FullName}");
            //        }
            //    }
            //}
            builder.RegisterType<UnitOfWorkManage>().As<IUnitOfWorkManage>()
               .AsImplementedInterfaces()
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_DTO/MOM/AgingOutputDto.cs
@@ -38,10 +38,10 @@
    /// <summary>
    /// å‚æ•°
    /// </summary>
    public List<ParameterInfo> ParameterInfo { get; set; }
    public List<ParameterInfoOutput> ParameterInfo { get; set; }
}
public class ParameterInfo
public class ParameterInfoOutput
{
    /// <summary>
    /// å‚数编码
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_DTO/MOM/CellState/TrayCellsStatusDto.cs
@@ -9,4 +9,9 @@
    /// æ‰˜ç›˜ç¼–号
    /// </summary>
    public string TrayBarcode { get; set; }
    /// <summary>
    /// ä¸Šä¼ ç±»åž‹
    /// </summary>
    public string SceneType { get; set; } = "4";
}
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_DTO/MOM/ResponeAgingInputDto.cs
@@ -40,5 +40,55 @@
        /// å•位
        /// </summary>
        public string UomCode { get; set; }
        public List<ParameterInfo> ParameterInfos { get; set; }
    }
    public class ParameterInfo
    {
        /// <summary>
        /// å‚数类型属性,对应 "ParameterType"
        /// </summary>
        public string ParameterType { get; set; }
        /// <summary>
        /// ç›®æ ‡å€¼å±žæ€§ï¼Œå¯¹åº” "TargetValue"
        /// </summary>
        public string TargetValue { get; set; }
        /// <summary>
        /// å•位代码属性,对应 "UOMCode"
        /// </summary>
        public string UOMCode { get; set; }
        /// <summary>
        /// ä¸ŠæŽ§åˆ¶é™å±žæ€§ï¼Œå¯¹åº” "UpperControlLimit"
        /// </summary>
        public string UpperControlLimit { get; set; }
        /// <summary>
        /// ä¸‹æŽ§åˆ¶é™å±žæ€§ï¼Œå¯¹åº” "LowerControlLimit"
        /// </summary>
        public string LowerControlLimit { get; set; }
        /// <summary>
        /// ä¸Šè§„格限属性,对应 "UpperSpecificationsLimit"
        /// </summary>
        public string UpperSpecificationsLimit { get; set; }
        /// <summary>
        /// ä¸‹è§„格限属性,对应 "LowerSpecificationsLimit"
        /// </summary>
        public string LowerSpecificationsLimit { get; set; }
        /// <summary>
        /// è®¾å¤‡å¯ç”¨æ€§æ ‡å¿—属性,对应 "EquipmentAvailabilityFlag"
        /// </summary>
        public bool EquipmentAvailabilityFlag { get; set; }
        /// <summary>
        /// æè¿°å±žæ€§ï¼Œå¯¹åº” "Description"
        /// </summary>
        public string Description { get; set; }
        /// <summary>
        /// å‚数版本属性,对应 "ParamVersion"
        /// </summary>
        public string ParamVersion { get; set; }
        /// <summary>
        /// å‚数代码属性,对应 "ParameterCode"
        /// </summary>
        public string ParameterCode { get; set; }
    }
}
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/BasicModel/DtStockInfo.cs
@@ -75,6 +75,18 @@
        public DateTime? OutboundTime { get; set; }
        /// <summary>
        /// å‚数信息
        /// </summary>
        [SugarColumn(IsNullable = true, ColumnDescription = "参数信息")]
        public string ParameterInfos {  get; set; }
        /// <summary>
        /// åº“存状态
        /// </summary>
        [SugarColumn(IsNullable = true, ColumnDescription = "库存状态")]
        public int StockStatus { get; set; }
        /// <summary>
        /// åº“存明细
        /// </summary>
        [SugarColumn(ColumnName = "StockInfoDetails")]
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/Stock/StockInfoService.cs
@@ -1,8 +1,19 @@
namespace WIDESEA_StorageBasicService;

namespace WIDESEA_StorageBasicService;
public class StockInfoService : ServiceBase<DtStockInfo, IStockInfoRepository>, IStockInfoService
{
    public StockInfoService(IStockInfoRepository BaseDal) : base(BaseDal)
    {
    }
    public override PageGridData<DtStockInfo> GetPageData(PageDataOptions options)
    {
        var data = base.GetPageData(options);
        foreach (var item in data.Rows)
        {
            item.Remark = item.StockInfoDetails.Count().ToString();
        }
        return data;
    }
}
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService - ¸´ÖÆ.cs
ÎļþÒÑɾ³ý
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs
@@ -2,6 +2,8 @@
using Mapster;
using Masuit.Tools;
using Masuit.Tools.Models;
using System.Linq;
using System.Threading.Tasks;
using WIDESEA_DTO.MOM;
using WIDESEA_DTO.WMS;
using WIDESEA_IStorageBasicRepository;
@@ -137,6 +139,13 @@
        {
            throw new Exception("未找到对应的库区信息");
        }
        var parameterInfo = JsonConvert.DeserializeObject<List<ParameterInfo>>(stock.ParameterInfos).FirstOrDefault(y => y.Description.Contains("时间"));
        if (parameterInfo == null) throw new Exception("");
        var outHours = (DateTime.Now - stock.OutboundTime.Value).TotalHours;
        var isNG = outHours > parameterInfo.LowerSpecificationsLimit.ToDouble() && outHours < parameterInfo.UpperSpecificationsLimit.ToDouble();
        return new AgingOutputDto
        {
            OpFlag = 1,
@@ -148,18 +157,17 @@
                SlotNo = x.OrderNo.ToInt32(),
                SerialNo = x.SerialNumber,
                SerialNoResult = true,
                ParameterInfo = new List<ParameterInfo> { new ParameterInfo() { Value = (DateTime.Now - stock.CreateDate).TotalMinutes.ToString() } }
                //ParameterInfo = info.ParameterInfo.Select(y => new ParameterInfo()
                //{
                //    LowerLomit = y.LowerControlLimit,
                //    UpperLimit = y.UpperControlLimit,
                //    ParameterResult = y.EquipmentAvailabilityFlag,
                //    ParameterCode = y.ParameterCode,
                //    ParameterDesc = y.Description,
                //    TargetValue = y.TargetValue,
                //    Value = (DateTime.Parse(stock.LinedProcessFeedbackTime, null, System.Globalization.DateTimeStyles.RoundtripKind).ToLocalTime() - stock.CreateDate).TotalMinutes.ToString(),
                //    DefectCode = y.UOMCode
                //}).ToList()
                ParameterInfo = new List<ParameterInfoOutput> {
                    new ParameterInfoOutput() {
                        Value = outHours.ToString(),
                        ParameterCode =parameterInfo.ParameterCode,
                        ParameterDesc = parameterInfo.Description,
                        ParameterResult  = isNG.ToString(),
                        TargetValue = parameterInfo.TargetValue,
                        LowerLomit = parameterInfo.LowerSpecificationsLimit,
                        UpperLimit = parameterInfo.UpperSpecificationsLimit,
                    }
                }
            }).ToList()
        };
    }
@@ -176,7 +184,7 @@
    private (DtLocationInfo, Dt_Task) UpdateStockAndTaskStatus(DtStockInfo stock, Dt_Task task)
    {
        var location = _locationRepository.QueryFirst(x => x.LocationCode == task.SourceAddress);
        var details = _stockInfoDetailRepository.QueryData(x => x.StockId == stock.Id);
        //var details = _stockInfoDetailRepository.QueryData(x => x.StockId == stock.Id);
        location.LocationStatus = (int)LocationEnum.Free;
        task.TaskState = (int)TaskOutStatusEnum.OutFinish;
@@ -272,6 +280,27 @@
        WebResponseContent content = new WebResponseContent();
        try
        {
            if (task.TaskType == (int)TaskInboundTypeEnum.InNG)
            {
                task.TaskState = (int)TaskInStatusEnum.SC_InFinish;
                // åˆ›å»ºåŽ†å²ä»»åŠ¡å®žä¾‹æ¨¡åž‹
                var taskHtyNG = CreateHistoricalTask(task);
                // æ‰§è¡Œæ•°æ®åº“事务
                await _unitOfWorkManage.UseTranAsync(async () =>
                {
                    // æ·»åŠ åŽ†å²ä»»åŠ¡
                    var isTaskHtyAdd = await _task_HtyRepository.AddDataAsync(taskHtyNG) > 0;
                    // åˆ é™¤ä»»åŠ¡æ•°æ®
                    var isTaskDelete = await Delete(task.TaskId);
                    if (!isTaskHtyAdd || !isTaskDelete)
                        throw new Exception("添加失败");
                });
                return content.OK("入库任务完成成功");
            }
            // èŽ·å–è£…ç®±ä¿¡æ¯å’Œç›®æ ‡ä½ç½®ä¿¡æ¯
            var boxing = await _boxingInfoRepository.QueryFirstNavAsync(x => x.PalletCode == task.PalletCode);
            var locationInf = await _locationRepository.QueryFirstAsync(x => x.LocationCode == task.TargetAddress);
@@ -358,27 +387,28 @@
            LocationId = loation.Id,
            StockInfoDetails = boxDetail,
        };
        if (!task.Roadway.Contains("FR")) //非分容库区均上报MOM出入站
        // å¤„理请求参数
        AgingInputDto agingInputDto = new AgingInputDto()
        {
            // å¤„理请求参数
            AgingInputDto agingInputDto = new AgingInputDto()
            {
                SerialNos = boxing.BoxingInfoDetails
                    .Select(item => new SerialNoInDto { SerialNo = item.SerialNumber, PositionNo = item.OrderNo })
                    .ToList(),
                TrayBarcode = task.PalletCode,
                OpFlag = 1,
                EquipmentCode = area.Spare2,
                Software = area.Spare3
            };
            var result = _agingInOrOutInputService.GetOCVInputAsync(agingInputDto).Result;
            var respone = JsonConvert.DeserializeObject<ResponeAgingInputDto>(result.Data.ToString());
            stock.LinedProcessFeedbackTime = respone.LinedProcessFeedbackTime;
            stock.SpecialParameterDuration = respone.SpecialParameterDuration;
            //2024å¹´11月16日:新增字段计算应出库时间
            stock.OutboundTime = Convert.ToDateTime(respone.LinedProcessFeedbackTime).AddHours(Convert.ToDouble(respone.SpecialParameterDuration));
            stock.ProductionLine = respone.ProductionLine;
        }
            SerialNos = boxing.BoxingInfoDetails
                .Select(item => new SerialNoInDto { SerialNo = item.SerialNumber, PositionNo = item.OrderNo })
                .ToList(),
            TrayBarcode = task.PalletCode,
            OpFlag = 1,
            EquipmentCode = area.Spare2,
            Software = area.Spare3
        };
        var result = _agingInOrOutInputService.GetOCVInputAsync(agingInputDto).Result;
        var respone = JsonConvert.DeserializeObject<ResponeAgingInputDto>(result.Data.ToString());
        stock.LinedProcessFeedbackTime = respone.LinedProcessFeedbackTime;
        stock.SpecialParameterDuration = respone.SpecialParameterDuration;
        //2024å¹´11月16日:新增字段计算应出库时间
        stock.OutboundTime = Convert.ToDateTime(respone.LinedProcessFeedbackTime).AddHours(Convert.ToDouble(respone.SpecialParameterDuration));
        stock.ProductionLine = respone.ProductionLine;
        stock.ParameterInfos = respone.ParameterInfos.ToJsonString();
        stock.StockStatus = 1;
        // è®°å½•日志
        LogFactory.GetLog("任务完成").InfoFormat(true, "入库任务完成", $"货位地址:{task.TargetAddress},修改后货位数据:{locationInf}");
@@ -475,6 +505,13 @@
                }
            }
            var stock = await _stockInfoRepository.QueryFirstNavAsync(x => x.PalletCode == input.PalletCode && x.IsFull);
            if (stock != null)
            {
                // TODO质检回库
            }
            var area = await _areaInfoRepository.QueryFirstAsync(x => x.Spare1.Contains(input.Position));
            if (area == null)
                return content.Error("改点位不在区域列表中存在");
@@ -496,8 +533,25 @@
            // æ·»åŠ ç»„ç›˜ä¿¡æ¯
            // å°†content.Data转换为ResultTrayCellsStatus对象
            var result = JsonConvert.DeserializeObject<ResultTrayCellsStatus>(content.Data.ToString());
            if (result.SerialNos.Count <= 0)
            if (!result.Success)
                return content.Error(result.MOMMessage);
            // èŽ·å–å¼‚å¸¸ç”µèŠ¯
            var serialNosError = result.SerialNos.Where(x => x.SerialNoStatus != 1).ToList();
            if (serialNosError.Count > 0)
            {
                // TODO åˆ›å»ºä»»åŠ¡é€è‡³NG排出口
                List<string> NGStation = input.Position == "1088" ? new List<string>() { "1020" } : new List<string>() { "JZSC01" };
                content = await CreateNewTask(input, NGStation, 2);
                return content.Error("存在异常电芯");
            }
            if (result.SerialNos.Count <= 0)
            {
                // Todo ç©ºæ‰˜ç›˜å…¥åº“逻辑
                content = await RequestTrayInTaskAsync(input);
                return content;
            }
            // TODO èŽ·å–æœ¬åœ°æ–™æ¡†å±žæ€§ä¸Žæ•´ç›˜ç”µèŠ¯å±žæ€§èŽ·å–çš„å€¼è¿›è¡Œå¯¹æ¯”ï¼Œå¦‚æžœä¸€è‡´åˆ™ç»§ç»­ï¼Œå¦åˆ™è¿”å›žé”™è¯¯ä¿¡æ¯
            //var productions = await _productionRepository.QueryDataAsync(x => result.TrayBarcodePropertys.Select(x => x.TrayBarcodeProperty).ToList().Contains(x.TrayBarcodeProperty));
@@ -608,7 +662,6 @@
            List<string> strings = input.Position == "1016" ? new List<string>() { "CHSC01" } : new List<string>() { "JZSC01" };
            return await CreateNewTask(input, strings, 1);
            //return await CreateNewTask(input, null, 1);
        }
        catch (Exception)
        {
@@ -654,38 +707,6 @@
                SerialNo = item.SerialNo
            }).ToList()
        };
    }
    // èŽ·å–å·¥è‰ºå“åº”
    private async Task<List<Dt_EquipmentProcess>> GetProcessResponseAsync(ProcessApplyDto process, string position)
    {
        // å¦‚æžœprocess为null,则返回null
        if (process == null) return null;
        // è°ƒç”¨_processApplyService.GetProcessApplyAsync方法,获取工艺申请
        WebResponseContent content = await _processApplyService.GetProcessApplyAsync(process);
        // å¦‚果状态为false,则返回null
        if (!content.Status) return null;
        // å°†content.Data转换为ResultProcessApply对象
        var apply = JsonConvert.DeserializeObject<ResultProcessApply>(content.Data.ToString());
        // æ ¹æ®position的值,返回不同的Dt_EquipmentProcess列表
        switch (position)
        {
            case "1088":
                return SqlSugarHelper.Db.Queryable<Dt_EquipmentProcess>()
                    .Where(x => x.EquipmentType == "陈化" && x.WipOrderNo == apply.WipOrderNo || x.ProductDesc == apply.ProductNo)
                    .ToList();
            case "1339":
            case "1406":
                return SqlSugarHelper.Db.Queryable<Dt_EquipmentProcess>()
                    .Where(x => x.EquipmentType == "静置" && x.WipOrderNo == apply.WipOrderNo || x.ProductDesc == apply.ProductNo)
                    .ToList();
            default:
                return new List<Dt_EquipmentProcess>();
        }
    }
    #endregion è¯·æ±‚任务入库
@@ -856,7 +877,7 @@
            if (task == null)
                return content.Error("未找到任务");
            if (taskState == (int)TaskOutStatusEnum.Line_OutFinish || taskState == (int)TaskOutStatusEnum.SC_OutFinish)
            if (taskState == (int)TaskOutStatusEnum.Line_OutFinish || taskState == (int)TaskInStatusEnum.SC_InFinish)
            {
                var taskHty = CreateHistoricalTask(task);
                await _unitOfWorkManage.UseTranAsync(async () =>
@@ -1147,12 +1168,13 @@
    /// <param name="taskHty">历史任务对象</param>
    /// <param name="taskId">任务ID</param>
    /// <returns></returns>
    private async Task<bool> ExecuteTransaction(DtStockInfo stock, Dt_Task_Hty taskHty, DtLocationInfo locationInfo, int taskId)
    private async Task<bool> ExecuteTransaction(DtStockInfo stock, Dt_Task_Hty taskHty, DtLocationInfo locationInfo, int taskId, DtBoxingInfo boxingInfo = null)
    {
        _unitOfWorkManage.BeginTran();
        try
        {
            var isUpdateStock = true;
            var isDeleteBoxing = true;
            if (taskHty.TaskType == (int)TaskTypeEnum.Outbound)
            {
                // æ›´æ–°åº“å­˜
@@ -1162,6 +1184,9 @@
            {
                // æ·»åŠ åº“å­˜
                isUpdateStock = await _stockInfoRepository.AddDataNavAsync(stock);
                isDeleteBoxing = await _boxingInfoRepository.Db.DeleteNav<DtBoxingInfo>(x => x.Id == boxingInfo.Id)
                   .Include(x => x.BoxingInfoDetails)
                   .ExecuteCommandAsync();
            }
@@ -1176,7 +1201,7 @@
            var isTaskDelete = await Delete(taskId);
            // æäº¤æˆ–回滚事务
            if (isUpdateStock && isTaskHtyAdd && isTaskDelete && isUpdateLoc)
            if (isUpdateStock && isTaskHtyAdd && isTaskDelete && isUpdateLoc && isDeleteBoxing)
            {
                LogFactory.GetLog("任务完成").InfoFormat(true, "任务完成", $"事务处理完成,提交事务。添加历史任务:{isTaskHtyAdd},删除任务数据:{isTaskDelete},更新或添加库存:{isUpdateStock},修改移库前货位状态:{isUpdateLoc}");
                _unitOfWorkManage.CommitTran();
@@ -1191,7 +1216,7 @@
        }
        catch (Exception err)
        {
            LogFactory.GetLog("任务完成").InfoFormat(true, $"移库任务完成,系统异常,异常信息:{err.Message}", "无参数");
            LogFactory.GetLog("任务完成").InfoFormat(true, $"任务完成,系统异常,异常信息:{err.Message}", "无参数");
            _unitOfWorkManage.RollbackTran();
            throw; // æŠ›å‡ºå¼‚常以便外部捕获
        }
@@ -1199,54 +1224,87 @@
    #region ä»»åŠ¡è¯·æ±‚æ–¹æ³•
    /// <summary>
    /// æ›´æ–°çŽ°æœ‰ä»»åŠ¡
    /// </summary>
    /// <param name="input">请求模型</param>
    /// <param name="areaId">区域ID</param>
    /// <param name="task">任务实例</param>
    /// <param name="content">响应内容</param>
    /// <returns></returns>
    // æ›´æ–°ä»»åŠ¡è´§ä½
    private async Task<WebResponseContent> UpdateExistingTask(RequestTaskDto input, Dt_Task task)
    {
        // åˆ›å»ºWebResponseContent对象
        WebResponseContent content = new WebResponseContent();
        // å®šä¹‰å˜é‡
        string toAddress;
        int taskState;
        string original = task.CurrentAddress;
        DtLocationInfo location = new DtLocationInfo();
        int beforeStatus = 0;
        if (task == null)
        {
            return new WebResponseContent().Error("任务对象为空");
        }
        // å¤„理入库任务
        location = await GetLocationDistributeAsync(task.Roadway);
        toAddress = location.LocationCode;
        taskState = (int)TaskInStatusEnum.Line_InFinish;
        beforeStatus = location.LocationStatus;
        try
        {
            // åˆ›å»ºWebResponseContent对象
            var content = new WebResponseContent();
        // æ›´æ–°è´§ä½ä¿¡æ¯
        location.LocationStatus = (int)LocationEnum.Lock;
            // èŽ·å–ç›®æ ‡åœ°å€å’Œæ›´æ–°ä»»åŠ¡çŠ¶æ€
            if (task.TaskType == (int)TaskInboundTypeEnum.InNG)
            {
                // TODO æ ¹æ®å··é“查找对应NG口,现在默认去静置堆垛机的异常口货位号
                task.CurrentAddress = input.Position;
                task.TargetAddress = "002-021-000";
                task.NextAddress = "002-021-000";
                task.TaskState = (int)TaskInStatusEnum.Line_InFinish;
                bool isResult = await BaseDal.UpdateDataAsync(task);
                return content.OK(data: task);
            }
            else
            {
                var location = await GetLocationDistributeAsync(task.Roadway);
                if (location == null)
                {
                    return content.Error("无法获取货位信息");
                }
        // æ›´æ–°ä»»åŠ¡ä¿¡æ¯
                string toAddress = location.LocationCode;
                int taskState = (int)TaskInStatusEnum.Line_InFinish;
                int beforeStatus = location.LocationStatus;
                // æ›´æ–°è´§ä½ä¿¡æ¯
                location.LocationStatus = (int)LocationEnum.Lock;
                // æ›´æ–°ä»»åŠ¡ä¿¡æ¯
                MapTaskProperties(task, input, toAddress, taskState);
                // å¼€å§‹äº‹åŠ¡
                var isResult = await UpdateTaskAsync(task, location, beforeStatus);
                if (!isResult)
                {
                    _unitOfWorkManage.RollbackTran();
                    return content.Error("更新任务失败");
                }
                // æäº¤äº‹åŠ¡
                _unitOfWorkManage.CommitTran();
                return content.OK(data: task);
            }
        }
        catch (Exception ex)
        {
            // å›žæ»šäº‹åŠ¡
            _unitOfWorkManage.RollbackTran();
            // è¿™é‡Œå¯ä»¥æ·»åŠ æ—¥å¿—è®°å½•
            return new WebResponseContent().Error($"更新任务时发生错误: {ex.Message}");
        }
    }
    private void MapTaskProperties(Dt_Task task, RequestTaskDto input, string toAddress, int taskState)
    {
        task.CurrentAddress = input.Position;
        task.TargetAddress = toAddress;
        task.NextAddress = toAddress;
        task.TaskState = taskState;
    }
        // å¼€å§‹äº‹åŠ¡
        _unitOfWorkManage.BeginTran();
        // å®šä¹‰å˜é‡
        bool isUpdateLo = true;
        bool isUpdateChange = true;
        // å°è¯•更新任务
    // ä¿®æ”¹ä»»åŠ¡
    private async Task<bool> UpdateTaskAsync(Dt_Task task, DtLocationInfo location, int beforeStatus)
    {
        bool isResult = await BaseDal.UpdateDataAsync(task);
        bool isTaskDetail = await _taskExecuteDetailRepository.AddDetailAsync(task, false, TaskDescription.GetTaskUpdateDescription(task.PalletCode, original, input.Position, TaskInStatusEnum.Line_InFinish.GetIntegralRuleTypeEnumDesc()));
        bool isTaskDetail = await _taskExecuteDetailRepository.AddDetailAsync(task, false, TaskDescription.GetTaskUpdateDescription(task.PalletCode, task.CurrentAddress, task.TargetAddress, TaskInStatusEnum.Line_InFinish.GetIntegralRuleTypeEnumDesc()));
        // åˆ›å»ºLocationChangeRecordDto对象
        LocationChangeRecordDto changeRecordDto = new LocationChangeRecordDto()
        {
            // è®¾ç½®å˜é‡
            AfterStatus = location.LocationStatus,
            BeforeStatus = beforeStatus,
            TaskNum = task.TaskNum.Value,
@@ -1254,23 +1312,11 @@
            LocationCode = location.LocationCode,
            ChangeType = (int)StatusChangeTypeEnum.AutomaticStorage,
        };
        // æ›´æ–°ä½ç½®çŠ¶æ€
        isUpdateChange = _locationStatusChangeRecordRepository.AddStatusChangeRecord(changeRecordDto);
        isUpdateLo = await _locationRepository.UpdateDataAsync(location);
        if (isResult && isUpdateLo && isTaskDetail)
        {
            // æäº¤äº‹åŠ¡
            _unitOfWorkManage.CommitTran();
            content.OK(data: task);
        }
        else
        {
            // å›žæ»šäº‹åŠ¡
            _unitOfWorkManage.RollbackTran();
            content.Error("更新任务失败");
        }
        return content;
        bool isUpdateChange = _locationStatusChangeRecordRepository.AddStatusChangeRecord(changeRecordDto);
        bool isUpdateLo = await _locationRepository.UpdateDataAsync(location);
        return isResult && isUpdateLo && isTaskDetail;
    }
    /// <summary>
@@ -1286,7 +1332,11 @@
        // èŽ·å–ç›®æ ‡åœ°å€
        //string ToAddress = await GetRoadWayAsync(process);
        string ToAddress = await GetRoadWayAsync(input, process);
        string ToAddress = string.Empty;
        if (flag != 2)
            ToAddress = await GetRoadWayAsync(input, process);
        else
            ToAddress = process[0];
        // åˆ›å»ºæ–°ä»»åŠ¡å®žä¾‹
        var task = new Dt_Task
@@ -1302,7 +1352,7 @@
            PalletCode = input.PalletCode,
            SourceAddress = input.Position,
            TaskState = (int)TaskInStatusEnum.InNew,
            TaskType = flag == 0 ? (int)TaskInboundTypeEnum.Inbound : (int)TaskInboundTypeEnum.InTray,
            TaskType = flag == 0 ? (int)TaskInboundTypeEnum.Inbound : flag == 1 ? (int)TaskInboundTypeEnum.InTray : (int)TaskInboundTypeEnum.InNG,
            TaskNum = await BaseDal.GetTaskNo(),
            Creater = "Systeam"
        };
@@ -1324,7 +1374,7 @@
                    PalletCode = task.PalletCode,
                    RoadWay = task.Roadway,
                    SourceAddress = task.SourceAddress,
                    TargetAddress = task.Roadway,
                    TargetAddress = task.TargetAddress,
                    TaskState = task.TaskState.Value,
                    Id = 0,
                    TaskType = task.TaskType,