站长信息
jeffery.xu
jeffery.xu

软件工程师

欢迎访问我的个人笔记网站!我是一名热爱技术的开发者,专注于Web开发和技术分享。

811495111@qq.com
18521510875
筛选

个人笔记

修改线下订单退单记录罐码
工作笔记
private dynamic ReturnScanOrderSubmit(WebParameterContext webContext)
{
    var response = new ServerContext<dynamic>() { ResponseMessage = new ResponseMessage() { Success = true } };
    ActionReturnResponseMessage = () =>
    {
        TransactionResult<dynamic> transactionResult = new TransactionResult<dynamic>();
        response = VerifyReturnScanData(webContext);
        if (response.ResponseMessage.Success == false)
        {
            return response;
        }
        try
        {
            var result = Dalserver.Base.BatchExecuteForTransaction(() =>
            {
                try
                {

                    LogUtil.DoLog("ReturnOrderSubmit-webContext", JSON.ToJSON(webContext));
                    // 获取请求体中的数据
                    string tank_codes = string.Join(",", webContext.RequestBody.tank_codes.ToArray());
                    string StoreID = webContext?.StoreID.ToString();

                    dynamic Datas = DynamicExtension.EmptyDynamic;

                    Datas = Dalserver.DA.Query("CT_GetOffIDData", new { codes = tank_codes, FK_StoreID = StoreID });
                    if (Datas != null && Datas is IEnumerable<dynamic> list && ((IEnumerable<dynamic>)Datas).ToList().Count > 0)
                    {
                        var returnData = new List<dynamic>();
                        returnData = ((IEnumerable<dynamic>)Datas).ToList();

                        var idList = returnData
                            .Select(x => x.ID)
                            .ToList();

                        foreach (var id in idList)
                        {
                            dynamic updatequery = DynamicExtension.EmptyDynamic;
                            updatequery.ID = id;
                            dynamic updateObj = DynamicExtension.EmptyDynamic;
                            updateObj.Status = 2;
                            Dalserver.Base.DataLogicFactory(new SqlDynamicContext("TBProductTankCode", OperationType.EDITE, updatequery, updateObj));
                        }

                        var orderList = returnData
                            .GroupBy(x => x.OrderID)
                            .Select(g => new
                            {
                                OrderID = g.Key,
                            })
                            .ToList();
                        // 为每个OrderID创建一个单独的ProductReturnCreate
                        Dictionary<string, dynamic> orderReturnMap = new Dictionary<string, dynamic>();

                        foreach (var order in orderList)
                        {
                            string orderNumber = GetOrderNumberByID(order.OrderID?.ToString()); // 假设有这个方法获取订单号
                            dynamic returnID = ProductReturnCreate(webContext.Account.Id.ToString(), 0, webContext.StoreID?.ToString(), orderNumber);
                            orderReturnMap.Add(order.OrderID?.ToString(), returnID);
                        }
                        var detailList = returnData
                            .GroupBy(x => new { DetailID = x.DetailID, OrderID = x.OrderID })
                            .Select(g => new
                            {
                                DetailID = g.Key.DetailID,
                                ProductCount = g.Count(),
                                ProductID = g.First().ProductID,
                                OrderID = g.First().OrderID,
                                OnlinePrice = Convert.ToDecimal(g.First().OnlinePrice),
                                TankCodes = g.Select(x => x.TankCode).Where(tc => !string.IsNullOrEmpty(tc)).Distinct().ToList()
                            })
                            .ToList();


                        foreach (var detail in detailList)
                        {
                            UpdateProductOrderDetail(detail.DetailID, detail.ProductCount);
                            dynamic returnID = orderReturnMap[detail.OrderID?.ToString()];
                            CreateReturnDetail(detail, returnID, webContext.Account.Id.ToString(), 1);
                        }

                        foreach (var order in orderList)
                        {
                            UpdateMainProductOrder(order.OrderID);
                        }

                        foreach (var returnID in orderReturnMap.Values)
                        {
                            UpdateMainReturnProductOrder(returnID);
                        }

                        var ProductList = returnData
                            .GroupBy(x => x.ProductID)
                            .Select(g => new
                            {
                                ProductID = g.Key,
                                TankCodes = g.Select(x => x.TankCode).Where(tc => !string.IsNullOrEmpty(tc)).Distinct().ToList(),
                                TankCodeCount = g.Select(x => x.TankCode).Where(tc => !string.IsNullOrEmpty(tc)).Distinct().ToList().Count
                            })
                            .ToList();
                        foreach (var detail in ProductList)
                        {
                            string Message = ReturnStock(detail.ProductID?.ToString(), webContext.StoreID, (int)detail.TankCodeCount, detail.TankCodes);
                            if (!string.IsNullOrEmpty(Message))
                            {
                                response.ResponseMessage.ErrorMessage = Message;
                                response.ResponseMessage.ErrorCode = 500;
                                response.ResponseMessage.Success = false;
                                response.Status = DynamicExtension.EmptyDynamic;
                                return false;
                            }
                        }
                        response.ResponseMessage.ErrorMessage = "退单成功!";
                        response.ResponseMessage.ErrorCode = 200;
                        response.Status = string.Join(",", orderReturnMap.Values);
                    }
                    else
                    {
                        response.ResponseMessage.ErrorMessage = "未查询到订单!";
                        response.ResponseMessage.ErrorCode = 500;
                        response.ResponseMessage.Success = false;
                        response.Status = DynamicExtension.EmptyDynamic;
                        return false;
                    }

                    return true;
                }
                catch (Exception e)
                {
                    LogUtil.LogExceptionInfo("ReturnOrderSubmit-接口异常", e);
                    response.ResponseMessage.Success = false;
                    response.ResponseMessage.ErrorMessage = e.Message;
                    response.ResponseMessage.ErrorCode = 500;
                    return false;
                }
            }, transactionResult);



            return response;
        }
        catch (Exception ex)
        {
            LogUtil.LogExceptionInfo("ReturnOrderSubmit-接口异常", ex);
            response.ResponseMessage.Success = false;
            response.ResponseMessage.ErrorCode = 500;
            response.ResponseMessage.ErrorMessage = "程序异常!" + ex.Message;
            return response;
        }

    };
    return webContext;
}
private dynamic CreateReturnDetail(dynamic detail, dynamic returnID, dynamic AccountID, int ReturnType)
{
    ServerContext<dynamic> data = new ServerContext<dynamic>();
    dynamic factory = DynamicExtension.EmptyDynamic;
    factory.FK_TBProduct_ID = detail.ProductID?.ToString();
    factory.ProductCode = GetProductCodeByID(detail.ProductID?.ToString());
    factory.ProductName = GetProductNameByID(detail.ProductID?.ToString());
    factory.QuantityNum = detail.ProductCount; // 总数量
    factory.QuantityMoney = (decimal)detail.OnlinePrice * (int)detail.ProductCount;
    factory.FK_TBProductReturn_ID = returnID;
    factory.FK_TBProductOrder_ID = detail.OrderID?.ToString(); // 订单来源(固定线下)
    factory.FK_TBProductOrderDetail_ID = detail.DetailID?.ToString(); // 订单来源(固定线下)
    factory.FK_SystemUser_Create_ID = AccountID;    // 创建人ID
    factory.FK_SystemUser_Modify_ID = AccountID;    // 修改人ID
    factory.IsValid = 1;
    factory.CreateTime = DateTime.Now;
    factory.ModifyTime = DateTime.Now;
    SqlDynamicContext sql = new SqlDynamicContext("TBProductReturnDetail", OperationType.ADD, factory: factory);
    data = Dalserver.Base.DataLogicFactory(sql);//新增
    var detailID = data.Status?.ToString();
    if (ReturnType == 1)
    {
        foreach (var tankCode in detail.TankCodes)
        {
            if (!string.IsNullOrEmpty(tankCode?.ToString()))
            {
                CreateReturnTankCode(tankCode, returnID?.ToString(), detail.ProductID?.ToString(), AccountID, detailID);
            }
        }
    }
    return data.Status;


}
记录一个BUG
工作笔记

<Column isVirtualField="false" field="a_ExpectedInstallationTime" fkField="" title="预计装机时间" titleTooltip="预计装机时间" funcValue="CONVERT(varchar(100), a.ExpectedInstallationTime, 23)" align="left" sortable="false" order="" formatter="" level="2" visible="true" gridPickerShow="true" notExport="false" notImport="false" isBold="false" fontSize="0" /> funcValue里的值写错了,需要牢记

APOC修复客户关联关系BUG,修复发票导入空行BUG
工作笔记
if (this.gpCustomer.SelectedValue.ToString() != string.Empty && this.gpSD.SelectedValue.ToString() != string.Empty && this.gpCustomer.SelectedValue.ToString() != "-1" && this.gpSD.SelectedValue.ToString() != "-1")
{
    if (((Enums.PageStatus)Session["Session_PageStatus"]) == SOI.Enums.PageStatus.Create || ((Enums.PageStatus)Session["Session_PageStatus"]) == SOI.Enums.PageStatus.Edit)
    {
        //if ((Enums.PageStatus)Session["Session_PageStatus"] == SOI.Enums.PageStatus.Create)

        Wicresoft.Session.Session session = new Wicresoft.Session.Session();
        string sql = @"select count(*) from SOI_DealerCustomer where  isvalid=1 and FK_CustomerInfo=" + gpCustomer.SelectedValue + "and FK_Dealer=" + gpSD.SelectedValue + " and customerkind='客户'" + ((Enums.PageStatus)Session["Session_PageStatus"] == SOI.Enums.PageStatus.Create ? "" : (" AND PKID!= " + this.PKID));
        int i = Convert.ToInt32(session.SqlHelper.ExecuteScalar(sql, CommandType.Text));
        if (i > 0)
        {
            valiateSDDName.ErrorMessage = "经销商与医院已做过关联";
            args.IsValid = false;
        }
    }
}
更新医院客户关联关系(APOC)
工作笔记

新疆生产建设兵团总医院
新疆生产建设兵团第一师医院
新疆生产建设兵团第六师医院101团分院
新疆生产建设兵团第十三师红星医院
新疆生产建设兵团第十师北屯医院
新疆生产建设兵团第四师六十二团医院
石河子大学医学院第一附属医院
第八师石河子市总医院(石河子市人民医院、石河子大学医学院第三附属医院)
新疆生产建设兵团第三师总医院四十五团分院

运费模板XML
工作笔记
<GridViewConfig xmlns="http://www.mobizone.cn/Configuration/GridViewConfig" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<GridViewName>TBFreightTemplate</GridViewName>
<GridViewBase>
<!--列表ID-->
<GridViewId>ID00423D3CB9574D98A2898BAE9CC82009</GridViewId>
<!--列表Ng-Mode指令-->
<NgModel>NM00423D3CB9574D98A2898BAE9CC82009</NgModel>
<!--表单请求方式-->
<Method>POST</Method>
<!--表单请求数据源路径-->
<URL>Gridview/LoadData</URL>
<!--启用缓存-->
<Cache>false</Cache>
<!--是否单选-->
<SingleSelect>true</SingleSelect>
<!--分页-->
<Pagination>true</Pagination>
<!--表格样式-->
<Classes>table table-hover table-no-bordered</Classes>
<!--排序方式-->
<Sort>desc</Sort>
<!--默认排序字段-->
<SortName>a_CreateTime</SortName>
<!--是否显示行间隔色-->
<Striped>true</Striped>
<!--表格汉化-->
<Locales>zh-US</Locales>
<!--显示搜索框-->
<Search>false</Search>
<!--是否启用所有列-->
<ShowColumns>true</ShowColumns>
<!--是否启用刷新事件-->
<ShowRefresh>true</ShowRefresh>
<!--最少允许的列数-->
<MinimumCountColumns>2</MinimumCountColumns>
<!--是否显示导出-->
<ShowExport>true</ShowExport>
<!--basic', 'all', 'selected'-->
<ExportDataType>all</ExportDataType>
<!--是否显示详细视图和列表视图的切换按钮-->
<ShowToggle>true</ShowToggle>
<!--工具按钮用哪个容器-->
<!--<Toolbar>#toolbar</Toolbar>  -->
<!--分页大小-->
<PageSize>20</PageSize>
<PageNumber>1</PageNumber>
<!--<pageList>[10, 20, 50, 100, 200, 500]</pageList>-->
<!--标识哪个字段为id主键-->
<IdField>a_ID</IdField>
<!--针对弹出框放大镜的选择字段-->
<GridPickerSelectField>a_TemplateName</GridPickerSelectField>
<!--下拉框是单选框-->
<SelectItemName>a_ID</SelectItemName>
<!--刷新事件必须设置-->
<Silent>true</Silent>
<!--点击行即可选中单选/复选框-->
<ClickToSelect>true</ClickToSelect>
<!--参数格式,发送标准的RESTFul类型的参数请求-->
<QueryParamsType>limit</QueryParamsType>
<!--参数-->
<!--<QueryParams>$.queryParams</QueryParams>  -->
<!--表单列-->
<SidePagination>server</SidePagination>
<!--列表第一列配置-->
<FistColumn checkbox="true" align="center"/>
</GridViewBase>
<ColumnList>
<Column field="a_ID" title="ID" align="left" sortable="false" formatter="" visible="false" class="" level="1" notExport="true"></Column>
<Column field="a_TemplateName" title="模板名称" align="left" sortable="true" formatter="" visible="true" class="" level="2" gridPickerShow="true"/>
<Column field="b_BigName" title="大区" align="left" sortable="true" formatter="" visible="true" class="" level="3" gridPickerShow="true"/>
<Column field="b_DiquName" title="地区" align="left" sortable="true" formatter="" visible="true" class="" level="3" gridPickerShow="true"/>
<Column field="b_ProviceName" title="省份" align="left" sortable="true" formatter="" visible="true" class="" level="3" gridPickerShow="true"/>
<Column field="b_CityName" title="城市" align="left" sortable="true" formatter="" visible="true" class="" level="3" gridPickerShow="true"/>
<Column field="b_DName" title="区县" align="left" sortable="true" formatter="" visible="true" class="" level="3" gridPickerShow="true"/>
<Column field="b_Code" title="门店编码" align="left" sortable="true" formatter="" visible="true" class="" level="3" gridPickerShow="true"/>
<Column field="b_Name" title="门店名称" align="left" sortable="true" formatter="" visible="true" class="" level="3" gridPickerShow="true"/>
<Column field="a_DeliveryMethod" title="配送方式值" align="center" sortable="true" formatter="" visible="false" notExport="true" class="" level="3" gridPickerShow="true"/>
<Column field="a_DeliveryMethodText" title="配送方式" align="center" sortable="true" formatter="" visible="true" class="" level="3" gridPickerShow="true"/>
<Column field="a_TemplateType" title="模板类型值" align="center" sortable="true" formatter="" visible="false" notExport="true" class="" level="3" gridPickerShow="true"/>
<Column field="a_TemplateTypeText" title="模板类型" align="center" sortable="true" formatter="" visible="true" class="" level="3" gridPickerShow="true"/>
<Column field="a_IsFreeShipping" title="是否包邮值" align="center" sortable="true" formatter="" visible="false" notExport="true" class="" level="4" gridPickerShow="true"/>
<Column field="a_IsFreeShippingText" title="是否包邮" align="center" sortable="true" formatter="" visible="true" class="" level="4" gridPickerShow="true"/>
<Column field="a_FreeShippingMoney" title="免邮金额" align="right" sortable="true" formatter="" visible="true" class="" level="4" gridPickerShow="true"/>
<Column field="a_FreeShippingNum" title="免邮数量" align="right" sortable="true" formatter="" visible="true" class="" level="4" gridPickerShow="true"/>
<Column field="a_IsDefault" title="默认" align="center" sortable="true" formatter="" visible="false" notExport="true" class="" level="5" gridPickerShow="true"/>
<Column field="a_IsDefaultText" title="默认模板" align="center" sortable="true" formatter="" visible="true" class="" level="5" gridPickerShow="true"/>
<Column field="a_TemplateStatus" title="模板状态值" align="center" sortable="true" formatter="" visible="false" notExport="true" class="" level="6" gridPickerShow="true"/>
<Column field="a_TemplateStatusText" title="模板状态" align="center" sortable="true" formatter="" visible="true" class="" level="6" gridPickerShow="true"/>
<Column field="a_ReturnValue" title="运费方式值" align="center" sortable="true" formatter="" visible="false" notExport="true" class="" level="6" gridPickerShow="true"/>
<Column field="a_ReturnValueText" title="运费方式" align="center" sortable="true" formatter="" visible="true" class="" level="6" gridPickerShow="true"/>
<Column field="a_CreateTime" title="创建时间" align="left" sortable="true" formatter="formatterDatetime" visible="true" class="" level="33" gridPickerShow="true" notExport="true"/>
<Column field="cu_ChineseName" title="创建人" align="left" sortable="true" formatter="" visible="true" class="" level="33" gridPickerShow="true"/>
<Column field="a_ModifyTime" title="修改时间" align="left" sortable="true" formatter="formatterDatetime" visible="true" class="" level="33" gridPickerShow="true" notExport="true"/>
<Column field="mu_ChineseName" title="修改人" align="left" sortable="true" formatter="" visible="true" class="" level="33" gridPickerShow="true"/>
</ColumnList>
<TableMapping tableName="V_TBFreightTemplate" tableFixName="a" title="运费模板管理">
<Relations>
<JoinTable tableName="V_TBstoreInfo" tableFixName="b" Condition="a.FK_TBStore_ID=b.ID" type="Left_Join" level="1"/>
<!--关联创建用户-->
<JoinTable tableName="cu_SystemUser" tableFixName="cu" Condition="a.FK_SystemUser_Create_ID=cu.id" type="Left_Join" level="1"/>
<!--关联修改用户-->
<JoinTable tableName="mu_SystemUser" tableFixName="mu" Condition="a.FK_SystemUser_Modify_ID=mu.id" type="Left_Join" level="1"/>
</Relations>
<!--附加条件语句-->
<QueryWhereClause><![CDATA[a.IsDelete=0]]></QueryWhereClause>
</TableMapping>
<SearchForm isFixedPanel="true">
<FormController>FormController</FormController>
<ElementList>
<!--模板名称-->
<Element elementType="TextBox" dataType="" required="false" name="a_TemplateName" model="a_TemplateName" fullRow="false" searchType="Like">
<StyleClass modeClass="col-sm-3" labelBeforeClass="col-sm-4 control-label" labelEndClass="" inputClass="form-control " inputParentClass="col-sm-8" />
<ElementTextInfo lableBeforeText="模板名称" lableEndText="" placeholder="请输入模板名称" defaultValue=""/>
</Element>
<Element elementType="TextBox" dataType="" required="false" name="b_BigName" model="b_BigName" fullRow="false" searchType="Like">
<StyleClass modeClass="col-sm-3" labelBeforeClass="col-sm-4 control-label" labelEndClass="" inputClass="form-control " inputParentClass="col-sm-8" />
<ElementTextInfo lableBeforeText="大区" lableEndText="" placeholder="" defaultValue=""/>
</Element>
<Element elementType="TextBox" dataType="" required="false" name="b_DiquName" model="b_DiquName" fullRow="false" searchType="Like">
<StyleClass modeClass="col-sm-3" labelBeforeClass="col-sm-4 control-label" labelEndClass="" inputClass="form-control " inputParentClass="col-sm-8" />
<ElementTextInfo lableBeforeText="地区" lableEndText="" placeholder="" defaultValue=""/>
</Element>
<Element elementType="TextBox" dataType="" required="false" name="b_ProviceName" model="b_ProviceName" fullRow="false" searchType="Like">
<StyleClass modeClass="col-sm-3" labelBeforeClass="col-sm-4 control-label" labelEndClass="" inputClass="form-control " inputParentClass="col-sm-8" />
<ElementTextInfo lableBeforeText="省份" lableEndText="" placeholder="" defaultValue=""/>
</Element>
<Element elementType="TextBox" dataType="" required="false" name="b_CityName" model="b_CityName" fullRow="false" searchType="Like">
<StyleClass modeClass="col-sm-3" labelBeforeClass="col-sm-4 control-label" labelEndClass="" inputClass="form-control " inputParentClass="col-sm-8" />
<ElementTextInfo lableBeforeText="城市" lableEndText="" placeholder="" defaultValue=""/>
</Element>
<Element elementType="TextBox" dataType="" required="false" name="b_DName" model="b_DName" fullRow="false" searchType="Like">
<StyleClass modeClass="col-sm-3" labelBeforeClass="col-sm-4 control-label" labelEndClass="" inputClass="form-control " inputParentClass="col-sm-8" />
<ElementTextInfo lableBeforeText="区县" lableEndText="" placeholder="" defaultValue=""/>
</Element>
<Element elementType="TextBox" dataType="" required="false" name="b_Code" model="b_Code" fullRow="false" searchType="Like">
<StyleClass modeClass="col-sm-3" labelBeforeClass="col-sm-4 control-label" labelEndClass="" inputClass="form-control " inputParentClass="col-sm-8" />
<ElementTextInfo lableBeforeText="门店编码" lableEndText="" placeholder="" defaultValue=""/>
</Element>
<Element elementType="TextBox" dataType="" required="false" name="b_Name" model="b_Name" fullRow="false" searchType="Like">
<StyleClass modeClass="col-sm-3" labelBeforeClass="col-sm-4 control-label" labelEndClass="" inputClass="form-control " inputParentClass="col-sm-8" />
<ElementTextInfo lableBeforeText="门店名称" lableEndText="" placeholder="" defaultValue=""/>
</Element>
 
<!--配送方式-->
<Element elementType="multiple" dataType="" required="false" name="a_DeliveryMethod" model="a_DeliveryMethod" fullRow="false" validateType="">
<StyleClass modeClass="col-sm-3" labelBeforeClass="col-sm-4 control-label" labelEndClass="" inputClass="form-control" inputParentClass="col-sm-8" />
<ElementTextInfo lableBeforeText="配送方式" lableEndText="" placeholder="" defaultValue=""/>
<SelectItemList multipleChoice="false">
<SelectItem text="快递" value="1" />
<SelectItem text="自提" value="2" />
<SelectItem text="同城配送" value="3" />
<SelectItem text="物流" value="4" />
</SelectItemList>
</Element>
 
<!--模板类型-->
<Element elementType="multiple" dataType="" required="false" name="a_TemplateType" model="a_TemplateType" fullRow="false" validateType="">
<StyleClass modeClass="col-sm-3" labelBeforeClass="col-sm-4 control-label" labelEndClass="" inputClass="form-control" inputParentClass="col-sm-8" />
<ElementTextInfo lableBeforeText="模板类型" lableEndText="" placeholder="" defaultValue=""/>
<SelectItemList multipleChoice="false">
<SelectItem text="按件数" value="2" />
<!--<SelectItem text="按重量" value="2" />
<SelectItem text="按体积" value="3" />-->
</SelectItemList>
</Element>
 
<!--模板状态-->
<Element elementType="multiple" dataType="" required="false" name="a_TemplateStatus" model="a_TemplateStatus" fullRow="false" validateType="">
<StyleClass modeClass="col-sm-3" labelBeforeClass="col-sm-4 control-label" labelEndClass="" inputClass="form-control" inputParentClass="col-sm-8" />
<ElementTextInfo lableBeforeText="模板状态" lableEndText="" placeholder="" defaultValue=""/>
<SelectItemList multipleChoice="false">
<SelectItem text="启用" value="1" />
<SelectItem text="禁用" value="0" />
</SelectItemList>
</Element>
<!--是否免邮-->
<Element elementType="multiple" dataType="" required="false" name="a_IsFreeShipping" model="a_IsFreeShipping" fullRow="false" validateType="">
<StyleClass modeClass="col-sm-3" labelBeforeClass="col-sm-4 control-label" labelEndClass="" inputClass="form-control" inputParentClass="col-sm-8" />
<ElementTextInfo lableBeforeText="是否包邮" lableEndText="" placeholder="" defaultValue=""/>
<SelectItemList multipleChoice="false">
<SelectItem text="是" value="1" />
<SelectItem text="否" value="0" />
</SelectItemList>
</Element>
<!--是否默认模板-->
<Element elementType="multiple" dataType="" required="false" name="a_IsDefault" model="a_IsDefault" fullRow="false" validateType="">
<StyleClass modeClass="col-sm-3" labelBeforeClass="col-sm-4 control-label" labelEndClass="" inputClass="form-control" inputParentClass="col-sm-8" />
<ElementTextInfo lableBeforeText="默认模板" lableEndText="" placeholder="" defaultValue=""/>
<SelectItemList multipleChoice="false">
<SelectItem text="是" value="1" />
<SelectItem text="否" value="0" />
</SelectItemList>
</Element>
 
<!--运费方式-->
<Element elementType="multiple" dataType="" required="false" name="a_ReturnValue" model="a_ReturnValue" fullRow="false" validateType="">
<StyleClass modeClass="col-sm-3" labelBeforeClass="col-sm-4 control-label" labelEndClass="" inputClass="form-control" inputParentClass="col-sm-8" />
<ElementTextInfo lableBeforeText="运费方式" lableEndText="" placeholder="" defaultValue=""/>
<SelectItemList multipleChoice="false">
<SelectItem text="买家承担" value="1" />
<SelectItem text="卖家承担" value="0" />
</SelectItemList>
</Element>
 
</ElementList>
</SearchForm>
<ButtonList>
<Button name="btn_delete" text="删除" class="btn btn-default" spanClass="glyphicon glyphicon-remove" level="2"></Button>
<Button name="btn_custom_use" text="启用\禁用" class="btn btn-outline-primary" spanClass="glyphicon glyphicon-file" level="8"></Button>
</ButtonList>
<ParameterList>
<!---外部关联参数-->
<outParameter>template_name,template_id</outParameter>
<!---如果存在直接调用使用-->
<innerParameter>template_id=1 and template_name='标准模板'</innerParameter>
<!---静态参数,如果存在直接调用使用-->
<staticParam><![CDATA[{a.IsDelete=0}]]></staticParam>
</ParameterList>
</GridViewConfig>
小河马启用禁用运费模板js
工作笔记
button_custom_submit: function (t) {
    var body = t.RequestButton;
    switch (body.name) {
        case "btn_custom_use"://启用/禁用
            var dt = mzServer.selectRow();
            if (dt.ResponseMessage.Success) {
                if (dt.Stats.length < 1) {
                    $scope.view.submit.Fn.loading(t.RequestButton.name, false);
                    mzServer.Msg.error("请选择一条数据");

                    return;
                }
                debugger;
                $scope.view.submit.Fn.loading(t.RequestButton.name, false);
                var state = dt.Stats[0].a_TemplateStatus; var tip = "";
                if (state == 1) {
                    state = 0; tip = "禁用";
                } else {
                    state = 1; tip = "启用";
                }
                mzServer.confirm('确定' + tip + '吗?').result.then(function (isconfirm) {
                    debugger;
                    if (isconfirm) {
                        var data = {};
                        var Info = {};
                        Info.a_ID = dt.Stats[0].a_ID;
                        Info.a_Status = state;
                        data.ConfigType = "view";
                        data.OpType = "query";
                        data.ConfigName = "TBFreightTemplate";
                        data.RequestBody = JSON.stringify(Info);
                        data.SpecialParameter = "ForbidOrUse";
                        data.url = "gridview/LoadData";
                        mzServer.postData(data).then(
                            function (response) {
                                console.log(response);
                                if (response.data.ResponseMessage.Success) {
                                    mzServer.Msg.success(tip+"成功!");
                                    angular.element("table[for='TBFreightTemplate']").bootstrapTable('refresh');
                                } else {
                                    mzServer.Msg.error(response.data.ResponseMessage.ErrorMessage);
                                }
                            }, function (error) {
                                mzServer.Msg.error(error);
                            });

                    }
                });
            }
            else {
                $scope.view.submit.Fn.loading(t.RequestButton.name, false);
                mzServer.Msg.error(dt.ResponseMessage.ErrorMessage);
            }
            break;

        default:
            mzServer.Msg.error("无效的事件");
            break;
    }

},
运费模板requestBody记录
工作笔记
//requestbody 详解
// {
//         // ========== 运费模板主表字段 (TBFreightTemplate) ==========
//         "ID": "运费模板ID", // 可选,有ID,则为EDITE,无为ADD
//         "TemplateName": "标准运费模板", // 必填 - 模板名称(唯一一个必须填写的)
//         "FK_TBMerchant_ID": "12345678-4115-11F0-98EC-0242AC110004", // 可选 - 关联商户ID
//         "DeliveryMethod": 1, // 可选 - 配送方式(1-快递,2-自提,3-同城配送,4-不配送)
//         "FK_TBStore_ID": "971A17B6-406B-11F0-98EC-0242AC110004", // 可选 - 关联门店ID
//         "TemplateType": 1, // 可选 - 模板类型(1-按件数,2-按重量,3-按金额) 默认1
//         "IsFreeShipping": false, // 可选 - 是否包邮(true/false) 默认false
//         "FreeShippingMoney": 100.00, // 可选 - 包邮金额 默认false
//         "FreeShippingNum": 20, // 可选 - 包邮数量  默认false
//         "IsDefault": true, // 可选 - 是否默认模板(true/false) 默认false
//         "IsAllRegion": true, // 可选 - 是否全国配送(true/false) 默认true
//         "FreeShippingCondition": 2, // 可选 - 包邮条件类型(1-满件数包邮,2-满金额包邮,3-满重量包邮)
//         "FreeShippingValue": 99.00, // 可选 - 包邮条件值
//         "ReturnValue": 0, // 可选 - 退货运费(0-卖家承担,1-买家承担)
//         "TemplateStatus": 1, // 可选 - 模板状态(0-禁用,1-启用) 默认1
//         "Sort": 10, // 可选 - 排序
//         "Memo": "这是标准运费模板的备注信息", // 可选 - 备注
//         // ========== 配送区域数组 (TBFreightTemplateRegion) ==========
//         "regions": [
//             {
//                 // 区域表字段
//                 "ID": "运费区域ID", // 可选,有ID,则为EDITE,无为ADD
//                 "RegionName": "江浙沪地区", // 可选 - 配送区域名称
//                 "IsFreeShipping": false, // 可选 - 是否包邮(true/false) 默认false
//                 "FreeShippingMoney": 100.00, // 可选 - 包邮金额
//                 "FreeShippingNum": 20, // 可选 - 包邮数量  
//                 "DeliveryType": 1, // 可选 - 配送类型(1-配送,2-不配送)
//                 "FirstUnit": 1, // 可选 - 首件/首重/首体积 默认1
//                 "FirstPrice": 8.00, // 可选 - 首件/首重/首体积价格 默认0
//                 "ContinueUnit": 1, // 可选 - 续件/续重/续体积 默认1
//                 "ContinuePrice": 5.00, // 可选 - 续件/续重/续体积价格 默认0
//                 // 区域表可选字段
//                 "ProvIds": "[\"82AEABFB-D580-4C2F-BF5C-02F5B7D6DDC2\",\"F6201801-28BC-442B-83E3-05D1C3604075\",\"3DDAD486-8C24-44AF-849D-062BF506FFC2\"]", // 可选 - 省份ID列表(JSON格式)
//                 "ProvNames": "北京,天津,河北省", // 可选 - 省份名称
//                 "CityIds": [], // 可选 - 城市编码列表(JSON格式)
//                 "DistrictIds": [], // 可选 - 区县编码列表(JSON格式)
//                 "FreeShippingCondition": 2, // 可选 - 区域包邮条件类型(1-满件数,2-满金额,3-满重量)
//                 "FreeShippingValue": 88.00, // 可选 - 区域包邮条件值
//                 "IsRegionFree": false, // 可选 - 该区域是否包邮 默认false
//                 "Sort": 1, // 可选 - 排序
//                 "Memo": "江浙沪地区配送", // 可选 - 备注
//                 // ========== 计费详情数组 (TBFreightTemplateDetail) ==========
//                 "details": [
//                     {
//                         // 详情表字段 - 现在全部为可选
//                         "MinValue": 1.000, // 可选 - 最小值(件数/重量/体积)
//                         "MaxValue": 5.000, // 可选 - 最大值(件数/重量/体积)
//                         "Price": 8.00, // 可选 - 该区间价格
//                         "PriceType": 1, // 可选 - 价格类型(1-固定价格,2-每单位价格)
//                         "Sort": 1, // 可选 - 排序
//                         "Memo": "1-5件商品运费" // 可选 - 备注
//                     },
//                     {
//                         "MinValue": 6.000,
//                         "MaxValue": 10.000,
//                         "Price": 12.00,
//                         "PriceType": 1,
//                         "Sort": 2,
//                         "Memo": "6-10件商品运费"
//                     }
//                 ]
//             },
//             {
//                 // 第二个配送区域示例
//                 "RegionName": "其他地区",
//                 "IsFreeShipping": false, // 可选 - 是否包邮(true/false) 默认false
//                 "FreeShippingMoney": 100.00, // 可选 - 包邮金额
//                 "FreeShippingNum": 20, // 可选 - 包邮数量  
//                 "DeliveryType": 1,
//                 "FirstUnit": 1,
//                 "FirstPrice": 12.00,
//                 "ContinueUnit": 1,
//                 "ContinuePrice": 8.00,
//                 "ProvIds": "[\"88131078-7258-4846-BD02-3E31A25F1336\"]",
//                 "ProvNames": "江苏省", // 可选 - 省份名称
//                 "FreeShippingCondition": 2,
//                 "FreeShippingValue": 150.00,
//                 "IsRegionFree": false,
//                 "Sort": 2,
//                 "Memo": "其他地区配送",
//                 "details": [
//                     {
//                         "MinValue": 1.000,
//                         "MaxValue": 3.000,
//                         "Price": 12.00,
//                         "PriceType": 1,
//                         "Sort": 1,
//                         "Memo": "1-3件商品运费"
//                     }
//                 ]
//             }
//         ]
//     }
// }