chenyong
2025-06-09 4f8cbd783208925be8ccbfed198b86e20523ec0e
更新最新代码
已修改13个文件
已添加2个文件
463 ■■■■ 文件已修改
Code Management/WMS/WIDESEA_WMSClient/src/api/http.js 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSClient/src/api/permission.js 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSClient/src/extension/widesea_wms/stock/Dt_BillGroupStock.jsx 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSClient/src/router/viewGird.js 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSClient/src/uitils/eventBus.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSClient/src/views/widesea_wms/stock/Dt_OutTime.vue 95 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSClient/src/views/widesea_wms/taskinfo/Dt_CL.vue 81 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Core/BaseModels/WebResponseContent.cs 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Core/Extensions/AutofacModuleRegister.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_IStorageTaskService/Task/IDt_TaskService.cs 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/Location/LocationInfoService.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs 48 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Partial/Dt_TaskService.cs 113 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/TaskController.cs 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/appsettings.json 40 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSClient/src/api/http.js
@@ -12,14 +12,14 @@
let loadingStatus = false
if (process.env.NODE_ENV == 'development') {
   axios.defaults.baseURL = 'http://localhost:5000/';
  // axios.defaults.baseURL = 'http://192.168.20.251:5000/';
  // axios.defaults.baseURL = 'http://192.168.65.253:5000/';
}
else if (process.env.NODE_ENV == 'debug') {
  axios.defaults.baseURL = 'http://127.0.0.1:9991/';
  axios.defaults.baseURL = 'http://192.168.65.253:5000/';
}
else if (process.env.NODE_ENV == 'production') {
  // axios.defaults.baseURL = 'http://127.0.0.1:5000/';
  axios.defaults.baseURL = 'http://192.168.20.253:5000/';
  axios.defaults.baseURL = 'http://192.168.65.253:5000/';
}
//axios.defaults.baseURL = 'http://api.volcore.xyz/';
@@ -119,7 +119,12 @@
function getToken() {
  return store.getters.getToken()
}
export function  Getproductionvolume (data) {
  return axios.post('/api/Task/GetTimeoutgetPageData', data)//返回的时promies对象,所以直接return出去就好了
}
export function  GetproductionstatisticsgetPageData (data) {
  return axios.post('/api/Task/GetproductionstatisticsgetPageData', data)//返回的时promies对象,所以直接return出去就好了
}
/*
  url
  params请求后台的参数,如:{name:123,values:['a','b','c']}
Code Management/WMS/WIDESEA_WMSClient/src/api/permission.js
@@ -6,6 +6,7 @@
  getMenu() {
    return http.get('/api/getTreeMenu')
  },
  getButtons(path, extra, table, tableName) {
    //extra自定额外按钮
    //table获取指定表的权限
Code Management/WMS/WIDESEA_WMSClient/src/extension/widesea_wms/stock/Dt_BillGroupStock.jsx
@@ -48,13 +48,15 @@
              //示例:调用后台接口
              if (res.status) {
                this.$Message.success('创建任务成功')
                console.log(res)
                this.refresh() //刷新表格
              } else {
                this.$Message.error(res.message) //错误提示
              }
            })
        }
      }
      }
      var btnSupplementationData = this.buttons.find(x => x.value == "SupplementationData");
            if (btnSupplementationData != null) {
@@ -154,7 +156,9 @@
    onInited() {
      //框架初始化配置后
      //如果要配置明细表,在此方法操作
      //this.detailOptions.columns.forEach(column=>{ });
      this.detailOptions.columns.forEach(column=>{
        console.log(column)
      });
    },
    searchBefore(param) {
      //界面查询前,可以给param.wheres添加查询参数
@@ -162,7 +166,7 @@
      return true
    },
    searchAfter(result) {
      //查询后,result返回的查询数据,可以在显示到表格前处理表格的值
     console.log(result)
      return true
    },
    addBefore(formData) {
@@ -178,6 +182,7 @@
      // this.$refs.table.$refs.table.toggleRowSelection(row) //单击行时选中当前行;
    },
    modelOpenAfter(row) {
      //点击编辑、新建按钮弹出框后,可以在此处写逻辑,如,从后台获取数据
      //(1)判断是编辑还是新建操作: this.currentAction=='Add';
      //(2)给弹出框设置默认值
Code Management/WMS/WIDESEA_WMSClient/src/router/viewGird.js
@@ -54,6 +54,18 @@
    meta: {
      
    }
  },{
    path: '/Dt_OutTime',
    name: 'Dt_OutTime',
    component: () => import('@/views/widesea_wms/stock/Dt_OutTime.vue'),
    meta: {
    }
  },{
    path: '/Dt_CL',
    name: 'Dt_CL',
    component: () => import('@/views/widesea_wms/taskinfo/Dt_CL.vue'),
    meta: {
    }
  }
]
Code Management/WMS/WIDESEA_WMSClient/src/uitils/eventBus.js
@@ -2,4 +2,4 @@
const eventBus = mitt();
export default eventBus;
export default eventBus;
Code Management/WMS/WIDESEA_WMSClient/src/views/widesea_wms/stock/Dt_OutTime.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,95 @@
<!--
*Author:jxx
 *Contact:283591387@qq.com
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/widesea_wms/stock/Dt_BillGroupStock.js此处编写
 -->
 <template>
    <view-grid ref="grid" :columns="columns" :detail="detail" :editFormFields="editFormFields"
        :editFormOptions="editFormOptions" :searchFormFields="searchFormFields"
        :table="table" :extend="extend">
    </view-grid>
</template>
<script>
import extend from "@/extension/widesea_wms/stock/Dt_BillGroupStock.jsx";
import { ref, defineComponent } from "vue";
export default defineComponent({
    setup() {
        const table = ref({
            key: 'id',
            footer: "Foots",
            cnName: '超时信息',
            name: 'stock/Dt_BillGroupStock',
            url: "/Task/GetTimeout",
            sortName: "createDate"
        });
        const editFormFields = ref({
            "palletCode": "",
            "productionLine": "",
            "outboundTime": "",
            // "groupType": ""
        });
        const editFormOptions = ref([
            [
                { "title": "托盘条码", "field": "palletCode", type: "text" },
                { "title": "生产产线", "field": "productionLine", type: "text" },
                { "title": "应出库时间", "field": "outboundTime", type: "datetime" },
                // { "title": "组盘类型", "field": "groupType", type: "select", dataKey: "GroupType", data: [] },
            ]
        ]);
        const searchFormFields = ref({});
        const searchFormOptions = ref([
            [
                { "title": "托盘条码", "field": "palletCode", type: "text" },
                { "title": "生产产线", "field": "productionLine", type: "select", dataKey: "ProductionLine", data: [] },
                { "title": "库区", "field": "areaCode", type: "select", dataKey: "AreaType", data: [] },
                { "title": "库存类型", "field": "isFull", type: "select", dataKey: "isFull", data: [] },
            ], [
                { "title": "库位号", "field": "locationCode", type: "text" },
                { "title": "巷道", "field": "roadwayNo", type: "text" },
                { "title": "货位状态", "field": "locationStatus", type: "select", dataKey: "LocationState", data: [] },
                { "title": "出库时间", "field": "outboundTime", type: "datetime"},
            ]
        ]);
        const now = new Date();
        // ç›´æŽ¥å‡åŽ» 3 å°æ—¶ï¼ˆå¯èƒ½è·¨å¤©ï¼ŒDate å¯¹è±¡ä¼šè‡ªåŠ¨å¤„ç†ï¼‰
        now.setHours(now.getHours() - 3);
        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: 100, align: 'left', },
            { field: 'palletCode', title: '托盘条码', type: 'string', width: 110, align: 'left', },
            { field: 'isFull', title: '库存类型', type: 'bool', width: 80, align: 'left', bind: { key: "isFull", data: [{ key: false, value: '空盘' }, { key: true, value: '实盘' }] }, },
            { field: 'linedProcessFeedbackTime', title: '工艺开始时间', type: 'string', width: 110, align: 'left', },
            { field: 'specialParameterDuration', title: '工艺时长', type: 'string', width: 60, align: 'left', sort: true },
            { field: 'outboundTime', title: '应出库时间', type: 'string', width: 110, align: 'left', sort: true },
            { field: 'productionLine', title: '生产产线', type: 'string', width: 60, align: 'left', bind: { key: "ProductionLine", data: [] }  },
            { field: 'areaCode', title: '库区', type: 'string', width: 60, align: 'left', bind: { key: "AreaType", data: [] } },
            { field: 'remark', title: '电芯数量', type: 'string', width: 60, 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', },
            { 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",
            columns: [],
            sortName: "",
            key: ""
        });
        return {
            table,
            extend,
            editFormFields,
            editFormOptions,
            searchFormFields,
            searchFormOptions,
            columns,
            detail,
        };
    },
});
</script>
Code Management/WMS/WIDESEA_WMSClient/src/views/widesea_wms/taskinfo/Dt_CL.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,81 @@
<!--
*Author:jxx
 *Contact:283591387@qq.com
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/widesea_wms/taskinfo/Dt_Task.js此处编写
 -->
<template>
    <view-grid ref="grid" :columns="columns" :detail="detail" :editFormFields="editFormFields"
        :editFormOptions="editFormOptions"
        :table="table" :extend="extend" />
</template>
<script>
import extend from "@/extension/widesea_wms/taskinfo/Dt_Task_Hty.jsx";
import { ref, defineComponent } from "vue";
export default defineComponent({
    setup() {
        const table = ref({
            key: 'taskId',
            footer: "Foots",
            cnName: '产量统计',
            name: 'taskinfo',
            url: "/Task/Getproductionstatistics",
            sortName: "TaskId"
        });
        const editFormFields = ref({
            "taskNum": "",
            "palletCode": ""
        });
        const editFormOptions = ref([
        ]);
        const searchFormFields = ref({
        });
        const searchFormOptions = ref([
            [
                { "title": "任务类型", "field": "taskType", "type": "select", dataKey: "TaskType", data: [] },
                { "title": "任务状态", "field": "taskState", "type": "select", dataKey: "TaskStatus", data: [] },
            ],
            [
                { "title": "起始位置", "field": "sourceAddress", type: "text" },
                { "title": "当前位置", "field": "currentAddress", type: "text" },
                { "title": "下一位置", "field": "nextAddress", type: "text" },
                { "title": "目标位置", "field": "targetAddress", type: "text" },
            ],
            [
                { "title": "巷道", "field": "roadway", type: "text" },
                { "title": "生产产线", "field": "productionLine", type: "select", dataKey: "ProductionLine", data: [] },
                { "title": "创建人", "field": "creater", type: "text" },
                { "title": "创建时间", "field": "createDate", type: "datetime" },
            ],
        ]);
        const columns = ref([{ field: 'TaskId', title: '主键', type: 'string', width: 110, hidden: true, readonly: true, require: true, align: 'left' },
        { field: 'hour', title: '日期', type: 'int', width: 110, align: 'left', sort: true },
        { field: 'count', title: '实框出库', type: 'string', width: 150, align: 'left' },
        { field: 'pnboundNo', title: '单据号', type: 'string', width: 110, align: 'left' ,hidden: true},
        { field: 'groupID', title: '库存ID', type: 'int', width: 110, hidden: true, align: 'left' },
        { field: 'groupDetailId', title: '组盘明细ID', type: 'int', width: 110, hidden: true, align: 'left' },
        { field: 'roadway', title: '库', type: 'string', width: 110, align: 'left' },]);
        const detail = ref({
            cnName: "#detailCnName",
            table: "#detailTable",
            columns: [],
            sortName: "",
            key: ""
        });
        return {
            table,
            extend,
            editFormFields,
            editFormOptions,
            searchFormFields,
            searchFormOptions,
            columns,
            detail,
        };
    },
});
</script>
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Core/BaseModels/WebResponseContent.cs
@@ -16,12 +16,14 @@
            Status = status;
        }
        public bool Status { get; set; }
        public int total { get; set; }
        public int Code { get; set; }
        public string Message { get; set; }
        public object Data { get; set; }
        public object rows { get; set; }
        public string DevMessage { get; set; }
@@ -43,7 +45,15 @@
            Data = data;
            return this;
        }
        public WebResponseContent OK1(int total1, object data = null,string message = null)
        {
            Status = true;
            total = total1;
            rows = data;
            Data = data;
            Message = message;
            return this;
        }
        public WebResponseContent Error(string message = null)
        {
            Status = false;
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Core/Extensions/AutofacModuleRegister.cs
@@ -24,8 +24,8 @@
        {
            var cacheType = new List<Type>();
            builder.RegisterType<LogAOP>();
            cacheType.Add(typeof(LogAOP));
            //builder.RegisterType<LogAOP>();
            //cacheType.Add(typeof(LogAOP));
            builder.RegisterGeneric(typeof(RepositoryBase<>)).As(typeof(IRepository<>)).InstancePerDependency();//注册仓储
            builder.RegisterGeneric(typeof(ServiceBase<,>)).As(typeof(IService<>)).InstancePerDependency();//注册服务
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_IStorageTaskService/Task/IDt_TaskService.cs
@@ -259,4 +259,16 @@
    /// </summary>
    /// <returns></returns>
    WebResponseContent Getoutput();
    /// <summary>
    /// èŽ·å–è¶…æ—¶åº“å­˜ä¿¡æ¯
    /// </summary>
    /// <returns></returns>
    WebResponseContent GetTimeout();
    /// <summary>
    /// èŽ·å–äº§é‡ç»Ÿè®¡
    /// </summary>
    /// <returns></returns>
    WebResponseContent Getproductionstatistics();
}
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/Location/LocationInfoService.cs
@@ -198,7 +198,7 @@
                        LocationType = locType,
                        Remark = "",
                        Depth = locType > 1 ? (((line - 1) % 4) + 1) == 2 || (((line - 1) % 4) + 1) == 3 ? 1 : 2 : 1,
                        RoadwayNo = locType > 1 ? $"JZSC{((line - 1) / 4) + 1}" : $"JZSC{((line - 1) / 2) + 1}",
                        RoadwayNo = locType > 1 ? $"CHSC{((line - 1) / 4) + 1}" : $"CHSC{((line - 1) / 2) + 1}",
                        LocationStatus = LocationEnum.Free.ObjToInt(),
                        AreaId = areaId,
                        Creater = "System",
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs
@@ -636,7 +636,6 @@
            case (int)TaskOutboundTypeEnum.OutTray:
            case (int)TaskOutboundTypeEnum.Outbound:
            case (int)TaskOutboundTypeEnum.OutNG:
            case (int)TaskOutboundTypeEnum.OutQuality:
            
                LogFactory.GetLog("任务完成").InfoFormat(true, "出库任务", "");
                return await CompleteStackTaskAsync(task, stock);
@@ -905,8 +904,8 @@
    // èŽ·å–ç»„ç›˜ä¿¡æ¯
    private DtBoxingInfo CreateBoxingInfo(ResultTrayCellsStatus result, string palletCode)
    {
        var boxing=_boxingInfoRepository.QueryFirst(x=>x.PalletCode== palletCode);
    {
         var boxing=_boxingInfoRepository.QueryFirst(x=>x.PalletCode == palletCode);
        if (boxing == null)
        {
            return new DtBoxingInfo
@@ -925,8 +924,7 @@
                }).ToList()
            };
        }
        else
        {
        else {
            _boxingInfoRepository.DeleteData(boxing);
            return new DtBoxingInfo
            {
@@ -934,16 +932,17 @@
                IsFull = true,
                ProcessCode = result.ProcessCode,
                ProductionLine = result.ProductionLine,
                BoxingInfoDetails = result.SerialNos.Select(serialNoObj => new DtBoxingInfoDetail
                BoxingInfoDetails = result.SerialNos.Select(seriaINoObj => new DtBoxingInfoDetail
                {
                    SerialNumber = serialNoObj.SerialNo,
                    OrderNo = serialNoObj.PositionNo.ToString(),
                    Status = serialNoObj.SerialNoStatus,
                    SerialNumber = seriaINoObj.SerialNo,
                    OrderNo = seriaINoObj.PositionNo.ToString(),
                    Status = seriaINoObj.SerialNoStatus,
                    MaterielCode = result.BindCode,
                    Remark = result.TrayBarcodePropertys.ToJsonString(),
                }).ToList()
            };
        }
    }
    // èŽ·å–å·¥è‰ºç”³è¯·
@@ -981,7 +980,6 @@
            DtStockInfo stockInfo = tag == (int)TaskOutboundTypeEnum.Outbound
                ? areaCode != "CWSC1" ? await QueryStockInfoForRealTrayAsync(areaCode, areaCodes, productionLine) : await QueryStockInfoForRealTrayCWAsync(areaCodes, productionLine)
                : await QueryStockInfoForEmptyTrayAsync(areaCode, position);
            if (stockInfo == null)
            {
                return content.Error("库存信息不存在");
@@ -1314,7 +1312,7 @@
                }
                else
                {
                    task = CreateTask(stockInfo, "1049-1", taskType);
                    task = CreateTask(stockInfo, "1049-8", taskType);
                }
                
            }
@@ -1740,23 +1738,21 @@
        // åˆ›å»ºåŽ†å²ä»»åŠ¡å®žä¾‹æ¨¡åž‹
        try
        {
            foreach (object item in key)
            Dt_Task task = BaseDal.QueryFirst(x => x.TaskId == Convert.ToInt32(key[0]));
            if (task == null)
            {
                Dt_Task task = BaseDal.QueryFirst(x => x.TaskId == Convert.ToInt32(key));
                if (task == null)
                {
                    return content.Error("未找到任务信息!");
                }
                var taskHtyNG = CreateHistoricalTask(task, true);
                // æ‰§è¡Œæ•°æ®åº“事务
                // æ·»åŠ åŽ†å²ä»»åŠ¡
                var isTaskHtyAdd = _task_HtyRepository.AddData(taskHtyNG) > 0;
                // åˆ é™¤ä»»åŠ¡æ•°æ®
                var isTaskDelete = BaseDal.Delete(task.TaskId);
                return content.Error("未找到任务信息!");
            }
            var taskHtyNG = CreateHistoricalTask(task, true);
            // æ‰§è¡Œæ•°æ®åº“事务
            // æ·»åŠ åŽ†å²ä»»åŠ¡
            var isTaskHtyAdd = _task_HtyRepository.AddData(taskHtyNG) > 0;
            // åˆ é™¤ä»»åŠ¡æ•°æ®
            var isTaskDelete = BaseDal.Delete(task.TaskId);
            return content.OK("删除成功!");
        }
        catch (Exception ex)
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Partial/Dt_TaskService.cs
@@ -4,6 +4,7 @@
using WIDESEA_Core.Const;
using WIDESEA_DTO.MOM;
using WIDESEA_DTO.WMS;
using WIDESEA_Model.Models.Basic;
using WIDESEAWCS_Model.Models;
using WIDESEAWCS_QuartzJob.Models;
@@ -1138,37 +1139,36 @@
    #region ç«è­¦å‡ºåº“
    public WebResponseContent EmergencyTask(object obj)
    public WebResponseContent EmergencyTask(Object obj)
    {
        WebResponseContent content = new WebResponseContent();
        var emergencyTask = new DTSEmergencyTask();
        try
        {
            emergencyTask = JsonConvert.DeserializeObject<DTSEmergencyTask>(obj.ToString());
            if (emergencyTask == null) throw new Exception("火警参数为空");
            string[] strings = emergencyTask.LocationCode.Split("-");
            string[] Roadways = strings[0].Select(x => x.ToString()).ToArray();
            string Roadway = string.Empty;
            switch (Roadways[0])
            {
                case "J":
                    Roadway = "JZSC" + Roadways[1];
                        break;
                case "G":
                    Roadway = "GWSC" + Roadways[1];
                    break;
                case "C":
                    Roadway = "CWSC" + Roadways[1];
                    break;
                default: throw new Exception("未识别库位编码");
            }
            string Roadway = strings[0];
            //switch (Roadways[0])
            //{
            //    case "J":
            //        Roadway = "JZSC" + Roadways[1];
            //        break;
            //    case "G":
            //        Roadway = "GWSC" + Roadways[1];
            //        break;
            //    case "C":
            //        Roadway = "CWSC" + Roadways[1];
            //        break;
            //    default: throw new Exception("未识别库位编码");
            //}
            int Row = Convert.ToInt16(strings[1]);
            int Column= Convert.ToInt16(strings[2]);
            int Layer= Convert.ToInt16(strings[3]);
            if (!strings[0].Contains("SC")) throw new Exception("未知库区");
            for (int i = 0; i < 2; i++)
            {
                DtLocationInfo locationInfo = _locationRepository.QueryFirst(x => x.Row == Convert.ToInt16(strings[1]) && x.Column == Convert.ToInt16(strings[2]) && x.Layer == (i == 0 ? Convert.ToInt16(strings[3]) * 2 - 1 : Convert.ToInt16(strings[3]) * 2) && x.RoadwayNo == Roadway);
                DtLocationInfo locationInfo = _locationRepository.QueryFirst(x => x.Row == Row && x.Column == Column && x.Layer == (i == 0 ? Layer - 1 : Layer) && x.RoadwayNo == Roadway);
                if (locationInfo == null)
                {
                    throw new Exception("未知库位");
@@ -1516,4 +1516,73 @@
    }
    #endregion
}
    public WebResponseContent GetTimeout()
    {
        WebResponseContent content = new WebResponseContent();
        try
        {
            var now = DateTime.Now;
            // ä½¿ç”¨Subtract方法
            var threeHoursAgo = now.Subtract(TimeSpan.FromHours(3));
            List<DtStockInfo> dtStocks = _stockInfoRepository.Db.Queryable<DtStockInfo>()
                               .Where(x => x.OutboundTime < threeHoursAgo).ToList();
            return content.OK1(total1:dtStocks.Count, data: dtStocks);
        }
        catch (Exception ex)
        {
            return content.Error(ex.Message);
        }
    }
    public WebResponseContent Getproductionstatistics()
    {
        WebResponseContent content = new WebResponseContent();
        try
        {
            var now = DateTime.Now;
            var thirtyDaysAgo = now.AddDays(-30);
            var roadwayMappings = new Dictionary<string, string> {
                    { "JZ", "静置库" },
                    { "CH", "陈化库" },
                    { "FR", "分容库" },
                    { "GW", "高温库" },
                    { "CW", "常温库" }
                };
            var roadwayKeys = roadwayMappings.Keys.ToArray();
            var taskHty = _task_HtyRepository.Db.Queryable<Dt_Task_Hty>()
                .Where(it =>
                    it.CreateDate >= thirtyDaysAgo &&
                    it.CreateDate <= now &&
                    it.TaskType == 100 &&
                    roadwayKeys.Any(rk => it.Roadway.Contains(rk)))
                .ToList()
                .Select(t => new {
                    OriginalRoadway = t.Roadway,
                    MatchedKey = roadwayKeys.FirstOrDefault(rk => t.Roadway.Contains(rk)),
                    CreateDate = t.CreateDate
                })
                .Where(t => t.MatchedKey != null)
                .GroupBy(t => new {
                    RoadwayKey = t.MatchedKey,
                    Date = t.CreateDate.Date,
                    Hour = t.CreateDate.Hour
                })
                .OrderByDescending(group => group.Key.Date)
                .ThenByDescending(group => group.Key.Hour)
                .Select(group => new {
                    Hour = $"{group.Key.Date:yyyy/M/d} {group.Key.Hour}:00",
                    Count = group.Count(),
                    Roadway = roadwayMappings[group.Key.RoadwayKey] // æ˜ å°„为中文名称
                })
                .ToList();
            return content.OK1(total1: taskHty.Count, data: taskHty);
        }
        catch (Exception ex)
        {
            return content.Error(ex.Message);
        }
    }
    }
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/TaskController.cs
@@ -244,4 +244,21 @@
    {
        return Service.Getoutput();
    }
    [HttpPost, AllowAnonymous, Route("GetTimeoutgetPageData")]
    public WebResponseContent GetTimeout()
    {
        return Service.GetTimeout();
    }
    /// <summary>
    /// äº§é‡ç»Ÿè®¡
    /// </summary>
    /// <returns></returns>
    [HttpPost,AllowAnonymous,Route("GetproductionstatisticsgetPageData")]
    public WebResponseContent Getproductionstatistics()
    {
        return Service.Getproductionstatistics();
    }
}
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/appsettings.json
@@ -10,12 +10,12 @@
    "MainDB": "DB_WIDESEA", //当前项目的主库,所对应的连接字符串的Enabled必须为true
    //连接字符串
    //"ConnectionString": "HTI6FB1H05Krd07mNm9yBCNhofW6edA5zLs9TY~MNthRYW3kn0qKbMIsGp~3yyPDF1YZUCPBQx8U0Jfk4PH~ajNFXVIwlH85M3F~v_qKYQ3CeAz3q1mLVDn8O5uWt1~3Ut2V3KRkEwYHvW2oMDN~QIDXPxDgXN0R2oTIhc9dNu7QNaLEknblqmHhjaNSSpERdDVZIgHnMKejU_SL49tralBkZmDNi0hmkbL~837j1NWe37u9fJKmv91QPb~16JsuI9uu0EvNZ06g6PuZfOSAeFH9GMMIZiketdcJG3tHelo=",
    //"ConnectionString": "Data Source=192.168.5.251;Initial Catalog=WIDESEA_WMSDB_BBMain;User ID=sa;Password=P@ssw0rd;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False",
    "ConnectionString": "Data Source=127.0.0.1;Initial Catalog=WIDESEA_WMSDB;User ID=sa;Password=P@ssw0rd;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False",
    "ConnectionString": "Data Source=.;Initial Catalog=WIDESEA_WMSDB_BBMain;User ID=sa;Password=123456;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False",
    //"ConnectionString": "Data Source=.;Initial Catalog=WIDESEA_WMSDB_BBMain;User ID=sa;Password=123456;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False",
    //"ConnectionString": "Data Source=.\\LIULEI;Initial Catalog=WIDESEA_WMSDB_BBMain;User ID=sa;Password=123456;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False",
    //"ConnectionString": "Data Source=192.168.20.251;Initial Catalog=WIDESEA_WMSDB;User ID=sa;Password=123456@gy;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False",
    //"ConnectionStringWCS": "Data Source=192.168.5.251;Initial Catalog=WIDESEAWCS_TEST;User ID=sa;Password=P@ssw0rd;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False",
    "ConnectionStringWCS": "Data Source=127.0.0.1;Initial Catalog=WIDESEA_WCSDB;User ID=sa;Password=P@ssw0rd;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False",
    "ConnectionStringWCS": "Data Source=.;Initial Catalog=WIDESEA_WCSDB_BBMain;User ID=sa;Password=123456;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False",
    //"ConnectionStringWCS": "Data Source=.;Initial Catalog=WIDESEA_WCSDB_BBMain;User ID=sa;Password=123456;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False",
    //跨域
    "Cors": {
        "PolicyName": "CorsIpAccess", //策略名称
@@ -24,30 +24,26 @@
        // æ³¨æ„ï¼Œhttp://127.0.0.1:1818 å’Œ http://localhost:1818 æ˜¯ä¸ä¸€æ ·çš„
        "IPs": "http://127.0.0.1:8080,http://localhost:8080,http://127.0.0.1:8081,http://localhost:8081"
    },
    //缓存设置
    "CacheSettings": {
        "UseRedis": false, //启用redis
        "RedisSettings": {
            "Address": "127.0.0.1:6379", //地址
            "Password": "123456", //Redis服务密码
            "Db": 9, //默认库
            "ClearRedis": true //是否每次启动都清除Redis缓存
        }
    },
    "ApiName": "WIDESEA",
    "ExpMinutes": 120,
    // éœ€è¦ç§»åº“的行
    "TransfertRows": "1,4,5,8",
    "CacheSettings": {
        "UseRedis": false,
        "RedisSettings": {
            "Address": "127.0.0.1:6379",
            "Password": "123456",
            "Db": 9,
            "ClearRedis": true
        }
    },
    // å…è®¸å‡ºåº“的编码
    "OutBoundMateriel": [
        {
            "MaterielCode": "CC03040001523",
            "ProductionLine": "ZJ-7",
            "ProcessCode": "CWSC3"
        }
        //{
        //    "MaterielCode": "CC01050001348",
        //    "ProductionLine": "ZJ-8",
        //    "ProcessCode": "CH001"
        //}
    ]
}