自动化立体仓库 - WMS系统
skyouc
2025-12-09 7cf2e143941e1548cc468992ada42106a27805a1
Merge branch 'jsxswms' of http://47.97.1.152:5880/r/zy-asrs into jsxswms
15个文件已修改
271 ■■■■■ 已修改文件
src/main/java/com/zy/asrs/enums/OrderTypeEnum.java 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/impl/CheckOrderServiceImpl.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/impl/WorkServiceImpl.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/task/OrderSyncScheduler.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/task/handler/OrderSyncHandler.java 57 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/adjustOrder/adjustOrder.js 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/checkOrder/checkOrder.js 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/common.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/order/order.js 48 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/orderPakin/order.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/orderPakout/order.js 51 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/adjustOrder/adjustOrder.html 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/checkOrder/checkOrder.html 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/order/order.html 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/orderPakout/order.html 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/enums/OrderTypeEnum.java
@@ -3,13 +3,18 @@
public enum OrderTypeEnum {
    //上架派工单
    PICKING(1, "上架派工单"),
    //备货调拨单
    TRANSFER(2, "备货调拨单"),
    //备货派工单
    TRANSFER(2, "备货派工单"),
    INVENTORY(3, "盘点单"),
    ADJUSTMENT(4, "库存调整单"),
    //备货单
    STOCK(5, "备货单");
    STOCK(5, "备货单"),
    //备货出库单
    STOCK_OUT(6, "备货出库单"),
    //备货入库单
    STOCK_IN(7, "备货入库单");
    public Integer type;
src/main/java/com/zy/asrs/service/impl/CheckOrderServiceImpl.java
@@ -207,6 +207,9 @@
        }
        List<CheckOrderDetl> selectList = checkOrderDetlService.selectList(new EntityWrapper<CheckOrderDetl>().eq("order_id", orderId));
        for (CheckOrderDetl checkOrderDetl : selectList) {
            if (checkOrderDetl.getDiffQty().compareTo(BigDecimal.ZERO) == 0){
                continue;
            }
            LocDetl locDetl = locDetlService.selectById(checkOrderDetl.getLocDetlId());
            if (Cools.isEmpty(locDetl)) {
src/main/java/com/zy/asrs/service/impl/WorkServiceImpl.java
@@ -31,6 +31,7 @@
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.*;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
@@ -411,6 +412,19 @@
//        OrderPakout orderPakout = orderPakOutService.selectByNo(orderNo);
        CheckOrder checkOrder = checkOrderService.selectOne(new EntityWrapper<CheckOrder>().eq("order_no", orderNo));
        int ioType = checkOrder.getDocType() == 8 ? 107 : (taskDto.isAll() ? 101 : 103);
        if(ioType == 101){
            boolean DiffQty = taskDto.getLocDtos().stream().allMatch(locDto ->
                    locDetlService.selectOne(new EntityWrapper<LocDetl>()
                            .eq("loc_no", locDto.getLocNo())
                            .eq("matnr", locDto.getMatnr())
                            .eq("batch", locDto.getBatch())
                            .eq("standby1",locDto.getStandby2())
                    ).getDiffQty().compareTo(BigDecimal.ZERO) == 0
            );
            if (!DiffQty){
                ioType = 103;
            }
        }
        StaDesc staDesc = staDescService.queryCrnStnAuto(ioType, locMast.getCrnNo(), staNo.getDevNo());
        // 生成工作号
        int workNo = commonService.getWorkNo(WorkNoType.getWorkNoType(ioType));
src/main/java/com/zy/asrs/task/OrderSyncScheduler.java
@@ -2,6 +2,7 @@
import com.core.common.Cools;
import com.zy.asrs.entity.Order;
import com.zy.asrs.enums.OrderTypeEnum;
import com.zy.asrs.service.ApiLogService;
import com.zy.asrs.service.OrderService;
import com.zy.asrs.task.core.ReturnT;
src/main/java/com/zy/asrs/task/handler/OrderSyncHandler.java
@@ -5,13 +5,9 @@
import com.core.common.Cools;
import com.core.common.DateUtils;
import com.core.exception.CoolException;
import com.zy.asrs.entity.DocType;
import com.zy.asrs.entity.Order;
import com.zy.asrs.entity.OrderDetl;
import com.zy.asrs.service.ApiLogService;
import com.zy.asrs.service.DocTypeService;
import com.zy.asrs.service.OrderDetlService;
import com.zy.asrs.service.OrderService;
import com.zy.asrs.entity.*;
import com.zy.asrs.enums.OrderTypeEnum;
import com.zy.asrs.service.*;
import com.zy.asrs.task.AbstractHandler;
import com.zy.asrs.task.core.ReturnT;
import com.zy.asrs.utils.OrderInAndOutUtil;
@@ -21,6 +17,7 @@
import com.zy.common.model.MesPakoutParam;
import com.zy.common.utils.HttpHandler;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
@@ -46,6 +43,10 @@
    private ApiLogService apiLogService;
    @Autowired
    private DocTypeService docTypeService;
    @Autowired
    private OrderPakinService  orderPakinService;
    @Autowired
    private OrderDetlPakinService orderDetlPakinService;
    @Transactional
    public ReturnT<String> startOrderIssuedOnceMore(Order order) {
@@ -114,6 +115,15 @@
        for (OrderDetl orderDetl : orderDetlList){
            orderDetl.setWorkQty(0D);
            OrderInAndOutUtil.insertOrderDetl(order.getPakinPakoutStatus$(),order,orderDetl);
            //小松:如果下发备货派工单,则生成备货出库+备货入库
            if (order.getDocType().equals(OrderTypeEnum.TRANSFER.type.longValue())){
                try {
                    ifTransfetInsertStockIn(order,orderDetl);
                }catch (Exception e){
                    throw new CoolException(e.getMessage());
                }
            }
        }
        // 修改订单状态 1.未作业 ===>> 2.作业中
        if (!orderService.updateSettle(order.getId(), 2L, null)) {
@@ -122,8 +132,41 @@
        return SUCCESS;
    }
    @Transactional(rollbackFor = Exception.class)
    public void ifTransfetInsertStockIn(Order order, OrderDetl orderDetl){
        OrderPakin orderPakin = new OrderPakin();
        BeanUtils.copyProperties(order,orderPakin);
        orderPakin.setDocType(OrderTypeEnum.STOCK_IN.type.longValue());
        if (!orderPakinService.insert(orderPakin)){
            throw new CoolException("插入备货入库单失败");
        }
        OrderDetlPakin orderDetlPakin = new OrderDetlPakin();
        BeanUtils.copyProperties(orderDetl,orderDetlPakin);
        orderDetlPakin.setOrderId(orderPakin.getId());
        if (!orderDetlPakinService.insert(orderDetlPakin)){
            throw new CoolException("插入备货入库单失败");
        }
    }
    @Transactional
    public ReturnT<String> startOrderInAndOutUtil(Order order) {
        //小松:轮训到备货派工单是查询备货入库单是否完成
        if (order.getDocType().equals(OrderTypeEnum.STOCK_IN.type.longValue())){
            return SUCCESS;
        }
        if (order.getDocType().equals(OrderTypeEnum.TRANSFER.type.longValue())){
            OrderPakin orderPakin = orderPakinService.selectByNo(order.getOrderNo());
            if (null != orderPakin) {
                if (!orderPakin.getSettle().equals(4L)){
                    return SUCCESS;
                }
            }
        }
        DocType docType = docTypeService.selectById(order.getDocType());
        if (null == docType) {
            return SUCCESS;
src/main/webapp/static/js/adjustOrder/adjustOrder.js
@@ -107,24 +107,22 @@
            var offset = $a.offset();
            var top = offset.top;
            var left = offset.left;
            layer.open({
            admin.open({
                type: 1,
                title: false,
                area: '1000px',
                offset: [top + 'px', (left - 700 + $a.outerWidth()) + 'px'],
                shade: .01,
                shadeClose: true,
                fixed: false,
                content: '<table id="lookSSXMTable" lay-filter="lookSSXMTable"></table>',
                success: function (layero) {
                title: '单据明细',
                height: '450px',
                content: $('#orderItem').html(),
                area: '78%',
                success: function (layero, dIndex) {
                    table.render({
                        elem: '#lookSSXMTable',
                        headers: {token: localStorage.getItem('token')},
                        url: baseUrl+'/checkOrderDetl/list/auth',
                        elem: '#itemTable',
                        headers: { token: localStorage.getItem('token') },
                        url: baseUrl + '/checkOrderDetl/list/auth',
                        where: {
                            order_id: data.id
                        },
                        page: true,
                        height: '450px;',
                        cellMinWidth: 100,
                        cols: [[
                            {type: 'numbers'},
@@ -134,14 +132,6 @@
                            {field: 'maktx', title: '商品名称', width: 160},
                            {field: 'batch', title: '批号'},
                            {field: 'diffQty', title: '差异数量', style: 'font-weight: bold'},
                            // {field: 'unit', title: '单位'},
                            // {
                            //     field: 'createTime$', title: '创建时间', sort: true, templet: function (d) {
                            //         return util.toDateString(d.createTime);
                            //     },  width: 180
                            // },
                            // {field: 'inQty', title: '已入库量'},
                            // {field: 'color', title: '颜色'},
                            {field: 'specs', title: '规格'},
                            {field: 'status$', title: '状态'}
                        ]],
@@ -160,10 +150,7 @@
                        response: {
                            statusCode: 200
                        },
                        done:  (res) => {
                            if(res.code == 403){
                                window.top.location.href = baseUrl+"/";
                            }
                        done: function () {
                            $(layero).find('.layui-table-view').css('margin', '0');
                        },
                        size: ''
src/main/webapp/static/js/checkOrder/checkOrder.js
@@ -109,24 +109,22 @@
            var offset = $a.offset();
            var top = offset.top;
            var left = offset.left;
            layer.open({
            admin.open({
                type: 1,
                title: false,
                area: '1000px',
                offset: [top + 'px', (left - 700 + $a.outerWidth()) + 'px'],
                shade: .01,
                shadeClose: true,
                fixed: false,
                content: '<table id="lookSSXMTable" lay-filter="lookSSXMTable"></table>',
                success: function (layero) {
                title: '单据明细',
                height: '450px',
                content: $('#orderItem').html(),
                area: '78%',
                success: function (layero, dIndex) {
                    table.render({
                        elem: '#lookSSXMTable',
                        headers: {token: localStorage.getItem('token')},
                        url: baseUrl+'/checkOrderDetl/list/auth',
                        elem: '#itemTable',
                        headers: { token: localStorage.getItem('token') },
                        url: baseUrl + '/checkOrderDetl/list/auth',
                        where: {
                            order_id: data.id
                        },
                        page: true,
                        height: '450px;',
                        cellMinWidth: 100,
                        cols: [[
                            {type: 'numbers'},
@@ -138,14 +136,6 @@
                            {field: 'anfme', title: '数量'},
                            {field: 'workQty', title: '盘点数量'},
                            {field: 'diffQty', title: '差异数量', style: 'font-weight: bold'},
                            // {field: 'unit', title: '单位'},
                            // {
                            //     field: 'createTime$', title: '创建时间', sort: true, templet: function (d) {
                            //         return util.toDateString(d.createTime);
                            //     },  width: 180
                            // },
                            // {field: 'inQty', title: '已入库量'},
                            // {field: 'color', title: '颜色'},
                            {field: 'specs', title: '规格'},
                            {field: 'status$', title: '状态'}
                        ]],
@@ -164,10 +154,7 @@
                        response: {
                            statusCode: 200
                        },
                        done:  (res) => {
                            if(res.code == 403){
                                window.top.location.href = baseUrl+"/";
                            }
                        done: function () {
                            $(layero).find('.layui-table-view').css('margin', '0');
                        },
                        size: ''
src/main/webapp/static/js/common.js
@@ -32,7 +32,7 @@
    } else {
        var p = time.getMilliseconds();
        if (p < 10) {
            p = "00" + p;
            p = "0" + p;
        }
        if (p <  100) {
            p = "0" + p;
src/main/webapp/static/js/order/order.js
@@ -101,42 +101,34 @@
            var offset = $a.offset();
            var top = offset.top;
            var left = offset.left;
            layer.open({
            admin.open({
                type: 1,
                title: false,
                area: '820px',
                offset: [top + 'px', (left - 530 + $a.outerWidth()) + 'px'],
                shade: .01,
                shadeClose: true,
                fixed: false,
                content: '<table id="lookSSXMTable" lay-filter="lookSSXMTable"></table>',
                success: function (layero) {
                title: '单据明细',
                height: '450px',
                content: $('#orderItem').html(),
                area: '78%',
                success: function (layero, dIndex) {
                    table.render({
                        elem: '#lookSSXMTable',
                        headers: {token: localStorage.getItem('token')},
                        url: baseUrl+'/orderDetl/list/auth',
                        elem: '#itemTable',
                        headers: { token: localStorage.getItem('token') },
                        url: baseUrl + '/orderDetl/list/auth',
                        where: {
                            order_id: data.id
                        },
                        page: true,
                        height: '450px;',
                        cellMinWidth: 100,
                        cols: [[
                            {type: 'numbers'},
                            {field: 'matnr', title: '商品编码', width: 160},
                            {field: 'maktx', title: '商品名称', width: 160},
                            {field: 'specs', title: '规格'},
                            {field: 'batch', title: '批号'},
                            {field: 'anfme', title: '待完结数量'},
                            {field: 'qty', title: '待上报数量', style: 'font-weight: bold'},
                            {field: 'workQty', title: '已上报数量'},
                            // {field: 'unit', title: '单位'},
                            // {
                            //     field: 'createTime$', title: '创建时间', sort: true, templet: function (d) {
                            //         return util.toDateString(d.createTime);
                            //     },  width: 180
                            // },
                            // {field: 'inQty', title: '已入库量'},
                            // {field: 'color', title: '颜色'}
                            { type: 'numbers' },
                            { field: 'matnr', title: '商品编码', width: 160 },
                            { field: 'maktx', title: '商品名称', width: 160 },
                            { field: 'standby1', title: '供应商编码', width: 160 },
                            { field: 'batch', title: '批号' },
                            { field: 'anfme', title: '待完结数量' },
                            { field: 'workQty', title: '待上报数量' },
                            { field: 'qty', title: '已完结数量', style: 'font-weight: bold' },
                            { field: 'specs', title: '规格' }
                        ]],
                        request: {
                            pageName: 'curr',
src/main/webapp/static/js/orderPakin/order.js
@@ -119,7 +119,7 @@
                            { type: 'numbers' },
                            { field: 'matnr', title: '商品编码', width: 160 },
                            { field: 'maktx', title: '商品名称', width: 160 },
                            { field: 'suppCode', title: '供应商编码', width: 160 },
                            { field: 'standby1', title: '供应商编码', width: 160 },
                            { field: 'batch', title: '批号' },
                            { field: 'anfme', title: '数量' },
                            { field: 'workQty', title: '作业数量' },
src/main/webapp/static/js/orderPakout/order.js
@@ -99,46 +99,33 @@
            doModify(data.id, data.orderNo, 4);
        } else if (layEvent === 'look') {
            var $a = $(obj.tr).find('a[lay-event="look"]');
            var offset = $a.offset();
            var top = offset.top;
            var left = offset.left;
            layer.open({
            admin.open({
                type: 1,
                title: false,
                area: '820px',
                offset: [top + 'px', (left - 530 + $a.outerWidth()) + 'px'],
                shade: .01,
                shadeClose: true,
                fixed: false,
                content: '<table id="lookSSXMTable" lay-filter="lookSSXMTable"></table>',
                success: function (layero) {
                title: '单据明细',
                height: '450px',
                content: $('#orderItem').html(),
                area: '78%',
                success: function (layero, dIndex) {
                    table.render({
                        elem: '#lookSSXMTable',
                        headers: {token: localStorage.getItem('token')},
                        url: baseUrl+'/order/pakout/orderDetl/list/auth',
                        elem: '#itemTable',
                        headers: { token: localStorage.getItem('token') },
                        url: baseUrl + '/order/pakout/orderDetl/list/auth',
                        where: {
                            order_id: data.id
                        },
                        page: true,
                        height: '450px;',
                        cellMinWidth: 100,
                        cols: [[
                            {type: 'numbers'},
                            {field: 'matnr', title: '零件代码', width: 160},
                            {field: 'maktx', title: '零件名称', width: 160},
                            // {field: 'batch', title: '批号'},
                            {field: 'standby1', title: '供应商代码'},
                            {field: 'anfme', title: '数量'},
                            {field: 'workQty', title: '作业数量'},
                            {field: 'qty', title: '完成数量', style: 'font-weight: bold'},
                            // {field: 'unit', title: '单位'},
                            // {
                            //     field: 'createTime$', title: '创建时间', sort: true, templet: function (d) {
                            //         return util.toDateString(d.createTime);
                            //     },  width: 180
                            // },
                            // {field: 'inQty', title: '已入库量'},
                            // {field: 'color', title: '颜色'},
                            {field: 'specs', title: '规格'}
                            { type: 'numbers' },
                            { field: 'matnr', title: '商品编码', width: 160 },
                            { field: 'maktx', title: '商品名称', width: 160 },
                            { field: 'standby1', title: '供应商编码', width: 160 },
                            { field: 'batch', title: '批号' },
                            { field: 'anfme', title: '数量' },
                            { field: 'workQty', title: '作业数量' },
                            { field: 'qty', title: '完成数量', style: 'font-weight: bold' },
                            { field: 'specs', title: '规格' }
                        ]],
                        request: {
                            pageName: 'curr',
src/main/webapp/views/adjustOrder/adjustOrder.html
@@ -118,6 +118,9 @@
        </a>
    </span>
</script>
<script type="text/html" id="orderItem">
    <table id="itemTable" lay-filter="itemTable"></table>
</script>
<script type="text/html" id="orderNoTpl">
    {{d.orderNo}}
    {{# if(d.settle > 1 && d.settle !== 3){ }}
src/main/webapp/views/checkOrder/checkOrder.html
@@ -124,6 +124,9 @@
        </a>
    </span>
</script>
<script type="text/html" id="orderItem">
    <table id="itemTable" lay-filter="itemTable"></table>
</script>
<script type="text/html" id="orderNoTpl">
    {{d.orderNo}}
    {{# if(d.settle > 1 && d.settle !== 3){ }}
src/main/webapp/views/order/order.html
@@ -301,6 +301,9 @@
</script>
<script type="text/html" id="orderItem">
    <table id="itemTable" lay-filter="itemTable"></table>
</script>
<script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script>
<script type="text/javascript" src="../../static/js/handlebars/handlebars-v4.5.3.js"></script>
<script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script>
src/main/webapp/views/orderPakout/order.html
@@ -309,6 +309,9 @@
</script>
<script type="text/html" id="orderItem">
    <table id="itemTable" lay-filter="itemTable"></table>
</script>
<script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script>
<script type="text/javascript" src="../../static/js/handlebars/handlebars-v4.5.3.js"></script>
<script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script>