自动化立体仓库 - WMS系统
luxiaotao1123
2022-03-23 acdcaee563c5cb53729acfc33bd9ddbcbf53f8a9
#杰克缝纫机立库 【优化单据管理】
1个文件已添加
3个文件已修改
95 ■■■■ 已修改文件
src/main/java/com/zy/asrs/controller/MatCodeController.java 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/utils/VersionUtils.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/common/model/KeyValueVo.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/order/order.js 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/controller/MatCodeController.java
@@ -14,10 +14,12 @@
import com.core.common.R;
import com.zy.asrs.entity.MatCode;
import com.zy.asrs.entity.MatCodePrint;
import com.zy.asrs.entity.OrderDetl;
import com.zy.asrs.service.MatCodeService;
import com.zy.asrs.utils.VersionUtils;
import com.zy.common.CodeRes;
import com.zy.common.config.AdminInterceptor;
import com.zy.common.model.KeyValueVo;
import com.zy.common.utils.BarcodeUtils;
import com.zy.common.utils.QrCode;
import com.zy.common.utils.excel.matcode.MatCodeExcel;
@@ -41,6 +43,40 @@
    @Autowired
    private MatCodeService matCodeService;
    /*************************************** xm-select ***********************************************/
    // xm-select 搜索商品列表
    @RequestMapping("/mat/all/get/kv")
    @ManagerAuth
    public R getMatDataKV(@RequestParam(required = false) String condition) {
        Wrapper<MatCode> wrapper = new EntityWrapper<MatCode>()
                .andNew().like("mat_no", condition).or().like("mat_name", condition)
                .orderBy("appe_time", false);
        List<MatCode> mats = matCodeService.selectPage(new Page<>(1, 30), wrapper).getRecords();
        List<KeyValueVo> valueVos = new ArrayList<>();
        for (MatCode mat : mats) {
            KeyValueVo vo = new KeyValueVo();
            vo.setName(mat.getMatNo() + " - " + mat.getMatName());
            vo.setValue(mat.getMatNo());
            valueVos.add(vo);
        }
        return R.ok().add(valueVos);
    }
    @RequestMapping(value = "/matCode/covert/{id}/auth")
    @ManagerAuth
    public R covert(@PathVariable("id") String id) {
        MatCode matCode = matCodeService.selectById(String.valueOf(id));
        if (matCode == null) {
            return R.ok();
        }
        OrderDetl orderDetl = new OrderDetl();
        VersionUtils.setOrderDetl(orderDetl, matCode);
        orderDetl.setAnfme(0.0D);
        return R.ok().add(orderDetl);
    }
    @RequestMapping(value = "/matCode/{id}/auth")
    @ManagerAuth
    public R get(@PathVariable("id") String id) {
src/main/java/com/zy/asrs/utils/VersionUtils.java
@@ -78,6 +78,14 @@
        waitPakIn.setBname(matCode.getStr4()); // 客户名称
    }
    public static void setOrderDetl(OrderDetl orderDetl, MatCode matCode) {
        orderDetl.setMatnr(matCode.getMatNo()); // 物料编号
        orderDetl.setMaktx(matCode.getMatName()); // 物料描述
        orderDetl.setSpecs(matCode.getStr2()); // 规格
        orderDetl.setSupplier(matCode.getStr6()); // 批号
    }
    // excel ----------------------------------------------------------------------
    public static MatCodeExcel getExcel(MatCode matCode) {
src/main/java/com/zy/common/model/KeyValueVo.java
New file
@@ -0,0 +1,16 @@
package com.zy.common.model;
import lombok.Data;
/**
 * Created by vincent on 2022/3/23
 */
@Data
public class KeyValueVo {
    private String name;
    private String value;
}
src/main/webapp/static/js/order/order.js
@@ -96,7 +96,7 @@
                            {field: 'matnr', title: '商品编码'},
                            {field: 'maktx', title: '商品名称', width: 160},
                            {field: 'batch', title: '批号'},
                            {field: 'count', title: '数量'},
                            {field: 'anfme', title: '数量'},
                            {field: 'unit', title: '单位'},
                            // {
                            //     field: 'createTime$', title: '创建时间', sort: true, templet: function (d) {
@@ -157,13 +157,10 @@
                        layer.tips('请添加单据明细', '#matAddBtnComment', {tips: [1, '#ff4c4c']});
                        return false;
                    }
                    var param = [];
                    var nList = admin.util.deepClone(xxDataList);
                    for (var xi = 0; xi < nList.length; xi++) {
                        // console.log('已入库:'+nList[xi].inQty)
                        // console.log('旧数量:'+inQtys[xi])
                        // console.log('数量:'+nList[xi].qty)
                        if (nList[xi].inQty > 0 && inQtys[xi]!=nList[xi].qty) {
                    let param = [];
                    let nList = admin.util.deepClone(xxDataList);
                    for (let xi = 0; xi < nList.length; xi++) {
                        if (nList[xi].inQty > 0 && inQtys[xi] !== nList[xi].qty) {
                            layer.msg("已入库无法修改", {icon: 2})
                            return false;
                        } else  if (nList[xi].qty > 0) {
@@ -180,7 +177,7 @@
                                qty: nList[xi].qty,
                                inQty: nList[xi].inQty,
                            })
                        }else if (nList[xi].qty == 0){
                        }else if (nList[xi].anfme === 0){
                            layer.msg('明细修改数量不合法', {icon: 2});
                            return false;
                        }
@@ -226,7 +223,7 @@
                        {field: 'maktx', title: '商品名称', width: 200},
                        {field: 'batch', title: '批号'},
                        {field: 'specs', title: '规格'},
                        {field: 'count', title: '数量(修改)', style: 'color: blue;font-weight: bold', edit: true, minWidth: 110, width: 110},
                        {field: 'anfme', title: '数量(修改)', style: 'color: blue;font-weight: bold', edit: true, minWidth: 110, width: 110},
                        // {field: 'inQty', title: '已入库量',  minWidth: 100, width: 100},
                        {field: 'unit', title: '单位', width: 80},
                        {field: 'memo', title: '备注' , edit: true},
@@ -292,7 +289,7 @@
                                break;
                            }
                        }
                    } else if (obj.field==='count'){
                    } else if (obj.field==='anfme'){
                        let vle = Number(obj.value);
                        if (isNaN(vle)) {
                            layer.msg("请输入数字", {icon: 2});
@@ -301,7 +298,7 @@
                            if (vle > 0) {
                                for (let i=0;i<xxDataList.length;i++) {
                                    if (xxDataList[i]["matnr"] === obj.data.matnr && xxDataList[i]["batch"] === obj.data.batch) {
                                        xxDataList[i]["count"] = vle;
                                        xxDataList[i]["anfme"] = vle;
                                        break;
                                    }
                                }
@@ -342,23 +339,13 @@
                                    if (existMats.indexOf(item.value) === -1) {
                                        // 查询物料详情
                                        $.ajax({
                                            url: baseUrl+"/matCode/"+item.value+"/auth",
                                            url: baseUrl+"/matCode/covert/"+item.value+"/auth",
                                            headers: {'token': localStorage.getItem('token')},
                                            method: 'GET',
                                            async: false,
                                            success: function (res) {
                                                if (res.code === 200){
                                                    var mat = res.data;
                                                    xxDataList.push({
                                                        matNo: mat.matNo,
                                                        matName: mat.matName,
                                                        color:mat.color,
                                                        size:mat.size,
                                                        specs:mat.specs,
                                                        memo: mat.memo,
                                                        unit: mat.unit,
                                                        qty: 0.0
                                                    });
                                                    xxDataList.push(res.data);
                                                    insTbSSXM.reload({data: xxDataList, page: {curr: 1}});
                                                } else if (res.code === 403){
                                                    top.location.href = baseUrl+"/";