dengjunjie
2025-01-11 9e6b28f0b0c29523d0dd11d0a01a53af5f1ada33
添加PDA平库出库
已修改5个文件
300 ■■■■■ 文件已修改
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_IOutboundService/IOutboundOrderService.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/OutboundOrderService.cs 165 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Outbound/OutboundOrderController.cs 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/淮安PDA/pages.json 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/淮安PDA/pages/stash/outraworderboxing.vue 107 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_IOutboundService/IOutboundOrderService.cs
@@ -18,6 +18,7 @@
        IOutboundOrderRepository Repository { get; }
        WebResponseContent GetOutboundOrders(SaveModel saveModel);
        WebResponseContent outpinku(SaveModel saveModel);
        WebResponseContent ReceiveOutOrder(ErpOutOrderDTO model);
        WebResponseContent TestOutUpload(int id,List<Dt_OutStockLockInfo>? outStockLockInfos=null);
    }
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/OutboundOrderService.cs
@@ -15,9 +15,11 @@
using WIDESEA_Core;
using WIDESEA_Core.BaseRepository;
using WIDESEA_Core.BaseServices;
using WIDESEA_Core.CodeConfigEnum;
using WIDESEA_Core.Enums;
using WIDESEA_Core.Helper;
using WIDESEA_Core.Utilities;
using WIDESEA_DTO.Basic;
using WIDESEA_DTO.ERP;
using WIDESEA_DTO.Inbound;
using WIDESEA_DTO.Outbound;
@@ -38,23 +40,20 @@
        private readonly IUnitOfWorkManage _unitOfWorkManage;
        private readonly IBasicService _basicService;
        private readonly IOutboundOrderDetailRepository _outboundOrderDetailRepository;
        private readonly IStockInfoService _stockInfoService;
        private readonly IStockInfoRepository _stockInfoRepository;
        private readonly IStockService _stockService;
        public IOutboundOrderRepository Repository => BaseDal;
        private readonly IInvokeERPService _invokeERPService;
        private readonly IOutStockLockInfoService _outStockLockInfoService;
        private readonly IOutboundOrderRepository _outboundOrderRepository;
        public OutboundOrderService(IOutboundOrderRepository BaseDal, IMapper mapper, IUnitOfWorkManage unitOfWorkManage, IBasicService basicService, IOutboundOrderDetailRepository outboundOrderDetailRepository, IStockInfoService stockInfoService,
          IStockInfoRepository stockInfoRepository, IInvokeERPService invokeERPService, IOutStockLockInfoService outStockLockInfoService,
        public OutboundOrderService(IOutboundOrderRepository BaseDal, IMapper mapper, IUnitOfWorkManage unitOfWorkManage, IBasicService basicService, IOutboundOrderDetailRepository outboundOrderDetailRepository, IStockService stockService, IInvokeERPService invokeERPService, IOutStockLockInfoService outStockLockInfoService,
          IOutboundOrderRepository outboundOrderRepository) : base(BaseDal)
        {
            _mapper = mapper;
            _unitOfWorkManage = unitOfWorkManage;
            _basicService = basicService;
            _outboundOrderDetailRepository = outboundOrderDetailRepository;
            _stockInfoService = stockInfoService;
            _stockInfoRepository = stockInfoRepository;
            _stockService = stockService;
            _invokeERPService = invokeERPService;
            _outStockLockInfoService = outStockLockInfoService;
            _outboundOrderRepository = outboundOrderRepository;
@@ -72,6 +71,11 @@
            saveModel.DetailData[0].Add("orderDetailStatus", OrderDetailStatusEnum.New.ObjToInt());
            return base.AddData(saveModel);
        }
        /// <summary>
        /// èŽ·å–å‡ºåº“å•ä¿¡æ¯
        /// </summary>
        /// <param name="saveModel"></param>
        /// <returns></returns>
        public WebResponseContent GetOutboundOrders(SaveModel saveModel)
        {
            WebResponseContent content = new WebResponseContent();
@@ -98,6 +102,151 @@
            }
            return content;
        }
        public WebResponseContent outpinku(SaveModel saveModel)
        {
            WebResponseContent content = new WebResponseContent();
            try
            {
                var orderNo = saveModel.MainData["orderNo"].ToString();
                var warehouseId = saveModel.MainData["warehouseId"].ObjToInt();
                var serNum = saveModel.MainData["sn"].ToString();
                Dt_Warehouse warehouse = _basicService.WarehouseService.Repository.QueryFirst(x => x.WarehouseId == warehouseId);
                if (warehouse == null)
                {
                    return WebResponseContent.Instance.Error($"未找到该仓库信息");
                }
                Dt_OutboundOrder outboundOrder = BaseDal.Db.Queryable<Dt_OutboundOrder>().Where(x => x.OrderNo == orderNo && x.WarehouseId == warehouse.WarehouseId).Includes(x => x.Details).First();
                if (outboundOrder == null)
                {
                    return WebResponseContent.Instance.Error($"未找到出库单信息");
                }
                if (outboundOrder.Details == null || outboundOrder.Details.Count <= 0)
                {
                    return WebResponseContent.Instance.Error($"未找到出库单明细信息");
                }
                MatSerNumAnalysisModel model = CodeAnalysisHelper.CodeAnalysis<MatSerNumAnalysisModel>(AnalysisCodeEnum.MatSerNumAnalysis, serNum);
                Dt_MaterielInfo materielInfo = _basicService.MaterielInfoService.Repository.QueryFirst(x => x.MaterielCode == model.MaterielCode);
                if (materielInfo == null)
                {
                    return WebResponseContent.Instance.Error($"未找到该物料的信息");
                }
                if (materielInfo.WarehouseId != outboundOrder.WarehouseId)
                {
                    return WebResponseContent.Instance.Error($"该物料不属于本仓");
                }
                Dt_OutboundOrderDetail outboundOrderDetail = outboundOrder.Details.FirstOrDefault(x => x.MaterielCode == model.MaterielCode);
                if (outboundOrderDetail == null) return WebResponseContent.Instance.Error($"该物料不属于本出库单");
                if (outboundOrderDetail.OrderDetailStatus == OrderDetailStatusEnum.Over.ObjToInt())
                    return WebResponseContent.Instance.Error($"本出库单当前物料已出库完成");
                if (outboundOrderDetail.OrderQuantity - outboundOrderDetail.OverOutQuantity < model.Quantity)
                    return WebResponseContent.Instance.Error($"出库数量超出出库单");
                Dt_StockInfoDetail stockInfoDetail = _stockService.StockInfoDetailService.Repository.QueryFirst(x => x.MaterielCode == model.MaterielCode && x.BatchNo == model.LotNo);
                if (stockInfoDetail == null) return WebResponseContent.Instance.Error($"未找到库存");
                if (stockInfoDetail.StockQuantity < model.Quantity) return WebResponseContent.Instance.Error($"库存不足");
                Dt_StockInfo stockInfo = _stockService.StockInfoService.Repository.QueryFirst(x => x.Id == stockInfoDetail.StockId);
                if (stockInfo == null) return WebResponseContent.Instance.Error($"未找到库存主表");
                if (stockInfo.LocationCode != "平库位") return WebResponseContent.Instance.Error($"库存不属于平库位");
                Dt_OutStockLockInfo outStockLockInfo = new Dt_OutStockLockInfo()
                {
                    PalletCode = stockInfo.PalletCode,
                    AssignQuantity = model.Quantity,
                    MaterielCode = model.MaterielCode,
                    BatchNo = model.LotNo,
                    LocationCode = stockInfo.LocationCode,
                    MaterielName = materielInfo.MaterielName,
                    OrderDetailId = outboundOrderDetail.Id,
                    OrderNo = outboundOrder.OrderNo,
                    OrderType = outboundOrder.OrderType,
                    OriginalQuantity = stockInfoDetail.StockQuantity,
                    Status = OutLockStockStatusEnum.出库完成.ObjToInt(),
                    StockId = stockInfo.Id,
                    TaskNum = 0,
                    OrderQuantity = outboundOrderDetail.OrderQuantity,
                    Unit = outboundOrderDetail.Unit
                };
                #region ä¿®æ”¹å‡ºåº“单
                outboundOrderDetail.OverOutQuantity += outStockLockInfo.AssignQuantity;
                if (outboundOrderDetail.OrderQuantity > outboundOrderDetail.OverOutQuantity)
                    outboundOrderDetail.OrderDetailStatus = OrderDetailStatusEnum.Outbound.ObjToInt();
                else
                    outboundOrderDetail.OrderDetailStatus = OrderDetailStatusEnum.Over.ObjToInt();
                int overCount = outboundOrder.Details.Where(x => x.OrderDetailStatus == OrderDetailStatusEnum.Over.ObjToInt()).Count();
                if (outboundOrder.Details.Count == overCount) outboundOrder.OrderStatus = OutOrderStatusEnum.出库完成.ObjToInt();
                #endregion
                #region ä¿®æ”¹åº“å­˜
                stockInfoDetail.StockQuantity -= stockInfoDetail.StockQuantity - outStockLockInfo.AssignQuantity;
                #endregion
                _unitOfWorkManage.BeginTran();
                _outStockLockInfoService.Repository.AddData(outStockLockInfo);
                BaseDal.UpdateData(outboundOrder);
                _outboundOrderDetailRepository.UpdateData(outboundOrderDetail);
                if (stockInfoDetail.StockQuantity > 0)
                {
                    _stockService.StockInfoDetailService.Repository.UpdateData(stockInfoDetail);
                }
                else
                {
                    _stockService.StockInfoDetailService.Repository.DeleteData(stockInfoDetail);
                    if (stockInfo.Details.Count <= 1) _stockService.StockInfoService.Repository.DeleteData(stockInfo);
                }
                _unitOfWorkManage.CommitTran();
                #region å‡ºåº“完成上报ERP
                ERPPickItemModel pickItemModel = new ERPPickItemModel()
                {
                    Lotno = model.LotNo,
                    Qty = model.Quantity.ToString(),
                    Location = warehouse.WarehouseCode
                };
                ERPPickModel pickModel = new ERPPickModel()
                {
                    Rowindex = outboundOrderDetail.RowNo,
                    Material = outboundOrderDetail.MaterielCode,
                    Qty = pickItemModel.Qty,
                    Dataitem = new List<ERPPickItemModel> { pickItemModel }
                };
                List<ERPPickModel> eRPPickModels = new List<ERPPickModel>() { pickModel };
                ERPIssueItemModel issueItemModel = new ERPIssueItemModel()
                {
                    Pickcode = outboundOrder.UpperOrderNo,
                    PickList = eRPPickModels
                };
                ERPIssueModel issueModel = new ERPIssueModel()
                {
                    UniqueTag = outboundOrderDetail.OrderId.ToString(),
                    Code = outboundOrder.OrderNo,
                    WarehouseCode = warehouse.WarehouseCode,
                    Docremark = "",
                    Deptno = outboundOrder.DepartmentCode,
                    Deptname = outboundOrder.DepartmentName,
                    Createtime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
                    Createuser = App.User.UserName,
                    Issitem = new List<ERPIssueItemModel>() { issueItemModel },
                };
                _invokeERPService.InvokeOutStandardsApi(issueModel);
                #endregion
                content.OK();
            }
            catch (Exception ex)
            {
                _unitOfWorkManage.RollbackTran();
                content.Error(ex.Message);
            }
            return content;
        }
        public WebResponseContent ReceiveOutOrder(ErpOutOrderDTO model)
        {
            try
@@ -329,7 +478,7 @@
                if (stockInfos.Count > 0)
                {
                    _stockInfoRepository.UpdateData(stockInfos);
                    _stockService.StockInfoService.Repository.UpdateData(stockInfos);
                }
                else
                {
@@ -355,7 +504,7 @@
            try
            {
                //获取出库单库存
                List<Dt_StockInfo> stockInfos = _stockInfoRepository.Db.Queryable<Dt_StockInfo>().Where(x => x.WarehouseId == warehouse.WarehouseId).Includes(x => x.Details).ToList();
                List<Dt_StockInfo> stockInfos = _stockService.StockInfoService.Repository.Db.Queryable<Dt_StockInfo>().Where(x => x.WarehouseId == warehouse.WarehouseId).Includes(x => x.Details).ToList();
                if (stockInfos.Count <= 0)
                {
                    return WebResponseContent.Instance.Error($"库存不足");
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Outbound/OutboundOrderController.cs
@@ -33,9 +33,19 @@
        /// <param name="saveModel"></param>
        /// <returns></returns>
        [HttpPost, Route("GetOutboundOrders"), AllowAnonymous]
        public WebResponseContent GetOutboundOrders([FromBody]SaveModel saveModel)
        public WebResponseContent GetOutboundOrders([FromBody] SaveModel saveModel)
        {
            return Service.GetOutboundOrders(saveModel);
        }
        /// <summary>
        /// å‡ºå¹³åº“库存
        /// </summary>
        /// <param name="saveModel"></param>
        /// <returns></returns>
        [HttpPost, Route("outpinku"), AllowAnonymous]
        public WebResponseContent outpinku([FromBody] SaveModel saveModel)
        {
            return Service.outpinku(saveModel);
        }
    }
}
´úÂë¹ÜÀí/»´°²PDA/pages.json
@@ -43,7 +43,20 @@
                "enablePullDownRefresh": false
            }
        },
        {
            "path": "pages/stash/outboundorder",
            "style": {
                "navigationBarTitleText": "出库单",
                "enablePullDownRefresh": false
            }
        },
        {
            "path": "pages/stash/outraworderboxing",
            "style": {
                "navigationBarTitleText": "平库出库",
                "enablePullDownRefresh": false
            }
        },
        {
            "path": "pages/stash/boxing",
            "style": {
´úÂë¹ÜÀí/»´°²PDA/pages/stash/outraworderboxing.vue
@@ -7,39 +7,24 @@
                <view class="itemstyle">
                    <uni-forms style="margin-left: 2%;margin-top: 20px;" label-width="180">
                        <uni-forms-item :label="label" style="margin-top: -20px;"></uni-forms-item>
                        <!-- <uni-forms-item label="单据类型:生产领料单" style="margin-top: -20px;"></uni-forms-item> -->
                        <uni-forms-item label="物料码:" style="margin-top: -20px;">
                            <uni-easyinput type="text" placeholder="请扫描物料码" ref='midInput' :focus="focus"
                                v-model="innerCode" @input="snInput" />
                            <uni-easyinput type="text" placeholder="请扫描物料码" ref='midInput' :focus="!focus"
                                v-model="materSn" @input="snInput" />
                        </uni-forms-item>
                        <!-- <uni-forms-item :label="PurchaseOrderNo" style="margin-top: -20px;"></uni-forms-item>
                        <uni-forms-item :label="matCode" style="margin-top: -20px;"></uni-forms-item>
                        <uni-forms-item :label="LotNo" style="margin-top: -20px;"></uni-forms-item>
                        <uni-forms-item :label="ProductionDate" style="margin-top: -20px;"></uni-forms-item>
                        <uni-forms-item :label="EffectiveDate" style="margin-top: -20px;"></uni-forms-item>
                        <uni-forms-item :label="orderQty" style="margin-top: -20px;"></uni-forms-item>
                        <uni-forms-item :label="remaindQty" style="margin-top: -20px;"> -->
                        <uni-list>
                            <uni-list-item direction="column" v-for="item in matInfos" :key="item.palletCode">
                            <uni-list-item direction="column" v-for="(item,index) in matInfos" :key="index">
                                <template v-slot:body>
                                    <view class="uni-content">
                                        <view>单据编号:{{item.orderNo}}</view>
                                        <view>托盘编号:{{item.palletCode}}</view>
                                        <view>物料批次:{{item.batchNo}}</view>
                                        <!-- <view class="uni-title-sub uni-ellipsis-2">采购单号:{{item.purchaseOrderNo}}</view> -->
                                        <view>物料编码:{{item.materielCode}}</view>
                                        <view>物料名称:{{item.materielName}}</view>
                                        <view>单据数量:{{item.orderQuantity}}</view>
                                        <view>原始库存:{{item.originalQuantity}}</view>
                                        <view>分配库存:{{item.assignQuantity}}</view>
                                        <view>剩余库存:{{item.originalQuantity-item.assignQuantity}}</view>
                                        <view>批次号:{{item.lotNo}}</view>
                                        <view>数量:{{item.quantity}}</view>
                                        <!-- <view class="uni-note">生产日期:{{item.productionDate}}</view>
                                        <view class="uni-note">有效期:{{item.effectiveDate}}</view> -->
                                    </view>
                                </template>
                            </uni-list-item>
                        </uni-list>
                        <uni-forms-item label="出库数量:" style="margin-top: -20px;">
                            <uni-easyinput type="text" placeholder="请输入出库数量" ref='midInput' :focus="focus"
                                v-model="outQty" />
                        </uni-forms-item>
                        </uni-forms-item>
                    </uni-forms>
                    <uni-forms-item>
@@ -58,8 +43,8 @@
                                        <view>物料编码:{{item.materielCode}}</view>
                                        <view>物料名称:{{item.materielName}}</view>
                                        <view>数量:{{item.orderQuantity+item.unit}}</view>
                                        <view>出库数量:{{item.orderQuantity}}</view>
                                        <view>已出数量:{{item.overOutQuantity}}</view>
                                        <view>出库数量:{{item.orderQuantity+item.unit}}</view>
                                        <view>已出数量:{{item.overOutQuantity+item.unit}}</view>
                                    </view>
                                </view>
                            </template>
@@ -79,40 +64,19 @@
            return {
                items: ['物料信息', '单据信息'],
                current: 0,
                matTotal: [],
                matInfos: [],
                orderNo: "",
                label: "",
                outQty: "",
                orderInfo: [],
                focus: false,
                pkfocus: false,
                barcode: "",
                materSn: "",
                Initiallife: 1000,
                sns: [],
                pksns: [],
                addressFocus: false,
                inboundBarcode: "",
                address: "",
                check: true,
                value: "",
                matInfo: [],
                value2: "",
                matTotals: [],
                sn: "",
                warehouseId: "",
                Test: false,
                Testlabel: "",
                Testplaceholder: "",
                Testcheck: false,
                pkmaterSn: "",
                pkmatInfos: []
            }
        },
        onShow() {},
        onLoad(res) {
            this.focus = false;
            this.addressFocus = false;
            this.orderNo = res.orderNo;
            this.warehouseId = res.warehouseId;
            this.label = "单据编号:" + this.orderNo;
@@ -140,7 +104,6 @@
            },
            onClickItem(e) {
                this.focus = false;
                this.addressFocus = false;
                if (this.current !== e.currentIndex) {
                    this.current = e.currentIndex;
                    if (this.current == 2) {
@@ -152,7 +115,7 @@
            snInput() {
                this.$nextTick(() => {
                    if (this.materSn != "") {
                        this.focus = false;
                        this.focus = true;
                        var matSn = this.materSn;
                        setTimeout(() => {
                            this.materSn = "";
@@ -160,8 +123,8 @@
                        this.$u.post('/api/MaterielInfo/CodeAnalysis?serNum=' + matSn, {}).then((res) => {
                            this.Testcheck = false;
                            if (res.status) {
                                this.sns.push(res.data.serialNumber);
                                this.matInfos = [];
                                this.sn = res.data.serialNumber;
                                this.matInfos.push(res.data);
                                if (res.message) {
                                    this.$refs.uToast.show({
@@ -177,6 +140,8 @@
                                    this.voiceSpeech('../../static/success.mp3');
                                }, 100);
                            } else {
                                this.matInfos = [];
                                this.sns = [];
                                this.$refs.uToast.show({
                                    title: res.message,
                                    type: "error"
@@ -189,56 +154,30 @@
                    }
                })
            },
            deleteList(res) {
                this.matInfos.splice(res, 1);
                this.sns.splice(res, 1);
            },
            submit() {
                if (this.barcode == "") {
                if (this.sn == "") {
                    this.$refs.uToast.show({
                        title: "请扫描托盘条码",
                        title: "请扫描物料码",
                        type: 'error'
                    })
                    return;
                }
                if (this.matInfos.length == 0) {
                    this.$refs.uToast.show({
                        title: "请扫描内箱标签",
                        type: 'error'
                    })
                    return;
                }
                if (this.Test) {
                    if (!this.Testcheck) {
                        this.Testcheck = true;
                        this.$refs.uToast.show({
                            title: "请确认初始寿命",
                            type: 'error'
                        })
                        return;
                    }
                }
                this.$u.post('/api/InboundOrder/MaterielGroup', {
                debugger
                this.$u.post('/api/OutboundOrder/outpinku', {
                    MainData: {
                        "palletCode": this.barcode,
                        "orderNo": this.orderNo,
                        "initiallife": this.Initiallife,
                        // "isFull": this.check
                        "sn": this.sn,
                        "warehouseId": this.warehouseId
                    },
                    DelKeys: this.sns
                    }
                }).then(res => {
                    this.Testcheck = false;
                    if (res.status) {
                        this.$refs.uToast.show({
                            title: "出库成功",
                            type: "success"
                        })
                        this.focus = false;
                        this.barcode = "";
                        this.matInfos = [];
                        this.sns = [];
                        this.matTotal = [];
                        this.sn = "";
                    } else {
                        this.$refs.uToast.show({
                            title: res.message,