hwh
2024-07-02 466fff2dc251cc78da0a95dc9db5e2f782bcde75
接口
6个文件已修改
1113 ■■■■■ 已修改文件
HTML/views/SystemSettings/Interface.html 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HTML/views/SystemSettings/InterfaceDetail.html 504 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/WMS.BLL/SysServer/InterfaceServer.cs 389 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/WMS.IBLL/ISysServer/IInterfaceServer.cs 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/Wms/AutoMapperServer/AutoMapperProfile.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/Wms/Controllers/BasisController.cs 196 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HTML/views/SystemSettings/Interface.html
@@ -165,6 +165,7 @@
                    height: h1,
                    id: 'LAY-app-content-list',
                    where: param,
                    parseData: FnParseData,
                    contentType: 'application/json',
                    headers:{ToKen:$.cookie('token')},
                    page: true,
@@ -295,6 +296,7 @@
                    height: h2,
                    id: 'LAY-app-content-list2',
                    where: param,
                    parseData: FnParseData,
                    contentType: 'application/json',
                    toolbar:'',
                    defaultToolbar:  '', //'print', 'exports'
@@ -460,7 +462,7 @@
                                InterfaceNo:data.InterfaceNo,
                            };
                            sendData(IP + "/Basis/DelInterface", param, 'post', function (res) {
                                if (res.code == 0) { //成功
                                if (res.code == 200) { //成功
                                    layer.msg(res.msg, {
                                        icon: 1,
                                        time: 2000 //2秒关闭(如果不配置,默认是3秒)
@@ -494,7 +496,7 @@
                                InterfaceNo:data.InterfaceNo
                            }; 
                            sendData(IP + "/Basis/DelInterfaceDetail", param, 'post', function (res) {
                                if (res.code == 0) { //成功
                                if (res.code == 200) { //成功
                                    layer.msg(res.msg, {
                                        icon: 1,
                                        time: 2000 //2秒关闭(如果不配置,默认是3秒)
HTML/views/SystemSettings/InterfaceDetail.html
@@ -20,7 +20,8 @@
            margin-left: -15px;
            margin-right: -15px;
        }
        .layui-table-mend{
        .layui-table-mend {
            position: relative;
        }
    </style>
@@ -28,66 +29,66 @@
<body>
    <div class="layui-form" lay-filter="layuiadmin-app-form-list" id="layuiadmin-app-form-list">
        <div class="layui-form-item" style="padding: 20px 30px 0 0;">
        <div class="layui-form-item" style="padding: 20px 30px 0 0;">
            <div class="layui-inline">
                <label class="layui-form-label">接口编号</label>
                <div class="layui-input-inline">
                    <input type="text" id="InterfaceNo" name="InterfaceNo" autocomplete="off" class="layui-input">
                </div>
                <label class="layui-form-label">接口编号</label>
                <div class="layui-input-inline">
                    <input type="text" id="InterfaceNo" name="InterfaceNo" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">接口名称</label>
                <div class="layui-input-inline">
                    <input type="text" id="InterfaceName" name="InterfaceName" autocomplete="off" class="layui-input">
                </div>
                <label class="layui-form-label">接口名称</label>
                <div class="layui-input-inline">
                    <input type="text" id="InterfaceName" name="InterfaceName" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">接口方向</label>
                <div class="layui-input-inline">
                    <select name="Direction" id="Direction" lay-filter="Direction" lay-search>
                        <option value=""></option>
                        <option value="0">WMS=》SAP</option>
                        <option value="1">WMS=》ERP</option>
                <label class="layui-form-label">接口方向</label>
                <div class="layui-input-inline">
                    <select name="Direction" id="Direction" lay-filter="Direction" lay-search>
                        <option value=""></option>
                        <option value="0">WMS=》SAP</option>
                        <option value="1">WMS=》ERP</option>
                        <option value="2">WMS=》MES</option>
                        <option value="3">WMS=》CRM</option>
                        <option value="4">WMS=》OA</option>
                    </select>
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">传输方式</label>
                <div class="layui-input-inline">
                    <select name="TransmissionMode" id="TransmissionMode" lay-filter="TransmissionMode" lay-search>
                        <option value=""></option>
                        <option value="0">Http+Json</option>
                        <option value="1">Http+Xml</option>
                    </select>
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">数据来源</label>
                <div class="layui-input-inline">
                    <input type="text" id="DataSources" name="DataSources" autocomplete="off" class="layui-input">
                </div>
                    </select>
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">接口地址</label>
                <div class="layui-input-inline">
                    <input type="text" id="Url" name="Url" autocomplete="off" class="layui-input">
                </div>
                <label class="layui-form-label">传输方式</label>
                <div class="layui-input-inline">
                    <select name="TransmissionMode" id="TransmissionMode" lay-filter="TransmissionMode" lay-search>
                        <option value=""></option>
                        <option value="0">Http+Json</option>
                        <option value="1">Http+Xml</option>
                    </select>
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">接口说明</label>
                <div class="layui-input-inline">
                    <input type="text" id="Remark" name="Remark" autocomplete="off" class="layui-input">
                </div>
            </div>
                <label class="layui-form-label">数据来源</label>
                <div class="layui-input-inline">
                    <input type="text" id="DataSources" name="DataSources" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">接口地址</label>
                <div class="layui-input-inline">
                    <input type="text" id="Url" name="Url" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">接口说明</label>
                <div class="layui-input-inline">
                    <input type="text" id="Remark" name="Remark" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-inline" style="margin-left: 10px;">
                <button class="layui-btn layui-btn-sm layuiadmin-btn-list" data-type="add">添加明细</button>
@@ -100,9 +101,10 @@
            <div class="layui-card">
                <div class="layui-card-body">
                    <div style="width: 100%;right: 0;">
                        <table id="LAY-app-content-list" name="LAY-app-content-list" lay-filter="LAY-app-content-list"></table>
                        <table id="LAY-app-content-list" name="LAY-app-content-list" lay-filter="LAY-app-content-list">
                        </table>
                        <script type="text/html" id="templetIsNull">
                        <script type="text/html" id="templetIsNull">
                            {{# function GetBtn(d){
                                    var html = ''; 
                                    html+= '<select name="IsNull" lay-filter="SelctIsNull" data-value="'+d.IsNull+'">'+
@@ -115,7 +117,7 @@
                            {{ GetBtn(d) }}
                        </script>
                        <script type="text/html" id="templetFieldType">
                        <script type="text/html" id="templetFieldType">
                            {{# function GetBtn1(d){
                                    var html = ''; 
                                    html+= '<select name="FieldType" lay-filter="SelctFieldType" data-value="'+d.FieldType+'">'+
@@ -130,7 +132,7 @@
                            {{ GetBtn1(d) }}
                        </script>
                        <script type="text/html" id="templetDataType">
                        <script type="text/html" id="templetDataType">
                            {{# function GetBtn2(d){
                                    var html = ''; 
                                    html+= '<select name="DataType" lay-filter="SelctDataType" data-value="'+d.DataType+'">'+
@@ -142,7 +144,7 @@
                            }}
                            {{ GetBtn2(d) }}
                        </script>
                    </div>
                    </div>
                    <script type="text/html" id="table-content-list">
                        <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del"> <i class="layui-icon layui-icon-delete"></i>删除</a>
@@ -172,7 +174,7 @@
                elem: '#ExpirationDate'
                , format: 'yyyy-MM-dd' //可任意组合
            });
            var TypeValue=$("#Type").val();
            var TypeValue = $("#Type").val();
            // table 基本设置
            var infoOptions = {
@@ -183,133 +185,133 @@
                limit: 30,
                limits: pageLimits,
                cellMinWidth: 60, //全局定义常规单元格的最小宽度,layui 2.2.1 新增
                done: function(){
                    //选中下拉框的值
                    layui.each($('select'), function (index, item) {
                        var elem = $(item);
                        if(elem.data('value')!='' && elem.data('value')!=undefined){
                            elem.val(elem.data('value')).parents('table.layui-table-cell').css('overflow', 'visible');
                        }
                    });
                    form.render();
                },
                done: function () {
                    //选中下拉框的值
                    layui.each($('select'), function (index, item) {
                        var elem = $(item);
                        if (elem.data('value') != '' && elem.data('value') != undefined) {
                            elem.val(elem.data('value')).parents('table.layui-table-cell').css('overflow', 'visible');
                        }
                    });
                    form.render();
                },
                cols: [
                    [{
                        title: '序号',
                        type: 'numbers',
                        width: 50,
                        align: 'center',
                        fixed: 'left'
                    },{
                        field: 'Id',
                        title: 'Id',
                        align: 'center',
                        hide:true,
                        width: 100,
                        edit: 'text'
                    },
                    {
                        field: 'InterfaceNo',
                        title: '接口编号',
                        align: 'center',
                        width: 140
                    },
                    {
                        field: 'ExtField',
                        title: '外系统字段',
                        align: 'center',
                        width: 180,
                        edit: 'text'
                    }, {
                        field: 'MapField',
                        title: '映射字段',
                        align: 'center',
                        width: 180,
                    [{
                        title: '序号',
                        type: 'numbers',
                        width: 50,
                        align: 'center',
                        fixed: 'left'
                    }, {
                        field: 'Id',
                        title: 'Id',
                        align: 'center',
                        hide: true,
                        width: 100,
                        edit: 'text'
                    }, {
                        field: 'Field',
                        title: '本系统字段',
                        align: 'center',
                        width: 180,
                        edit: 'text'
                    },{
                        field: 'FieldType',
                        title: '字段类型',
                        align: 'center',
                        width: 100,
                    },
                    {
                        field: 'InterfaceNo',
                        title: '接口编号',
                        align: 'center',
                        width: 140
                    },
                    {
                        field: 'ExtField',
                        title: '外系统字段',
                        align: 'center',
                        width: 180,
                        edit: 'text'
                    }, {
                        field: 'MapField',
                        title: '映射字段',
                        align: 'center',
                        width: 180,
                        edit: 'text'
                    }, {
                        field: 'Field',
                        title: '本系统字段',
                        align: 'center',
                        width: 180,
                        edit: 'text'
                    }, {
                        field: 'FieldType',
                        title: '字段类型',
                        align: 'center',
                        width: 100,
                        templet: '#templetFieldType'
                    }, {
                        field: 'DataType',
                        title: '数据类型',
                        align: 'center',
                        width: 100,
                    }, {
                        field: 'DataType',
                        title: '数据类型',
                        align: 'center',
                        width: 100,
                        templet: '#templetDataType'
                    },{
                        field: 'FieldFather',
                        title: '父级字段',
                        align: 'center',
                        width: 100,
                        edit: 'text'
                    },
                    {
                        field: 'IsNull',
                        title: '允许为空',
                        align: 'center',
                        width: 100,
                        templet: '#templetIsNull'
                    },
                    {
                        field: 'Remark',
                        title: '说明',
                        align: 'center',
                        width: 180,
                        edit: 'text'
                    },{
                        field: 'CreateUserName',
                        title: '创建人',
                        align: 'center',
                        hide:true,
                        width: 100,
                        edit: 'text'
                    },
                    {
                        field: 'CreateTime',
                        title: '创建时间',
                        align: 'center',
                        hide:true,
                        width: 160,
                        templet: function (d) {
                            return formatDate(d.CreateTime);
                        }
                    },
                    {
                        field: 'UpdateUserName',
                        title: '修改人',
                        align: 'center',
                        hide:true,
                        width: 150,
                    },
                    {
                        field: 'UpdateTime',
                        title: '修改时间',
                        align: 'center',
                        hide:true,
                        width: 150,
                        templet: function (d) {
                            return formatDate(d.UpdateTime);
                        }
                    },
                    {
                        title: '操作',
                        fixed: 'right',
                        width: 120,
                        align: 'center',
                        templet: '#table-content-list'
                    }]
                ]
                    }, {
                        field: 'FieldFather',
                        title: '父级字段',
                        align: 'center',
                        width: 100,
                        edit: 'text'
                    },
                    {
                        field: 'IsNull',
                        title: '允许为空',
                        align: 'center',
                        width: 100,
                        templet: '#templetIsNull'
                    },
                    {
                        field: 'Remark',
                        title: '说明',
                        align: 'center',
                        width: 180,
                        edit: 'text'
                    }, {
                        field: 'CreateUserName',
                        title: '创建人',
                        align: 'center',
                        hide: true,
                        width: 100,
                        edit: 'text'
                    },
                    {
                        field: 'CreateTime',
                        title: '创建时间',
                        align: 'center',
                        hide: true,
                        width: 160,
                        templet: function (d) {
                            return formatDate(d.CreateTime);
                        }
                    },
                    {
                        field: 'UpdateUserName',
                        title: '修改人',
                        align: 'center',
                        hide: true,
                        width: 150,
                    },
                    {
                        field: 'UpdateTime',
                        title: '修改时间',
                        align: 'center',
                        hide: true,
                        width: 150,
                        templet: function (d) {
                            return formatDate(d.UpdateTime);
                        }
                    },
                    {
                        title: '操作',
                        fixed: 'right',
                        width: 120,
                        align: 'center',
                        templet: '#table-content-list'
                    }]
                ]
            };
            // 渲染Table
            refreshTable(null);
            // 渲染Table
            refreshTable(null);
            // 渲染table
            function refreshTable(data) {
                $.extend(infoOptions, {
@@ -329,23 +331,24 @@
                    InterfaceNo: id
                };
                sendData(IP + "/Basis/GetInterfaceList", param, 'post', function (res) {
                    if (res.code == 0) {
                        $("input[name='InterfaceNo']").val(res.data[0].InterfaceNo);
                        $("input[name='InterfaceName']").val(res.data[0].InterfaceName);
                        $("#Direction option[value = '" + res.data[0].Direction + "']").prop("selected", true);
                        $("#TransmissionMode option[value = '" + res.data[0].TransmissionMode + "']").prop("selected", true);
                        $("input[name='Remark']").val(res.data[0].Remark);
                        $("input[name='Url']").val(res.data[0].Url);
                        $("input[name='DataSources']").val(res.data[0].DataSources);
                    if (res.code == 200) {
                        var data = res.data.Items[0];
                        $("input[name='InterfaceNo']").val(data.InterfaceNo);
                        $("input[name='InterfaceName']").val(data.InterfaceName);
                        $("#Direction option[value = '" + data.Direction + "']").prop("selected", true);
                        $("#TransmissionMode option[value = '" + data.TransmissionMode + "']").prop("selected", true);
                        $("input[name='Remark']").val(data.Remark);
                        $("input[name='Url']").val(data.Url);
                        $("input[name='DataSources']").val(data.DataSources);
                        $("#InterfaceNo").attr("disabled", "disabled");
                        var paramDetail = {
                            InterfaceNo:id
                            InterfaceNo: id
                        };
                        sendData(IP + "/Basis/GetInterfaceDetailList", paramDetail, 'post', function (res) {
                            if (res.code == 0) { //成功
                                var data = res.data;
                            if (res.code == 200) { //成功
                                var data = res.data.Items;
                                //页面赋值
                                $.extend(infoOptions, {
                                    data: data
@@ -379,51 +382,50 @@
                if (obj.event == 'del') {
                    layer.confirm('确定删除接口明细?', function (index) {
                        var menu = layui.table.cache["LAY-app-content-list"];
                        menu.splice(obj.tr.data('index'),1);
                        table.reload('LAY-app-content-list',{data : menu});
                        menu.splice(obj.tr.data('index'), 1);
                        table.reload('LAY-app-content-list', { data: menu });
                        layer.close(index)
                    });
                }
            });
            //添加接口明细
            var MapFieldNum=0;
            var MapFieldNum = 0;
            var $ = layui.$,
            active = {
                add: function () {
                    var InterfaceNo=$('#InterfaceNo').val();
                    if(InterfaceNo==''){
                        layer.msg("请输入接口编号!", {
                            icon: 2,
                            time: 2000 //2秒关闭(如果不配置,默认是3秒)
                        }, function () {
                active = {
                    add: function () {
                        var InterfaceNo = $('#InterfaceNo').val();
                        if (InterfaceNo == '') {
                            layer.msg("请输入接口编号!", {
                                icon: 2,
                                time: 2000 //2秒关闭(如果不配置,默认是3秒)
                            }, function () {
                        });
                        return;
                    }
                    var menu = layui.table.cache["LAY-app-content-list"];
                    if(MapFieldNum==0){
                        if(menu!=undefined){
                            var menuLength=menu.length-1;
                            var lastNum=menu[menuLength].MapField.replace('Field','');
                            MapFieldNum=parseInt(lastNum)+1;
                            });
                            return;
                        }
                        else{
                            MapFieldNum=MapFieldNum+1;
                        var menu = layui.table.cache["LAY-app-content-list"];
                        if (MapFieldNum == 0) {
                            if (menu != undefined) {
                                var menuLength = menu.length - 1;
                                var lastNum = menu[menuLength].MapField.replace('Field', '');
                                MapFieldNum = parseInt(lastNum) + 1;
                            }
                            else {
                                MapFieldNum = MapFieldNum + 1;
                            }
                        }
                        else {
                            MapFieldNum = MapFieldNum + 1;
                        }
                        if (menu == undefined) {
                            menu = []
                        }
                        var newRow = { InterfaceNo: InterfaceNo, MapField: 'Field' + MapFieldNum, IsNull: '0' };
                        menu.push(newRow);
                        refreshTable(menu);
                    }
                    else{
                        MapFieldNum=MapFieldNum+1;
                    }
                    if(menu==undefined)
                    {
                        menu=[]
                    }
                    var newRow={InterfaceNo:InterfaceNo,MapField:'Field'+MapFieldNum,IsNull:'0'};
                    menu.push(newRow);
                    refreshTable(menu);
                }
            };
                };
            $('.layui-btn').on('click', function () {
                var type = $(this).data('type');
                active[type] ? active[type].call(this) : '';
@@ -459,48 +461,48 @@
            // 保存接口信息
            form.on('submit(form1)', function (data) {
                var InterfaceNo=$('#InterfaceNo').val();
                if (InterfaceNo == "" || InterfaceNo ==undefined) {
                var InterfaceNo = $('#InterfaceNo').val();
                if (InterfaceNo == "" || InterfaceNo == undefined) {
                    layer.msg("请输入接口编号!", {
                        icon: 2,
                        time: 2000 //2秒关闭(如果不配置,默认是3秒)
                    });
                    return;
                }
                var InterfaceName=$('#InterfaceName').val();
                if (InterfaceName == "" || InterfaceName ==undefined) {
                var InterfaceName = $('#InterfaceName').val();
                if (InterfaceName == "" || InterfaceName == undefined) {
                    layer.msg("请输入接口名称!", {
                        icon: 2,
                        time: 2000 //2秒关闭(如果不配置,默认是3秒)
                    });
                    return;
                }
                var Direction=$('#Direction').val();
                if (Direction == "" || Direction ==undefined) {
                var Direction = $('#Direction').val();
                if (Direction == "" || Direction == undefined) {
                    layer.msg("请选择接口方向!", {
                        icon: 2,
                        time: 2000 //2秒关闭(如果不配置,默认是3秒)
                    });
                    return;
                }
                var TransmissionMode=$('#TransmissionMode').val();
                if (TransmissionMode == "" || TransmissionMode ==undefined) {
                var TransmissionMode = $('#TransmissionMode').val();
                if (TransmissionMode == "" || TransmissionMode == undefined) {
                    layer.msg("请选择传输方式!", {
                        icon: 2,
                        time: 2000 //2秒关闭(如果不配置,默认是3秒)
                    });
                    return;
                }
                var DataSources=$('#DataSources').val();
                if (DataSources == "" || DataSources ==undefined) {
                var DataSources = $('#DataSources').val();
                if (DataSources == "" || DataSources == undefined) {
                    layer.msg("请输入数据来源!", {
                        icon: 2,
                        time: 2000 //2秒关闭(如果不配置,默认是3秒)
                    });
                    return;
                }
                var Url=$('#Url').val();
                if (Url == "" || Url ==undefined) {
                var Url = $('#Url').val();
                if (Url == "" || Url == undefined) {
                    layer.msg("请输入接口地址!", {
                        icon: 2,
                        time: 2000 //2秒关闭(如果不配置,默认是3秒)
@@ -520,18 +522,18 @@
                SetInterface();
            });
            //#region 事件方法
            // 添加接口信息
            var doing = true;
            function SetInterface(data) {
                var item2 = getInterfaceInfo();
                if (item2 !=-1) {
                if (item2 != -1) {
                    if (doing) {
                        doing = false;
                        if (id == null) {
                            // 添加
                            sendData(IP + "/Basis/AddInterface", item2, 'post', function (res) {
                                if (res.code == 0) { //成功
                                if (res.code == 200) { //成功
                                    layer.msg(res.msg, {
                                        icon: 1,
                                        time: 2000 //2秒关闭(如果不配置,默认是3秒)
@@ -551,7 +553,7 @@
                        else {
                            // 编辑
                            sendData(IP + "/Basis/EditInterface", item2, 'post', function (res) {
                                if (res.code == 0) { //成功
                                if (res.code == 200) { //成功
                                    layer.msg(res.msg, {
                                        icon: 1,
                                        time: 2000 //2秒关闭(如果不配置,默认是3秒)
@@ -577,7 +579,7 @@
                            time: 2000 //2秒关闭(如果不配置,默认是3秒)
                        }, function () { doing = true });
                    }
                }
                }
            }
            // 提交获取接口信息
@@ -585,61 +587,61 @@
                var DataList = [];
                var menu = layui.table.cache["LAY-app-content-list"];
                for (var i in menu) {
                    if(menu[i]==[]){
                    if (menu[i] == []) {
                        continue;
                    }
                    if (menu[i].InterfaceNo == "" || menu[i].InterfaceNo ==undefined) {
                    if (menu[i].InterfaceNo == "" || menu[i].InterfaceNo == undefined) {
                        layer.msg("请输入接口编号!", {
                            icon: 2,
                            time: 2000 //2秒关闭(如果不配置,默认是3秒)
                        });
                        return -1;
                    }
                    if (menu[i].ExtField == "" || menu[i].ExtField ==undefined) {
                    if (menu[i].ExtField == "" || menu[i].ExtField == undefined) {
                        layer.msg("请输入外系统字段!", {
                            icon: 2,
                            time: 2000 //2秒关闭(如果不配置,默认是3秒)
                        });
                        return -1;
                    }
                    if (menu[i].MapField == "" || menu[i].MapField ==undefined) {
                    }
                    if (menu[i].MapField == "" || menu[i].MapField == undefined) {
                        layer.msg("请输入映射字段!", {
                            icon: 2,
                            time: 2000 //2秒关闭(如果不配置,默认是3秒)
                        });
                        return -1;
                    }
                    if (menu[i].Field == "" || menu[i].Field ==undefined) {
                    if (menu[i].Field == "" || menu[i].Field == undefined) {
                        layer.msg("请输入本系统字段!", {
                            icon: 2,
                            time: 2000 //2秒关闭(如果不配置,默认是3秒)
                        });
                        return -1;
                    }
                    if (menu[i].FieldType == "" || menu[i].FieldType ==undefined) {
                    if (menu[i].FieldType == "" || menu[i].FieldType == undefined) {
                        layer.msg("请选择字段类型!", {
                            icon: 2,
                            time: 2000 //2秒关闭(如果不配置,默认是3秒)
                        });
                        return -1;
                    }
                    if (menu[i].DataType == "" || menu[i].DataType ==undefined) {
                    if (menu[i].DataType == "" || menu[i].DataType == undefined) {
                        layer.msg("请选择数据类型!", {
                            icon: 2,
                            time: 2000 //2秒关闭(如果不配置,默认是3秒)
                        });
                        return -1;
                    }
                    if (menu[i].IsNull == "" || menu[i].IsNull ==undefined) {
                    if (menu[i].IsNull == "" || menu[i].IsNull == undefined) {
                        layer.msg("请选择允许为空!", {
                            icon: 2,
                            time: 2000 //2秒关闭(如果不配置,默认是3秒)
                        });
                        return -1;
                    }
                    }
                    var item = {
                        Id:menu[i].Id,
                        Id: menu[i].Id,
                        InterfaceNo: menu[i].InterfaceNo,
                        ExtField: menu[i].ExtField,
                        MapField: menu[i].MapField,
@@ -652,7 +654,7 @@
                    };
                    DataList.push(item); //属性
                }
                var item2 = {
                    InterfaceNo: $("#InterfaceNo").val(),
                    InterfaceName: $("#InterfaceName").val(),
@@ -660,7 +662,7 @@
                    TransmissionMode: $("#TransmissionMode").val(),
                    Remark: $("#Remark").val(),
                    Url: $("#Url").val(),
                    DataSources:$("#DataSources").val(),
                    DataSources: $("#DataSources").val(),
                    InterfaceDetail: DataList
                }
                return item2;
Wms/WMS.BLL/SysServer/InterfaceServer.cs
@@ -1,4 +1,6 @@
using Model.ModelDto.SysDto;
using AutoMapper;
using Model.ModelDto.LogDto;
using Model.ModelDto.SysDto;
using Model.ModelVm.SysVm;
using Newtonsoft.Json;
using SqlSugar;
@@ -7,8 +9,11 @@
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using Utility;
using WMS.DAL;
using WMS.Entity.Context;
using WMS.Entity.LogEntity;
using WMS.Entity.SysEntity;
using WMS.IBLL.ILogServer;
using WMS.IBLL.ISysServer;
@@ -20,9 +25,13 @@
        private static readonly SqlSugarScope Db = DataContext.Db;
        private readonly IOperationSysServer _operation; //操作日志
        public InterfaceServer(IOperationSysServer operation)
        private readonly UserManager _userManager;
        private readonly IMapper _mapper;
        public InterfaceServer(IOperationSysServer operation, IMapper mapper, UserManager userManager)
        {
            _operation = operation;
            _userManager = userManager;
            _mapper = mapper;//automapper
        }
        /// <summary>
        /// 获取接口列表
@@ -30,50 +39,23 @@
        /// <param name="model"></param>
        /// <param name="count"></param>
        /// <returns></returns>
        public List<InterfaceDto> GetInterfaceList(InterfaceVm model, out int count)
        public async Task<SqlSugarPagedList<InterfaceDto>> GetInterfaceList(InterfaceVm model)
        {
            string sqlString = string.Empty;
            string sqlCount = string.Empty;
            string sqlPub = string.Empty;
            try
            {
                sqlCount += "SELECT DISTINCT COUNT(tb1.Id) FROM SysInterface AS tb1 ";
                sqlString += "SELECT DISTINCT tb1.*,tb2.RealName as CreateUserName,tb3.RealName as UpdateUserName FROM SysInterface AS tb1 ";
                sqlPub += "LEFT JOIN SysUserInfor AS tb2 ON tb1.CreateUser = tb2.Id ";
                sqlPub += "LEFT JOIN SysUserInfor AS tb3 ON tb1.UpdateUser = tb3.Id ";
                sqlPub += $"WHERE tb1.IsDel=0 ";
                if (!string.IsNullOrEmpty(model.InterfaceNo))
                {
                    sqlPub += $"AND tb1.InterfaceNo LIKE '%{model.InterfaceNo}%' ";
                }
                if (!string.IsNullOrEmpty(model.InterfaceName))
                {
                    sqlPub += $"AND tb1.InterfaceName LIKE '%{model.InterfaceName}%' ";
                }
                if (!string.IsNullOrEmpty(model.Direction))
                {
                    sqlPub += $"AND tb1.Direction = '{model.Direction}' ";
                }
                sqlCount += sqlPub;
                sqlPub += " order by tb1.Id ";
                if (model.Page == 0)
                {
                    model.Page = 1;
                }
                sqlString += sqlPub + $" offset {((model.Page - 1) * model.Limit)} rows fetch next {model.Limit} rows only;";
                var com = new Common();
                count = com.GetRowCount(sqlCount);
                var modelList = Db.Ado.SqlQuery<InterfaceDto>(sqlString);
                return modelList;
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return await Db.Queryable<SysInterface>()
                           .LeftJoin<SysUserInfor>((a, b) => a.CreateUser == b.Id)
                           .LeftJoin<SysUserInfor>((a, b, c) => a.UpdateUser == c.Id)
                           .Where(a => a.IsDel == "0")
                           .WhereIF(!string.IsNullOrEmpty(model.InterfaceNo), a => a.InterfaceNo.Contains(model.InterfaceNo))
                           .WhereIF(!string.IsNullOrEmpty(model.InterfaceName), a => a.InterfaceName.Contains(model.InterfaceName))
                           .WhereIF(!string.IsNullOrEmpty(model.Direction), a => a.Direction == model.Direction)
                           .OrderBy(a => a.Id)
                           .Select<InterfaceDto>((a, b, c) => new InterfaceDto()
                           {
                               Id = a.Id,
                               CreateUserName = b.RealName,
                               UpdateUserName = c.RealName,
                           }, true)
                           .ToPagedListAsync(model.Page, model.Limit);
        }
        /// <summary>
        /// 获取接口明细列表
@@ -81,39 +63,20 @@
        /// <param name="model"></param>
        /// <param name="count"></param>
        /// <returns></returns>
        public List<InterfaceDetailDto> GetInterfaceDetailList(InterfaceDetailVm model, out int count)
        public async Task<SqlSugarPagedList<InterfaceDetailDto>> GetInterfaceDetailList(InterfaceDetailVm model)
        {
            string sqlString = string.Empty;
            string sqlCount = string.Empty;
            int rowCount = 1;
            try
            {
                if (model.Page == 0)
                {
                    model.Page = 1;
                }
                sqlCount += $"SELECT COUNT(ID) FROM SysInterfaceDetail where InterfaceNo = '{model.InterfaceNo}' and isdel = '0';";
                var com = new Common();
                count = com.GetRowCount(sqlCount);
                if (count != 0)
                {
                    rowCount = count;
                }
                sqlString += "SELECT tb1.*,tb2.RealName as CreateUserName,tb3.RealName as UpdateUserName FROM SysInterfaceDetail AS tb1 ";
                sqlString += "LEFT JOIN SysUserInfor AS tb2 ON tb1.CreateUser = tb2.Id ";
                sqlString += "LEFT JOIN SysUserInfor AS tb3 ON tb1.UpdateUser = tb3.Id ";
                sqlString += $"WHERE tb1.InterfaceNo = '{model.InterfaceNo}' AND tb1.IsDel = '0' order by tb1.Id ";
                sqlString += $"offset {((model.Page - 1) * model.Limit)} rows fetch next {rowCount} rows only;";
                var modelList = Db.Ado.SqlQuery<InterfaceDetailDto>(sqlString);
                return modelList;
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return await Db.Queryable<SysInterfaceDetail>()
                           .LeftJoin<SysUserInfor>((a, b) => a.CreateUser == b.Id)
                           .LeftJoin<SysUserInfor>((a, b, c) => a.UpdateUser == c.Id)
                           .Where(a => a.IsDel == "0")
                           .WhereIF(!string.IsNullOrEmpty(model.InterfaceNo), a => a.InterfaceNo == model.InterfaceNo)
                           .Select<InterfaceDetailDto>((a, b, c) => new InterfaceDetailDto()
                           {
                               Id = a.Id,
                               CreateUserName = b.RealName,
                               UpdateUserName = c.RealName,
                           }, true)
                           .ToPagedListAsync(model.Page, model.Limit);
        }
        /// <summary>
@@ -121,63 +84,27 @@
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public string AddInterface(InterfaceVm model)
        public async Task AddInterface(InterfaceVm model)
        {
            string strMessage = "";
            string sqlString = string.Empty;
            string sqlDetailStr = string.Empty;
            try
            if (await Db.Queryable<SysInterface>().AnyAsync(s => s.InterfaceNo == model.InterfaceNo))
            {
                string sqlCount = $"SELECT COUNT(ID) FROM SysInterface where InterfaceNo = '{model.InterfaceNo}' and isdel = '0';";
                var com = new Common().GetRowCount(sqlCount);
                if (com > 0)
                {
                    strMessage = "-1:接口编号已存在,请勿重复添加!";
                    return strMessage;
                }
                //接口总信息
                sqlString += "Insert into SysInterface (InterfaceNo,InterfaceName,Direction,TransmissionMode,Remark,Url,DataSources,CreateUser) values ( ";
                sqlString += $"'{model.InterfaceNo}','{model.InterfaceName}','{model.Direction}','{model.TransmissionMode}','{model.Remark}','{model.Url}','{model.DataSources}','{model.CreateUser}' );";
                //接口明细
                var detailModels = model.InterfaceDetail;
                foreach (InterfaceDetailVm detailModel in detailModels)
                {
                    sqlDetailStr += "Insert into SysInterfaceDetail (InterfaceNo,ExtField,MapField,Field,";
                    sqlDetailStr += "FieldType,DataType,IsNull,Remark,FieldFather,CreateUser) values ( ";
                    sqlDetailStr += $"'{model.InterfaceNo}','{detailModel.ExtField}','{detailModel.MapField}','{detailModel.Field}', ";
                    sqlDetailStr += $"'{detailModel.FieldType}','{detailModel.DataType}','{detailModel.IsNull}','{detailModel.Remark}','{detailModel.FieldFather}','{model.CreateUser}'); ";
                }
                if (sqlDetailStr == string.Empty)
                {
                    return strMessage;
                }
                Db.Ado.BeginTran();
                int rowCount = Db.Ado.ExecuteCommand(sqlString);
                var rowDetailCount = 1;
                if (sqlDetailStr.Length > 0)
                {
                    rowDetailCount = Db.Ado.ExecuteCommand(sqlDetailStr);
                }
                Db.Ado.CommitTran();
                if (rowCount > 0 && rowDetailCount > 0)
                {
                    //维护操作日志
                    _operation.InsertOperation("系统设置", "接口管理", model.InterfaceNo, "添加", $"添加了接口编号为{model.InterfaceNo}的接口信息", Convert.ToInt32(model.CreateUser));
                    return strMessage;
                }
                else
                {
                    Db.Ado.RollbackTran();
                    return "-2:添加失败数据回滚!";
                }
                throw Oops.Bah("接口编号已存在,请勿重复添加");
            }
            catch (Exception ex)
            SysInterface modInterface = _mapper.Map<SysInterface>(model);
            modInterface.CreateUser = _userManager.UserId;
            modInterface.CreateTime = DateTime.Now;
            await Db.Insertable<SysInterface>(modInterface).ExecuteCommandAsync();
            List<SysInterfaceDetail> listDetails = new List<SysInterfaceDetail>();
            foreach (InterfaceDetailVm detailModel in model.InterfaceDetail)
            {
                throw new Exception(ex.Message);
                SysInterfaceDetail modDetail = _mapper.Map<SysInterfaceDetail>(detailModel);
                modDetail.CreateTime = modInterface.CreateTime;
                modDetail.CreateUser = _userManager.UserId;
                listDetails.Add(modDetail);
            }
            await Db.Insertable(listDetails).ExecuteCommandAsync();
        }
        /// <summary>
@@ -185,50 +112,44 @@
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public string EditInterface(InterfaceVm model)
        public async Task EditInterface(InterfaceVm model)
        {
            string strMessage = "";
            string sqlString = string.Empty;
            string sqlDetailStr = string.Empty;
            try
            SysInterface modInterface = _mapper.Map<SysInterface>(model);
            modInterface.UpdateUser = _userManager.UserId;
            modInterface.UpdateTime = DateTime.Now;
            await Db.Updateable(modInterface)
                .UpdateColumns(s => new { s.InterfaceName, s.Direction, s.TransmissionMode, s.Remark, s.Url, s.DataSources, s.UpdateTime, s.UpdateUser })
                .ExecuteCommandAsync();
            var listDetails = await Db.Queryable<SysInterfaceDetail>().Where(s => s.InterfaceNo == model.InterfaceNo && s.IsDel == "0").ToListAsync();
            foreach (SysInterfaceDetail dbDetailModel in listDetails)
            {
                sqlString = "UPDATE SysInterface SET ";
                sqlString += $"InterfaceName = '{model.InterfaceName}',Direction = '{model.Direction}',";
                sqlString += $"TransmissionMode = '{model.TransmissionMode}',Remark = '{model.Remark}',Url = '{model.Url}',DataSources = '{model.DataSources}', ";
                sqlString += $"UpdateTime = GETDATE(),UpdateUser = '{model.CreateUser}' ";
                sqlString += $"WHERE InterfaceNo = '{model.InterfaceNo}'";
                var detailModels = model.InterfaceDetail;
                sqlDetailStr += $"SELECT * FROM SysInterfaceDetail WHERE InterfaceNo = '{model.InterfaceNo}' and isDel = '0';";
                var dbDetailModels = DataContext.Db.Ado.SqlQuery<SysInterfaceDetail>(sqlDetailStr);
                sqlDetailStr = string.Empty;
                // 处理已删除的明细
                foreach (SysInterfaceDetail dbDetailModel in dbDetailModels)
                if (!model.InterfaceDetail.Any(s => s.Id == dbDetailModel.Id))
                {
                    if (detailModels.Count(it => it.Id == dbDetailModel.Id) == 0)
                    {
                        sqlDetailStr += $"UPDATE SysInterfaceDetail SET IsDel = '1',";
                        sqlDetailStr += $"UpdateTime = GETDATE(),UpdateUser = '{model.CreateUser}' ";
                        sqlDetailStr += $"WHERE Id = {dbDetailModel.Id};";
                    }
                    await Db.Updateable<SysInterfaceDetail>()
                    .SetColumns(s => s.IsDel == "1")
                    .SetColumns(s => s.UpdateTime == DateTime.Now)
                    .SetColumns(s => s.UpdateUser == _userManager.UserId)
                    .Where(s => s.Id == dbDetailModel.Id && s.IsDel == "0")
                    .ExecuteCommandAsync();
                }
            }
                // 处理修改和添加的明细
                foreach (InterfaceDetailVm detailModel in detailModels)
            // 处理修改和添加的明细
            foreach (InterfaceDetailVm detailModel in model.InterfaceDetail)
            {
                if (detailModel.Id == 0 || detailModel.Id == null)
                {
                    if (detailModel.Id == 0 || detailModel.Id == null)
                    {
                        sqlDetailStr += "Insert into SysInterfaceDetail (InterfaceNo,ExtField,MapField,Field,";
                        sqlDetailStr += "FieldType,DataType,IsNull,Remark,FieldFather,CreateUser) values ( ";
                        sqlDetailStr += $"'{model.InterfaceNo}','{detailModel.ExtField}','{detailModel.MapField}','{detailModel.Field}', ";
                        sqlDetailStr += $"'{detailModel.FieldType}','{detailModel.DataType}','{detailModel.IsNull}','{detailModel.Remark}','{detailModel.FieldFather}','{model.CreateUser}'); ";
                    }
                    else
                    {
                        //判断是否更改
                        int rowNum = dbDetailModels
                            .Count(it => it.Id == detailModel.Id
                    var modDetail = _mapper.Map<SysInterfaceDetail>(detailModel);
                    modDetail.CreateTime = DateTime.Now;
                    modDetail.CreateUser = _userManager.UserId;
                    modDetail.UpdateUser = _userManager.UserId;
                    modDetail.UpdateTime = DateTime.Now;
                    await Db.Insertable(modDetail).ExecuteCommandAsync();
                }
                else
                {
                    int rowNum = listDetails.Count(it => it.Id == detailModel.Id
                                         && it.ExtField == detailModel.ExtField
                                         && it.MapField == detailModel.MapField
                                         && it.Field == detailModel.Field
@@ -237,44 +158,17 @@
                                         && it.IsNull == detailModel.IsNull
                                         && it.Remark == detailModel.Remark
                                         && it.FieldFather == detailModel.FieldFather);
                        if (rowNum > 0)
                        {
                            continue;
                        }
                        sqlDetailStr += $"UPDATE SysInterfaceDetail SET ";
                        sqlDetailStr += $"ExtField = '{detailModel.ExtField}',MapField = '{detailModel.MapField}',Field='{detailModel.Field}',FieldFather='{detailModel.FieldFather}', ";
                        sqlDetailStr += $"FieldType = '{detailModel.FieldType}',DataType = '{detailModel.DataType}', ";
                        sqlDetailStr += $"IsNull = '{detailModel.IsNull}',Remark = '{detailModel.Remark}', ";
                        sqlDetailStr += $"UpdateTime = GETDATE(),UpdateUser = '{model.CreateUser}' ";
                        sqlDetailStr += $"WHERE Id = {detailModel.Id};";
                    if (rowNum > 0)
                    {
                        continue;
                    }
                    var modDetail = _mapper.Map<SysInterfaceDetail>(detailModel);
                    modDetail.UpdateUser = _userManager.UserId;
                    modDetail.UpdateTime = DateTime.Now;
                    await Db.Updateable<SysInterfaceDetail>(modDetail)
                        .UpdateColumns(s => new { s.ExtField, s.MapField, s.Field, s.FieldFather, s.FieldType, s.DataType, s.IsNull, s.Remark, s.UpdateUser, s.UpdateTime })
                        .ExecuteCommandAsync();
                }
                Db.Ado.BeginTran();
                int rowCount = Db.Ado.ExecuteCommand(sqlString);
                var rowDetailCount = 1;
                if (sqlDetailStr.Length > 0)
                {
                    rowDetailCount = Db.Ado.ExecuteCommand(sqlDetailStr);
                }
                Db.Ado.CommitTran();
                if (rowCount > 0 && rowDetailCount > 0)
                {
                    //维护操作日志
                    _operation.InsertOperation("系统设置", "接口管理", model.InterfaceNo, "编辑", $"编辑了接口编号为{model.InterfaceNo}的接口信息", Convert.ToInt32(model.CreateUser));
                    return strMessage;
                }
                else
                {
                    Db.Ado.RollbackTran();
                    return "-2:添加失败数据回滚!";
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
@@ -283,36 +177,21 @@
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public string DelInterface(InterfaceVm model)
        public async Task DelInterface(InterfaceVm model)
        {
            try
            {
                string sqlString = "";
                // 删除总
                sqlString = $"UPDATE SysInterface SET IsDel = '1',";
                sqlString += $"UpdateTime = GETDATE(),UpdateUser = '{model.CreateUser}' ";
                sqlString += $"WHERE InterfaceNo = '{model.InterfaceNo}';";
            await Db.Updateable<SysInterface>()
                    .SetColumns(s => s.IsDel == "1")
                    .SetColumns(s => s.UpdateTime == DateTime.Now)
                    .SetColumns(s => s.UpdateUser == _userManager.UserId)
                    .Where(s => s.InterfaceNo == model.InterfaceNo && s.IsDel == "0")
                    .ExecuteCommandAsync();
                // 删除明细
                sqlString += $"UPDATE SysInterfaceDetail SET IsDel = '1',";
                sqlString += $"UpdateTime = GETDATE(),UpdateUser = '{model.CreateUser}' ";
                sqlString += $"WHERE InterfaceNo = '{model.InterfaceNo}';";
                Db.Ado.BeginTran();
                int rowCount = Db.Ado.ExecuteCommand(sqlString);
                if (rowCount < 2)
                {
                    Db.RollbackTran();
                    return "-1:删除失败!";
                }
                Db.Ado.CommitTran();
                _operation.InsertOperation("系统设置", "接口管理", model.InterfaceNo, "删除", $"删除了接口编号为{model.InterfaceNo}的接口信息", Convert.ToInt32(model.CreateUser));
                return "";
            }
            catch (Exception ex)
            {
                throw ex;
            }
            await Db.Updateable<SysInterfaceDetail>()
                    .SetColumns(s => s.IsDel == "1")
                    .SetColumns(s => s.UpdateTime == DateTime.Now)
                    .SetColumns(s => s.UpdateUser == _userManager.UserId)
                    .Where(s => s.InterfaceNo == model.InterfaceNo && s.IsDel == "0")
                    .ExecuteCommandAsync();
        }
        /// <summary>
@@ -320,34 +199,16 @@
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public string DelInterfaceDetail(InterfaceDetailVm model)
        public async Task DelInterfaceDetail(InterfaceDetailVm model)
        {
            try
            {
                string sqlString = "";
                // 删除明细
                sqlString += $"UPDATE SysInterfaceDetail SET IsDel = '1',";
                sqlString += $"UpdateTime = GETDATE(),UpdateUser = '{model.CreateUser}' ";
                sqlString += $"WHERE Id = '{model.Id}';";
                Db.Ado.BeginTran();
                int rowCount = Db.Ado.ExecuteCommand(sqlString);
                if (rowCount < 1)
                {
                    Db.RollbackTran();
                    return "-1:删除失败!";
                }
                Db.Ado.CommitTran();
                _operation.InsertOperation("系统设置", "接口管理", model.InterfaceNo, "删除", $"删除了接口编号为{model.InterfaceNo},本系统字段为{model.Field}的接口信息", Convert.ToInt32(model.CreateUser));
                return "";
            }
            catch (Exception ex)
            {
                throw ex;
            }
            await Db.Updateable<SysInterfaceDetail>()
                    .SetColumns(s => s.IsDel == "1")
                    .SetColumns(s => s.UpdateTime == DateTime.Now)
                    .SetColumns(s => s.UpdateUser == _userManager.UserId)
                    .Where(s => s.Id == model.Id)
                    .ExecuteCommandAsync();
        }
        //public void ceshi()
        //{
        //    string interfaceNo = "A0001";
@@ -360,7 +221,7 @@
        /// </summary>
        /// <param name="InterfaceNo">接口编号</param>
        /// <param name="param">存储过程参数</param>
        public void RespondResult(string InterfaceNo,string param)
        public void RespondResult(string InterfaceNo, string param)
        {
            try
            {
@@ -427,13 +288,13 @@
                    var response = Utility.Tools.HttpHelper.DoPost(interfaceModel.Url, jsonData, interfaceModel.InterfaceName, interfaceModel.Remark);
                }
                else
                {
                }
                {
                }
            }
            catch (Exception ex)
            {
            {
            }
        }
        /// <summary>
@@ -455,7 +316,7 @@
        }
    }
    public class RequestData
    {
    {
        public string Field1 { get; set; }
        public string Field2 { get; set; }
        public string Field3 { get; set; }
Wms/WMS.IBLL/ISysServer/IInterfaceServer.cs
@@ -3,6 +3,8 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using Utility;
using WMS.Entity.SysEntity;
namespace WMS.IBLL.ISysServer
@@ -15,7 +17,7 @@
        /// <param name="model"></param>
        /// <param name="count"></param>
        /// <returns></returns>
        List<InterfaceDto> GetInterfaceList(InterfaceVm model, out int count);
        Task<SqlSugarPagedList<InterfaceDto>> GetInterfaceList(InterfaceVm model);
        /// <summary>
        /// 获取接口明细列表
@@ -23,34 +25,34 @@
        /// <param name="model"></param>
        /// <param name="count"></param>
        /// <returns></returns>
        List<InterfaceDetailDto> GetInterfaceDetailList(InterfaceDetailVm model, out int count);
        Task<SqlSugarPagedList<InterfaceDetailDto>> GetInterfaceDetailList(InterfaceDetailVm model);
        /// <summary>
        /// 添加接口信息
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        string AddInterface(InterfaceVm model);
        Task AddInterface(InterfaceVm model);
        /// <summary>
        /// 编辑接口信息
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        string EditInterface(InterfaceVm model);
        Task EditInterface(InterfaceVm model);
        /// <summary>
        /// 删除接口信息
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        string DelInterface(InterfaceVm model);
        Task DelInterface(InterfaceVm model);
        /// <summary>
        /// 删除接口明细信息
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        string DelInterfaceDetail(InterfaceDetailVm model);
        Task DelInterfaceDetail(InterfaceDetailVm model);
    }
}
Wms/Wms/AutoMapperServer/AutoMapperProfile.cs
@@ -3,6 +3,7 @@
using Model.ModelDto.LogDto;
using Model.ModelDto.SysDto;
using Model.ModelVm.SysVm;
using WMS.Entity.SysEntity;
namespace Wms.AutoMapperServer
{
@@ -29,6 +30,9 @@
            CreateMap<WMS.Entity.LogEntity.LogOperationSys, OperationDto>().ReverseMap();//系统操作日志(实体与Dto)
            CreateMap<WMS.Entity.SysEntity.SysException, ExceptionDto>().ReverseMap();//异常处理(实体与Dto)
            CreateMap<WMS.Entity.SysEntity.SysInterface, InterfaceVm>().ReverseMap();
            CreateMap<WMS.Entity.SysEntity.SysInterfaceDetail, InterfaceDetailVm>().ReverseMap();
        }
    }
}
Wms/Wms/Controllers/BasisController.cs
@@ -1781,18 +1781,10 @@
        /// <param name="model"></param>
        /// <returns></returns>
        [HttpPost]
        public IActionResult GetInterfaceList(InterfaceVm model)
        [ServiceFilter(typeof(ApiResponseActionFilter))]
        public async Task<SqlSugarPagedList<InterfaceDto>> GetInterfaceList(InterfaceVm model)
        {
            try
            {
                var models = _interface.GetInterfaceList(model, out int count);
                return Ok(new { code = 0, count, msg = "接口列表", data = models });
            }
            catch (Exception e)
            {
                return Ok(new { code = 1, msg = e.Message });
            }
            return await _interface.GetInterfaceList(model);
        }
        /// <summary>
@@ -1801,18 +1793,10 @@
        /// <param name="model"></param>
        /// <returns></returns>
        [HttpPost]
        public IActionResult GetInterfaceDetailList(InterfaceDetailVm model)
        [ServiceFilter(typeof(ApiResponseActionFilter))]
        public async Task<SqlSugarPagedList<InterfaceDetailDto>> GetInterfaceDetailList(InterfaceDetailVm model)
        {
            try
            {
                var models = _interface.GetInterfaceDetailList(model, out int count);
                return Ok(new { code = 0, count, msg = "接口明细列表", data = models });
            }
            catch (Exception e)
            {
                return Ok(new { code = 1, msg = e.Message });
            }
            return await _interface.GetInterfaceDetailList(model);
        }
        /// <summary>
@@ -1821,41 +1805,19 @@
        /// <param name="model"></param>
        /// <returns></returns>
        [HttpPost]
        public IActionResult AddInterface(InterfaceVm model)
        [ServiceFilter(typeof(ApiResponseActionFilter))]
        [UnitOfWork]
        public async Task AddInterface(InterfaceVm model)
        {
            try
            await _interface.AddInterface(model);
            await _operation.InsertOperation(new OperationInputVm()
            {
                var claimsIdentity = this.User.Identity as ClaimsIdentity;
                if (claimsIdentity == null)
                {
                    throw new Exception("未获取到用户信息");
                }
                string UserId = claimsIdentity.FindFirst(ClaimTypes.Name)?.Value;
                if (string.IsNullOrWhiteSpace(UserId))
                {
                    throw new Exception("未获取到用户信息");
                }
                model.CreateUser = int.Parse(UserId);
                string strMesage = _interface.AddInterface(model);
                if (strMesage == "")
                {
                    return Ok(new { code = 0, msg = "添加成功" });
                }
                if (strMesage.Contains("-1"))
                {
                    return Ok(new { code = 1, msg = strMesage });
                }
                else
                {
                    return Ok(new { code = 0, msg = strMesage });
                }
            }
            catch (Exception e)
            {
                return Ok(new { code = 1, msg = e.Message });
            }
                ParentName = "系统设置",
                MenuName = "接口管理",
                FkNo = model.InterfaceNo,
                TypeName = "添加",
                Msg = $"添加了接口编号为{model.InterfaceNo}的接口信息"
            });
        }
        /// <summary>
@@ -1864,41 +1826,19 @@
        /// <param name="model"></param>
        /// <returns></returns>
        [HttpPost]
        public IActionResult EditInterface(InterfaceVm model)
        [ServiceFilter(typeof(ApiResponseActionFilter))]
        [UnitOfWork]
        public async Task EditInterface(InterfaceVm model)
        {
            try
            await _interface.EditInterface(model);
            await _operation.InsertOperation(new OperationInputVm()
            {
                var claimsIdentity = this.User.Identity as ClaimsIdentity;
                if (claimsIdentity == null)
                {
                    throw new Exception("未获取到用户信息");
                }
                string UserId = claimsIdentity.FindFirst(ClaimTypes.Name)?.Value;
                if (string.IsNullOrWhiteSpace(UserId))
                {
                    throw new Exception("未获取到用户信息");
                }
                model.CreateUser = int.Parse(UserId);
                string strMesage = _interface.EditInterface(model);
                if (strMesage == "")
                {
                    return Ok(new { code = 0, msg = "编辑成功" });
                }
                if (strMesage.Contains("-1"))
                {
                    return Ok(new { code = 0, msg = "部分成功" });
                }
                else
                {
                    return Ok(new { code = 1, msg = strMesage });
                }
            }
            catch (Exception e)
            {
                return Ok(new { code = 1, msg = e.Message });
            }
                ParentName = "系统设置",
                MenuName = "接口管理",
                FkNo = model.InterfaceNo,
                TypeName = "编辑",
                Msg = $"编辑了接口编号为{model.InterfaceNo}的接口信息"
            });
        }
        /// <summary>
@@ -1907,37 +1847,19 @@
        /// <param name="model"></param>
        /// <returns></returns>
        [HttpPost]
        public IActionResult DelInterface(InterfaceVm model)
        [ServiceFilter(typeof(ApiResponseActionFilter))]
        [UnitOfWork]
        public async Task DelInterface(InterfaceVm model)
        {
            try
            await _interface.DelInterface(model);
            await _operation.InsertOperation(new OperationInputVm()
            {
                var claimsIdentity = this.User.Identity as ClaimsIdentity;
                if (claimsIdentity == null)
                {
                    throw new Exception("未获取到用户信息");
                }
                string UserId = claimsIdentity.FindFirst(ClaimTypes.Name)?.Value;
                if (string.IsNullOrWhiteSpace(UserId))
                {
                    throw new Exception("未获取到用户信息");
                }
                model.CreateUser = int.Parse(UserId);
                string strMesage = _interface.DelInterface(model);
                if (strMesage == "")
                {
                    return Ok(new { code = 0, msg = "删除成功" });
                }
                else
                {
                    return Ok(new { code = 1, msg = strMesage });
                }
            }
            catch (Exception e)
            {
                return Ok(new { code = 1, msg = e.Message });
            }
                ParentName = "系统设置",
                MenuName = "接口管理",
                FkNo = model.InterfaceNo,
                TypeName = "编辑",
                Msg = $"删除了接口编号为{model.InterfaceNo}的接口信息"
            });
        }
        /// <summary>
@@ -1946,37 +1868,19 @@
        /// <param name="model"></param>
        /// <returns></returns>
        [HttpPost]
        public IActionResult DelInterfaceDetail(InterfaceDetailVm model)
        [ServiceFilter(typeof(ApiResponseActionFilter))]
        [UnitOfWork]
        public async Task DelInterfaceDetail(InterfaceDetailVm model)
        {
            try
            await _interface.DelInterfaceDetail(model);
            await _operation.InsertOperation(new OperationInputVm()
            {
                var claimsIdentity = this.User.Identity as ClaimsIdentity;
                if (claimsIdentity == null)
                {
                    throw new Exception("未获取到用户信息");
                }
                string UserId = claimsIdentity.FindFirst(ClaimTypes.Name)?.Value;
                if (string.IsNullOrWhiteSpace(UserId))
                {
                    throw new Exception("未获取到用户信息");
                }
                model.CreateUser = int.Parse(UserId);
                string strMesage = _interface.DelInterfaceDetail(model);
                if (strMesage == "")
                {
                    return Ok(new { code = 0, msg = "删除成功" });
                }
                else
                {
                    return Ok(new { code = 1, msg = strMesage });
                }
            }
            catch (Exception e)
            {
                return Ok(new { code = 1, msg = e.Message });
            }
                ParentName = "系统设置",
                MenuName = "接口管理",
                FkNo = model.InterfaceNo,
                TypeName = "编辑",
                Msg = $"删除了接口编号为{model.InterfaceNo}的接口信息,本系统字段为{model.Field}的接口信息"
            });
        }
        #endregion
    }