luxiaotao1123
2021-06-08 84d7dbea21cbe9276bd1eccdb3e60daef095242e
Merge branch 'master' of https://gitee.com/luxiaotao1123/xtywms
3个文件已添加
4个文件已修改
278 ■■■■ 已修改文件
src/main/java/com/zy/asrs/controller/ERPrelevantController.java 40 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/common/service/erp/ErpService.java 27 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/common/service/erp/entity/CPICMO.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/locNormal/normalReport.js 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/salesOrder/erpOrder.js 90 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/salesOrder/salsesOrder.js 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/salesOrder/erpOrder.html 81 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/controller/ERPrelevantController.java
New file
@@ -0,0 +1,40 @@
package com.zy.asrs.controller;
import com.core.annotations.ManagerAuth;
import com.core.common.Cools;
import com.core.common.R;
import com.zy.asrs.entity.MatCode;
import com.zy.asrs.service.MatCodeService;
import com.zy.common.service.erp.ErpService;
import com.zy.common.service.erp.entity.CPICMO;
import com.zy.common.web.BaseController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.Date;
import java.util.List;
@RestController
public class ERPrelevantController extends BaseController {
    @Autowired
    private ErpService erpService;
    @Autowired
    private MatCodeService matCodeService;
    @RequestMapping(value = "/erp/cpicmo/query")
    @ManagerAuth
    public R add(String fbillNo, String fsourceBillNo) {
        List<CPICMO> erpCPICMOlist = erpService.queryErpCPICMO(fbillNo, fsourceBillNo);
        if (erpCPICMOlist.size() > 0) {
            for (CPICMO erpList : erpCPICMOlist) {
                MatCode matCodeObj = matCodeService.selectById(erpList.getFnumber());
                if (!Cools.isEmpty(matCodeObj)) {
                    erpList.setFname(matCodeObj.getMatName());
                    erpList.setFmodel(matCodeObj.getStr3());
                }
            }
        }
        return R.ok().add(erpCPICMOlist);
    }
}
src/main/java/com/zy/common/service/erp/ErpService.java
@@ -332,19 +332,6 @@
    }
    public boolean updateFnumber(Integer itemId, String FNumber){
        String sql = "update InStockbillEntry set Fnumber = ''{0}'' where FItemID = {1,number,#}";
        sql = MessageFormat.format(sql, FNumber, itemId);
@@ -357,4 +344,18 @@
        return erpSqlServer.update(sql) > 0;
    }
    public List<CPICMO> queryErpCPICMO(String fbillNo, String fsourceBillNo) {
        String sql = "select * from CPICMO";
        if (!Cools.isEmpty(fbillNo) && Cools.isEmpty(fsourceBillNo)) {
            sql = "select * from CPICMO where FBillNo = ''{0}''";
            sql = MessageFormat.format(sql, fbillNo);
        } else if (Cools.isEmpty(fbillNo) && !Cools.isEmpty(fsourceBillNo)) {
            sql = "select * from CPICMO where FSourceBillNo = ''{0}''";
            sql = MessageFormat.format(sql, fsourceBillNo);
        } else if (!Cools.isEmpty(fbillNo) && !Cools.isEmpty(fsourceBillNo)) {
            sql = "select * from CPICMO where FBillNo = ''{0}'' and FSourceBillNo = ''{1}''";
            sql = MessageFormat.format(sql, fbillNo, fsourceBillNo);
        }
        return erpSqlServer.select(sql, CPICMO.class);
    }
}
src/main/java/com/zy/common/service/erp/entity/CPICMO.java
@@ -23,6 +23,12 @@
    // 物料代码
    private String Fnumber;
    // 物料名称
    private String Fname;
    // 规格
    private String Fmodel;
    // 申请数量(需入库数量)
    private Double FAuxQty;
src/main/webapp/static/js/locNormal/normalReport.js
@@ -6,15 +6,16 @@
    var cols = [];
    cols.push(
        {field: 'appeTime$', align: 'center', title: '出入库时间', width: 180}
        , {field: 'warehouse', align: 'center', title: '库区'}
        , {field: 'matnr', align: 'center', title: '物料编码'}
        , {field: 'warehouse', align: 'center', title: '库区', width: 100}
        , {field: 'matnr', align: 'center', title: '物料编码', width: 140}
        , {field: 'maktx', align: 'center', title: '物料名称', width: 400}
        , {field: 'lgnum', align: 'center', title: '规格'}
        , {field: 'type', align: 'center', title: '物料类别'}
        , {field: 'mnemonic', align: 'center', title: '生产单号'}
        , {field: 'supplier', align: 'center', title: '通知单号'}
        , {field: 'anfme', align: 'center', title: '数量', width: 120}
        , {field: 'lgnum', align: 'center', title: '规格', width: 120}
        , {field: 'type', align: 'center', title: '物料类别', width: 120}
        , {field: 'mnemonic', align: 'center', title: '生产单号', width: 140}
        , {field: 'supplier', align: 'center', title: '通知单号', width: 140}
        , {field: 'altme', align: 'center', title: '单位', hide: true}
        , {field: 'anfme', align: 'center', title: '数量'}
        , {field: 'memo', align: 'center', title: '备注'}
    )
    return cols;
}
src/main/webapp/static/js/salesOrder/erpOrder.js
New file
@@ -0,0 +1,90 @@
function getCol() {
    var cols = [];
    cols.push(
        {field: 'fbillNo', align: 'center', title: '通知单号', width: 180}
        , {field: 'fsourceBillNo', align: 'center', title: '生产单号', width: 180}
        , {field: 'fnumber', align: 'center', title: '物料编码', width: 180}
        , {field: 'fname', align: 'center', title: '物料名称'}
        , {field: 'fmodel', align: 'center', title: '规格', width: 180}
    );
    return cols;
}
layui.use(['table', 'laydate', 'form', 'upload'], function () {
    var table = layui.table;
    var $ = layui.jquery;
    var layer = layui.layer;
    var layDate = layui.laydate;
    var form = layui.form;
    var upload = layui.upload;
    // 数据渲染
    tableIns = table.render({
        elem: '#salesOrder',
        headers: {token: localStorage.getItem('token')},
        url: baseUrl + '/erp/cpicmo/query',
        even: true,
        toolbar: '#toolbar',
        cellMinWidth: 50,
        cols: [getCol()],
        parseData: function (res) {
            return {
                'code': res.code,
                'msg': res.msg,
                'data': res.data
            }
        },
        response: {
            statusCode: 200
        },
        done: function (res, curr, count) {
            if (res.code === 403) {
                top.location.href = baseUrl + "/";
            }
        }
    });
    // 搜索栏重置事件
    form.on('submit(reset)', function (data) {
        clearFormVal($('#search-box'));
        tableReload(false);
    });
    // 搜索栏搜索事件
    form.on('submit(search)', function (data) {
        tableReload(false);
    });
    // 时间选择器
    layDate.render({
        elem: '.layui-laydate-range'
        , style: 'width: 150px'
        , range: true
    });
});
/* 表格数据重载 */
function tableReload(child) {
    var searchData = {};
    $.each($('#search-box [name]').serializeArray(), function() {
        searchData[this.name] = this.value;
    });
    (child ? parent.tableIns : tableIns).reload({
        where: searchData,
        done: function (res, curr, count) {
            if (res.code === 403) {
                top.location.href = baseUrl + "/";
            }
            limit(child);
        }
    });
}
/* 监听回车事件 */
$('body').keydown(function () {
    if (event.keyCode === 13) {
        $("#search").click();
    }
});
src/main/webapp/static/js/salesOrder/salsesOrder.js
@@ -4,18 +4,19 @@
function getCol() {
    var cols = [];
    cols.push(
        {field: 'orderCode', align: 'center', title: '订单编号'}
        , {field: 'orderDate', align: 'center', title: '订单日期'}
        , {field: 'invCode', align: 'center', title: '物料编码'}
        , {field: 'invName', align: 'center', title: '物料名称'}
        , {field: 'invStd', align: 'center', title: '规格型号'}
        , {field: 'invUnit', align: 'center', title: '单位'}
        , {field: 'orderQty', align: 'center', title: '订单数量'}
        {field: 'orderCode', align: 'center', title: '订单编号', width: 120}
        , {field: 'orderDate', align: 'center', title: '订单日期', width: 180}
        , {field: 'invCode', align: 'center', title: '物料编码', width: 180}
        , {field: 'invName', align: 'center', title: '物料名称', width: 400}
        , {field: 'invStd', align: 'center', title: '规格型号', width: 180}
        , {field: 'invUnit', align: 'center', title: '单位', width: 80}
        , {field: 'orderQty', align: 'center', title: '订单数量', width: 120}
        , {field: 'outQty', align: 'center', title: '发货数量', width: 120}
        , {field: 'izMrp', align: 'center', title: '是否mrp计算', hide: true}
        , {field: 'productQty', align: 'center', title: '生产任务单数量'}
        , {field: 'productQty', align: 'center', title: '生产任务单数量', width: 140}
        , {field: 'izReceive', align: 'center', title: '是否收料', hide: true}
        , {field: 'inQty', align: 'center', title: '产成品入库数量'}
        , {field: 'outQty', align: 'center', title: '发货数量'}
    );
    return cols;
}
src/main/webapp/views/salesOrder/erpOrder.html
New file
@@ -0,0 +1,81 @@
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title></title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="../../static/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="../../static/css/cool.css" media="all">
    <link rel="stylesheet" href="../../static/css/common.css" media="all">
    <link rel="stylesheet" href="../../static/css/print.css" media="all">
</head>
<style>
    #search-box {
        padding: 30px 30px 10px 30px;
    }
    #search-box .layui-inline {
        margin-right: 5px;
    }
    #data-search-btn {
        margin-top: 10px;
    }
    #data-search-btn.layui-btn-container .layui-btn {
        margin-right: 20px;
    }
    .contain td {
        border: 1px solid #000;
        /*line-height: 46px;*/
    }
    #layui-laydate1 {
        width: 300px;
    }
</style>
<body>
<div>
    <!-- 搜索栏 -->
    <div id="search-box" class="layui-form layui-card-header">
        <div class="layui-inline">
            <div class="layui-input-inline">
                <input class="layui-input" type="text" name="fbillNo" placeholder="通知单号" autocomplete="off">
            </div>
        </div>
        <div class="layui-inline">
            <div class="layui-input-inline">
                <input class="layui-input" type="text" name="fsourceBillNo" placeholder="生产单号" autocomplete="off">
            </div>
        </div>
        <div id="data-search-btn" class="layui-btn-container layui-form-item">
            <button id="search" class="layui-btn layui-btn-primary layui-btn-radius" lay-submit lay-filter="search">搜索
            </button>
            <button id="reset" class="layui-btn layui-btn-primary layui-btn-radius" lay-submit lay-filter="reset">重置
            </button>
        </div>
    </div>
    <!-- 表格 -->
    <div class="layui-form">
        <table class="layui-hide" id="salesOrder" lay-filter="salesOrder"></table>
    </div>
</div>
<script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script>
<script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script>
<script type="text/javascript" src="../../static/js/handlebars/handlebars-v4.5.3.js"></script>
<script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script>
<script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script>
<script type="text/javascript" src="../../static/js/salesOrder/erpOrder.js"></script>
</body>
</html>